home / blog

Static IP addresses with Ubuntu 11.10 regression

Static IP addresses. Things have changed slightly, before (11.04 and earlier) you could have a static IP address AND the DNS entry from your DHCP. Now if you have a static interface in /etc/network/interfaces the /etc/resolve.conf file get clobbered by NetworkManager with no content (apart from comment).

# Generated by NetworkManager

This can be solved by using the dns-nameservers directive. Example

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 192.168.1.254

Now when the machine comes up the /etc/resolve.conf has the correct content:

# Generated by NetworkManager
nameserver 192.168.1.254
This entry was posted in geek and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.