Set DNS server in Ubuntu 12.04

Below steps will show you how  to set a DNS server since Ubuntu 12.04 has switched to resolvconf for /etc/resolv.conf management
Below is an example to add Google DNS and to my Ubuntu system.You can replace them with yours.

Method 1

1.Open a terminal by pressing Ctl+Alt+t or search “Terminal” in Dash

2.Run below command to open /etc/dhcp/dhclient.conf

sudo gedit /etc/dhcp/dhclient.conf

3.Find line

#pretend domain-name-server;

and change it to

pretend domain-name-server,;

4.Done,you can use command nm-tool to verify your new DNS server



Method 2:

1.Search “network” in Dash ,then open Network Connections

2.Select your current network connect then click Edit…

3.Go to tab IPv4 Settings ,then select Automatic (DHCP) addresses only,then set your DNS servers

12 thoughts on “Set DNS server in Ubuntu 12.04

  1. Pingback: Add DNS server via resolv.conf in Ubuntu 12.04

  2. simone

    You’d rather better avoiding to make (in a wrong way, by the way) copy/paste.
    Or, at least, do not PRETEND to be considered an unix user.

  3. Lepi

    I installed Ubuntu 12.04 LTS. Nothing above works for me. Stupid machine is able to recognise only one DNS server.

    pretend domain-name-server -> that doesn’t work.

  4. Jamie

    Others think thee habit is more likely connected to their checking the
    ground for thhe scent off its enemies, since the dog has its
    nose to the ground during the turning around. There is a
    department on Free and Low cost Hellp which can’t allow specifi referrals, butt
    which points you in the right direction. s : This
    is the scednt your pup will leave behind.


Leave a Reply

Your email address will not be published. Required fields are marked *