How to: Add or Change DNS Nameservers for Linux
Some times our ISP’s DNS servers will not work as expected. Sometimes it will not just load some pages at all. So here the solution is open Public DNS servers. This will not only speed up the browsing but it will improve the safety. It will notify us if we are about to go to a malware or phishing related sites, which may harm users. There are lot more features in using this kind of Nameservers. But these extra features totally depend on which Nameservers we are using. Google & OpnDNS are having Public Open Nameservers. You can find lots of openDNS servers by a simple google search.
Now how we can add this in windows almost everyone knows, its that simple. But in Linux very less people knows how to do it. Its also very simple. Here I will explain how to add these nameservers to you network connection.
Here I’m choosing Ubuntu for explaining this , as it is one of the mostly used Linux Flavors.
Steps Are:
- Right-click on ‘Network Icon’ (located at top-right panel by default) and click on ‘Edit Connections’ to open Network Connections Manager.
- Choose the type of connection you have. For this example, we will use ‘Wired’.Under ‘Wired’, highlight ‘Auto etho’ and click on ‘Edit’.
- Inside ‘Editing Auto etho’ window, click on ‘IPv4 Settings’ tab.
- Under ‘IPv4 Settings’, change the ‘Method’ to Automatic (DHCP) addresses only.Put these nameserver addresses as your ‘DNS Servers’: 208.67.222.222, 208.67.220.220Click ‘OK’ and reboot your machine.
Thats it pretty simple huh.
PS: To avoid having your settings get revoked after reboots, or after periods of inactivity you may need to make the following changes via the command line:
$ sudo cp /etc/resolv.conf /etc/resolv.conf.auto
$ gksudo gedit /etc/dhcp3/dhclient.conf
# append the following line to the document
prepend domain-name-servers 208.67.222.222,208.67.220.220;
# save and exit
$ sudo ifdown eth0 && sudo ifup eth0
You may be required to change eth0 to your own network device’s name if it uses a non-standard name.

