Static DNS Entries in Ubuntu 12.04 LTS – Precise Pangolin

I have been using Ubuntu 10.04 LTS (Lucid Lynx) for a while now, but recently have started deploying Ubuntu 12.04 LTS (Precise Pangolin) for new builds. For our purposes, the newer LTS build doesn’t take much getting used to. I did however, run into one difference during initial building, while trying to set static DNS servers. It didn’t seem to be very well documented (I found the answer through some forum – can’t remember where it was).

Static DNS settings in 10.04 are found, and easily changed in /etc/resolv.conf. However when viewing the same file in 12.04 we see the following warning, but no instruction on where to go 🙁


In 12.04 we have to add a dns-nameservers line to the end of /etc/network/interfaces as follows:


After adding the above line and rebooting you should be all set 🙂

As an afterthought, I figured I would include ALL the locations in Ubuntu Precise that I use to change network settings manually:

/etc/network/interfaces (IP + Gateway + DNS)

/etc/udev/rules.d/70-persistent-net.rules (delete or rename)

/etc/hosts (ip + host names)

/etc/hostname (hostname)