In this tutorial we will see how to add DNS server IP addresses manually by editing the /etc/resolv.conf file under Ubuntu (11.10/11.04/10.10). You may use this tutorial to add for example DNS servers of Google Public DNS (220.127.116.11,18.104.22.168) or that of OpenDNS (22.214.171.124,126.96.36.199).
Via the terminal, edit the /etc/resolv.conf file with this command (you can replace gedit with your favorite text editor like vim.tiny, nano, etc.):
sudo gedit /etc/resolv.conf
Add now your DNS server addresses as follows (we will use the Google Public DNS in this example):
Replace the given IP addresses with whatever you want, then save your file and close. Restart now your nework manager with this command:
sudo /etc/init.d/networking restart