DHCP

From Noah.org
Revision as of 17:19, 14 December 2006 by Root (talk | contribs)
Jump to navigationJump to search

DHCP

DHCP with a static DNS

I like a few backup DNS servers. I use OpenDNS and I also add 4.2.2.2 because it's easy to remember and it's open.

Normally DHCP takes care of your DNS settings as well as your IP address. You can't directly add DNS servers to resolv.conf because dhclient will eventually overwrite your changes. But you can tell dhclient to prepend DNS servers to the ones it gets automatically.

Edit your dhclient config file:

   /etc/dhcp3/dhclient.conf

Search for the prepend line (it's probably commented out) and set it to the following:

   prepend domain-name-servers 208.67.222.222, 208.67.220.220, 4.2.2.2;

Restart your network:

   /etc/init.d/networking restart

Now cat your resolv.conf file and you should see the new DNS servers:

   cat /etc/resolv.conf