Resolvconf, keep DNS settings persistent

Linux only

This only concerns when the resolvconf package is installed

cd /etc/resolvconf/resolv.conf.d
sudo cp -p head head.orig  #backup copy, always do this
sudo nano head

The top of the file is a scary warning. The file /etc/resolv.conf is autogenerated from the contents of this file; the warning is there so it will get put in /etc/resolv.conf when /etc/resolv.conf is generated.

To the end of the file, add (IP of DNS server):

nameserver <ip_of_nameserver>

Press Ctrl x and answer yes to saving the file. To finish up, regenerate /etc/resolv.conf so the changes are applied right now:

sudo resolvconf -u
Last update: Tue, 13 Sep 2022 14:32:15