This is a small tutorial to help you configure DNS servers in linux.Typically ISP's DNS servers are very slow primarily because they are overloaded and cannot handle so many requests.opendns a DNS service has some really good DNS servers which are faster,more secure and definetly more reliable..The most important being FASTER.So this tutorial will help you change your DNS server from your ISP's DNS servers to OPENDNS servers.
Firstly, so that you know, opendns server ips are 208.67.222.222 and 208.67.220.220 .. typically two server ips are given,even from your isp.The first one is called Primary DNS server and the second is called Secondary DNS server.
OK, now on to the procedure..Its simple!!

Step 1:Go to Applications->Accessories->Terminal and type
sudo gedit /etc/dhcp3/dhclient.conf . You will be asked to type in the sudo password.After which the dhclient.conf file will open
Step 2:This is where you enter the DNS information.Go to the end of the file and add the following line to the END of the file
prepend domain-name-servers 208.67.222.222,208.67.220.220;
Step 3:Save the file and close it.
Step 4:Thats all, now you will be using opendns servers whenever you use the internet

I have experienced a major change in the speeds while using opendns servers.They are indeed very fast.Hope this helps!

9 comments

Unknown said... @ April 24, 2008 at 10:37 AM

Hi - I have tried 3 or 4 posts in Ubuntu forums. Folks don't seem to know much about the Wubi install of 8.04. Couldn't get the internet to work. This parallel install is on my computer at work which is an assigned IP, not automatic. I have copied these settings from Windows Network Settings for LAN into Manual Settings in Ubuntu and it won't work. Also tried changining the last pair of numbers in the IP address to a different, available address. This didn't work either. Since I'm new to Linux I haven't tried using a terminal or any code, yet. Is there a simple walk-through? Thanks

DH

Anonymous said... @ April 24, 2008 at 6:35 PM

Hey Dave,
I would love to help, but i need more info on your current setup and need some terminal outputs.Could you pm me in ubuntu forums..

Anonymous said... @ January 27, 2009 at 11:25 AM

what is a sudo password

Anonymous said... @ January 30, 2009 at 1:39 AM

Mine is Ubuntu 8.10 and connect via Motorola V3xx phone as a modem identified as ttyACM0.
I did that step, but my DNS always revert back to default. It seems Network Manager don't even bother to read that file.
I put it in the very end of the file, like this :

---
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}
prepend domain-name-servers 208.67.222.222,208.67.220.220;
---end of file---

And edit the DNS directly on network manager.

but nothing works. I can connect though, but I really want to use openDNS, they are fast, indeed.

Anonymous said... @ February 4, 2009 at 8:26 AM

@ubuntu user Have you tried setting up static(manual) ip in network manager and then specifying the dns servers?? Go to the terminal and type nslookup google.com and post output of that command.

@Anonymous sudo password is your root password

Anil said... @ February 27, 2009 at 11:27 PM

Prashanth, I have been trying to do this. But I connect through DSL. I tried changing in /etc/dhcp3/dhclient.conf and /etc/resolv.conf. But there is no change. networkmanager still uses old DNS.

Anonymous said... @ February 28, 2009 at 8:45 AM

you might need to do a restart.. actually restarting networking should do it .. by typing sudo /etc/init.d/networking restart . if you still have problems post the contents of your dhclient.conf file

Anonymous said... @ March 27, 2009 at 12:35 AM

when you are working with network manager the settings on /etc/resolv.conf and /etc/dhcp3/dhclient.conf are not permanent. Either deactivate network manager and start working with ifup/ifdown or use network manager completely. I have found that the manager is very buggy and works in DHCP mode only, if you have better luck than me then you could try it but if it does not work simply deactivate it.

Anonymous said... @ March 27, 2009 at 8:58 AM

i use the network manager, editing the dhclient.conf works, but editing the resolv.conf wont work as the router overwrites it..

Post a Comment