How to set Ubuntu 9 to use OpenDNS for DNS resolution

Posted in Blogs and articles on Jul 4, 2009 at 15:11 IST (8 months ago). Subscribe to this post Bookmark and Share Email
Showing comments 1 to 1 of total 1 on page 1 of 1
Post reply
« Previous1Next »

There are two ways in which you can set your DNS nameservers to OpenDNS in Ubuntu:

The normal method, i.e., /etc/resolv.conf

  1. Open a terminal (Applications > Accessories > Terminal)
  2. Run the command:
    sudo gedit /etc/resolv.conf
  3. Remove the default nameserver line and add,
    nameserver 208.67.222.222
    nameserver 208.67.220.220
  4. Reboot your machine



The better alternative


The problem with the previous method is that sometimes your router or ADSL model might hand over a couple of ISP DNS server addresses to your PC. In that case, they take higher precedence than what is configured in your /etc/resolv.conf. To overcome that,
  1. Open a terminal (Applications > Accessories > Terminal)
  2. Run the command:
    sudo gedit /etc/dhcp3/dhclient.conf
  3. Search for the line containing the following text:
    #prepend domain-name-servers 127.0.0.1;
  4. Insert a new line just below that line, with the following text:
    prepend domain-name-servers 208.67.222.222 208.67.220.220
  5. Reboot your machine

It hardsets your machine to use OpenDNS nameservers. So, no matter what DNS is handed to you by DHCP, your machine will always behave and use just the OpenDNS servers as you told it to.
Posted by ceruleancode on Saturday, July 4, 2009, 3:11 pm
  • Currently 0.00/5

0 votes

Thank this userFlag this comment
Pages: « Previous1Next »

Post your comment (No registration required)

  Add my comment  

TechieDesi Community

Not signed in (Sign-in or Register)
Be a true TechieDesi!
Top 10 Users
Spread the word
Invite your friends
Fan stuff
Help us improve
Need Help
FAQ's
Search tips
Found a bug? Report!
Feeds and letters
Subscribe via RSS
Archives
Subscribe to newsletter
Unsubscribe e-mail
Miscellaneous
Privacy policy
Visit rootnerve
About us
About us
Support the development
Official Blog
Advertise with us
Careers
Copyright (c) 2008, TechieDesi.com. All rights reserved | About us | Do-Not-Disturb registry | Powered by rootnerve | Page rendered in 0.821 seconds