How to change DNS Servers in Ubuntu Linux

1 – Left click your “Network” icon in the taskbar, and select “Manual configuration…” from the popup menu.
2 – Click “Unlock” to allow changes in the window.
3 – Input your administrator(root or super user) password and click “Authenticate”.
4 – Select the “DNS” tab and click “Add”.
5 – Type in the IP addresses of two or more OpenNIC’s DNS server IPs which you can find here,  and “Close” the window.
Done! You should now be able to visit the Main OpenNIC Project Site. In addition to other OpenNIC Sponsored Top Level Domains you also have access to all alt-root Peer Top Level Domain as well.
NOTE:If after a certain time o after every reboot, the DNS keeps getting lost, follow these instructions.
Go to Applications->Accessories->Terminal and type:

sudo gedit /etc/dhcp3/dhclient.conf

Type the sudo password. The file dhclient.conf will open. Go to the end of the file and add the following line to the END of the file:

prepend domain-name-servers DNS1, DNS2, DNS3;

Replace DNS1, DNS2 and DNS3 with the three nearest OpenNIC DNS to you. Save and close the file.
That’s all. You may need to restart.