Oct 15, 2012

How to change default DNS server in Linux

Just a quick note ( to self ) of the cleanest way to set the DNS servers in Linux.

DNS entries stored in /etc/resolv.conf are overriden with every boot.

There are ways to prevent NetworkManager from overriding the file, altering dhcp hooks, or manually editing /etc/network/interfaces.

A simpler solution would be to add the following line to your /etc/dhcp/dhclient.conf

prepend domain-name-servers 8.8.8.8,8.8.4.4;

Add the DNS server IPS separated with a comma [,].
Real Time Web Analytics