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 8.8.8.8 and 8.8.4.4 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 127.0.0.1; |
and change it to
pretend domain-name-server 8.8.8.8, 8.8.4.4; |

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

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

I guess it’s not:
#pretend domain-name-server 127.0.0.1;
but
#prepend domain-name-server 127.0.0.1;
Pingback: Add DNS server via resolv.conf in Ubuntu 12.04
And it’s not domain-name-server, but domain-name-servers
and the screenshot provided proves the previous commenters are right.
check out this: http://www.liberiangeek.net/2012/05/setup-static-dns-servers-in-ubuntu-12-04-precise-pangolin/
Or check this one out, slightly off subject but covers DNS servers and a bit more detail http://www.sudo-juice.com/how-to-a-set-static-ip-in-ubuntu/
thank you so much
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.
i did the two methods but nothing change
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.
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.
In ubuntu 14.04 how to configure dns server and alternate server