Advanced

Tweaking dhcp client configuration to change the default DNS servers to Open DNS

Posted by fermi on · 15 comments
unixlab.blogspot.com
Mail this story
Print this story

The DNS servers of my ISP is always behaving erratically. The DNS look up times are abysmally large and some times I get an address not found error while browsing. On ubuntu/debian systems the DNS servers are specified in /etc/resolv.conf. I tried to edit /etc/resolv.conf and put open dns servers as default DNS servers. But, my ISP supplies their DNS server address along with IP address for the system via DHCP. Every time my system renews its DHCP lease. my /etc/resolv.conf is also rewritten with their DNS address.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (15)

Read the article.

Or just find the same simple instructions on the OpenDNS site itself.
Interesting. I learned long ago that ISP DNS servers tend to be horribly unreliable and started running my own in house DNS server on my router box. I changed my dhcpd.conf a while back to forward to OpenDNS. To solve the ISP changing my DNS settings problem I just set the resolv.conf on my router box to point to my local DNS server then made the file +i so dhcpc can't change it. :P
Actually my ISP (a cable company) hasn't had any DNS problems. My previous ISP (a phone company) was terrible. You're right that OpenDNS is solid and make a good alternative to the ISP DNS.
I switched from going direct to roots to using OpenDNS primarily for the filtering options. At home I like having that nice layer of malware site blocking. At the church/school it complements dansguardian nicely. I have switched one or two people/places over to it for stability reasons as well though.

And the stats are cool. :P

Back when I first had broadband on DSL (uh...2000ish I think) I had a horrible connection. My friend did some testing and found out that the big V's DNS servers were dropping on average every 30 min. As soon as I setup an in-house DNS server to go to the roots my connection was rock solid.
I put "dns-nameservers 66.76.227.40 208.180.42.68" in my functioning /etc/network/interfaces entry.

Sadly, my cheap and pointless router puts ITSELF as the first entry in the DNS served up by DHCP, which causes every client DNS lookup to time-out first.

I assume that one could just put an OpenDNS address or two (or 5) in that file the same way. Easy.

I noticed that WICD also allows the setting of system-wide or interface defined DNS entries.
@Bob_Rob, Someone correct me if I'm wrong, but I think that the "prepend" command that OpenDNS says to use in /etc/dhcp3/dhclient.conf automatically puts the OpenDNS servers at the top of your DNS list.
@ComBob,

I think that's a wonderful idea.

I also cut my DNS request traffic substantially by using The Hosts File Project http://hostsfile.mine.nu
The connection to our ISP uses PPPoE. Our router (a Dlink, but I don't remember the model) allows us to specify the DNS servers in it's configuration, and we've set it for OpenDNS, so any wireless or temporary machine gets the settings from it. Our dedicated machines use static IP's, and we have it set in the resolv.conf files.

Of course, if you use Roadrunner/Time Warner, it apparently doesn't matter how you set your DNS, as they intercept DNS requests and route them to their machines. Which would be fine if their DNS service was reliable, but... :(
@jdixon:

I'm on RR at the moment, and I see no DNS hi-jacking.

It might help that I'm running a local "bind" and caching everything through that.
> I'm on RR at the moment, and I see no DNS hi-jacking.

This was true in Mytle Beach, SC; and verifed by the local tech there. Setting our DNS settings to OpenDNS made no difference, and any command line DNS requests still came back from their servers. :( Maybe it's only because they're reselling to Horry County Telecommnunications and they don't do it to their own customers, I don't know.

But yes, your caching server would override that for anything in it's cache.
I'm comparing "with BIND" vs. "without BIND," handling a non-existent domain.

Without local BIND, I'll get the RR "how did you get here?" page.

With local BIND, I get the generic Firefox "Server not found" page.
@gus3: Do you consider that DNS hijacking or just a customized error page?
I consider it hijacking. They (RR) are reporting a successful lookup on a non-existent domain.
> Do you consider that DNS hijacking or just a customized error page?

Without the local BIND, try using OpenDNS as your DNS server. In our case, RoadRunner intercepted the DNS request and returned their own response.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post