Debian networking

The network interface name

The network interface name is assigned to each hardware interface in the Linux Kernel through the user space configuration mechanism, udev, as it is found. In order to ensure each network interface is named persistently through each reboot, there is a file (/etc/udev/rules.d/70-persistent-net.rules) which is automatically generated by the /lib/udev/write_net_rules program, probably run by the persistent-net-generator.rules rules file. You can modify this file to change the interface name i.e. from eth0 to eth4. The mac address must be in lower case.

Static DNS Nameservers

You've perhaps noticed that when configuring a static interface in /etc/network/interfaces, /etc/resolv.conf gets overwritten on boot so that your manually inserted nameserver entries are gone. (You did read the warning that any changes would be overwritten - that warning, by the way is in /etc/resolvconf/resolv.conf.d/head) The Debian way to get ifup to publish nameserver information to resolvconf when it configures an interface is, according to man 8 resolvconf, to add dns- lines to the relevant iface stanza in /etc/network/interfaces. To add nameserver addresses add a line beginning with dns-nameservers.

           dns-nameservers 11.22.33.44 55.66.77.88
Notice the 's' at the end of the word nameservers and the space between DNS server IP addresses.

For example, a complete basic static iface stanza in /etc/network/interfaces looks like this:

# The primary network interface
iface eth0 inet static
  broadcast 192.168.1.255
  network 192.168.1.0
  gateway 192.168.1.1
  netmask 255.255.255.0
  address 192.168.1.38
  dns-nameservers 208.67.222.222 208.67.220.220

Now, on boot, the nameservers will be listed in /etc/resolv.conf.

In order to make this all work, you will have to undo any and all changes you may have made trying to fix the original problem. This includes removing the network-manager package and re-installing the resolvconf package.

As a side note, there _is_ a "Debian" way to fix most if not all problems and to prevent further grief inflicted by applying changes willy-nilly that one finds in the wild such as by doing a Google search. Many of those recommendations are made either by Non-Debian users, or by ill-informed Debian users. This resolvconf issue is a classic example and a lot of effort has been put into the solution. Read /usr/share/doc/resolvconf/README.gz to get an appreciation of what it takes to do things the right way.


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site
Many thanks to Debra and Ian Murdock for making Debian possible
First created Jun 26, 2009 ~ Last revised June 30, 2009

Valid XHTML 1.0 Strict Valid CSS!