How to set Ubuntu 9 to use OpenDNS for DNS resolution
Posted in Blogs and articles on Jul 4, 2009 at 15:11 IST (about 1 year ago). Subscribe to this post
Email
Showing comments 1 to 1 of total 1 on page 1 of 1
Post replyShowing comments 1 to 1 of total 1 on page 1 of 1
« Previous1Next »
cerulean...Rank: 3
There are two ways in which you can set your DNS nameservers to OpenDNS in Ubuntu:
The normal method, i.e., /etc/resolv.conf
- Open a terminal (Applications > Accessories > Terminal)
- Run the command:sudo gedit /etc/resolv.conf
- Remove the default nameserver line and add,nameserver 208.67.222.222
nameserver 208.67.220.220 - 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,
- Open a terminal (Applications > Accessories > Terminal)
- Run the command:sudo gedit /etc/dhcp3/dhclient.conf
- Search for the line containing the following text:#prepend domain-name-servers 127.0.0.1;
- Insert a new line just below that line, with the following text:prepend domain-name-servers 208.67.222.222 208.67.220.220
- 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
Pages: « Previous1Next »