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 (, or that of OpenDNS (,

Getting Started

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

That's it!

Post a Comment