Set DNS name server on Ubuntu 12.04 LTS

If you wish to change the dns nameserver information in ubuntu 12.04, you have to use the file /etc/network/interfaces instead of /etc/resolv.conf.

Edit /etc/network/interfaces and append or replace the following line to set your dns server :
dns-nameservers 1.2.3.4  5.6.7.8
And optionally this one to specify the domain to be append when you request a non fully qualify name :
dns-search foo.org bar.com

#1

Comments

Michael Mior said…
Alternatively, you can add the following to /etc/dhcp/dhclient.conf

prepend domain-name-servers 1.2.3.4, 5.6.7.8;

Popular posts from this blog

Resolve "Cannot download packages whilst offline" issue in Deja-Dup backup software

ubuntu 20.04 / netplan / change mac address and static ip

wireshark ssh remote connect on linux server