Sometimes when I run the commands:
sudo apk update && sudo apk upgrade
Over Alpine linux fails to update the packages even if connected to internet. But if I do sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
I manage to dowload them. But this solution:
- Causes me frustration I need to set dns all over the time.
- Sometimes
/etc/resolv.conf
gets overriden by itself.
How I can have a more permanent solution?
Best Answer
tl;dr
Open file /etc/udhcpc/udhcpc.conf with a text editor.
If the file is missing you just have to create it (and probably its containing folder).
Append line
Done.
Found here: https://wiki.alpinelinux.org/wiki/Udhcpc
The accepted answer wasn't satisfying in my case for
I'm sure there are more instructions on how to make dhclient replace stuff instead of prepending things, but that's too much research and headache for something as simple as preventing DHCP from replacing /etc/resolv.conf at all.