DNS problems in Alpine Linux container

I’m testing out an Alpine Linux container on my Turris Omnia. It was easy to get going but soon I realised DNS was not working as expected. Example:

`$ nslookup forum.turris.cz`
`nslookup: can't resolve '(null)': Name does not resolve`

This is with static network configuration and /etc/resolv.conf containing only one line “nameserver”. I have tried to upgrade Alpine to Edge - still same problem. I have read that the musl libc has some issues with DNS but they should have been fixed in Edge.

Am I doing somehting wrong? Any ideas?

chmod +r /etc/resolv.conf

1 Like

Thank you very much!

Edit file
and add
chmod go+r "$RESOLV_CONF"
after line 95 to make this work even when the DHCP client updates resolv.con

Edit files in “/usr/share/” not usually a good idea, because they are overwritten on system update.

I am using static IP address…

But you can try to copy “/usr/share/udhcpc/default.script” to “/etc/udhcpc/udhcpc.conf” and modificate it. If the only that you want udhcpc not to touch resolv.conf simply create “/etc/udhcpc/udhcpc.conf” with next content: RESOLV_CONF="NO"