Make DNS stick in Ubuntu

Networking 101 – DNS must be configured properly if you intend to do anything using the internet.

Simple statement, not so simple a process.  No longer can you simply edit the resolv.conf file or even add dns servers to your interfaces file.  These changes no longer stick after a reboot.  I’m not going to discuss why, since I find the reasoning and logic full of challenges that won’t change the simple fact that it’s just better to do it this way:

Edit the file /etc/resolvconf/resolv.conf.d/base
sudo nano /etc/resolvconf/resolv.conf.d/base

Add the name servers to this file.
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

Run the following command to apply the changes.
sudo resolvconf -u

Check the file /etc/resolv.conf to make sure the changes took place.
cat /etc/resolv.conf

Thanks to J.P. for this.  I pulled my hair out!

Comments are closed.