Ubuntu 12.04, DNS, and Static IPs

Having stumbled on the new /etc/resolv.conf methods of Ubuntu 12.04 a number of times, I hope this is useful for you as well.

The contents of /etc/resolv.conf in Ubuntu are now controlled by “dns-nameservers #.#.#.#” in your /etc/network/interfaces file, like this:

# The primary network interface
auto eth0
iface eth0 inet static
    address 10.0.191.100
    netmask 255.255.255.0
    network 10.0.191.0
    gateway 10.0.191.1

dns-nameservers 8.8.8.8 4.2.2.2

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.