Sunday, April 20, 2008

+1 for dnsmasq

If you use Ubuntu, and you spend too much time staring at "Looking up www.something.com..." in your browser's status bar, this hack is really worth the 5 minutes.

Actually, the above writeup is out of date (although it contains some additional details if you care to understand what's going on). On Ubuntu 7.10, it's even simpler:

  1. sudo apt-get install dnsmasq
  2. Uncomment the following line in /etc/dhcp3/dhclient.conf:
    prepend domain-name-servers 127.0.0.1;
  3. Restart your network connection. (I do this using the KDE system tray icon; ifconfig works too.)
  4. If cat /etc/resolv.conf turns up a line containing nameserver 127.0.0.1, you're done.

Background: I have Comcast, and its DNS servers are completely terrible. They can take minutes --- minutes! --- to respond to a lookup query for a pretty popular hostname like www.blogger.com. Equally often, hostname lookups fail entirely. I don't know what Comcast's doing wrong --- running DNS servers is, in Internet terms, an ancient problem --- but anyway, it's really frustrating. I am strongly considering switching to DSL, but that will probably take weeks for me to finish researching and setting up, because I don't have a land line (ugh).

In the meantime, dnsmasq caches DNS lookups on my local machine, making subsequent lookups to a given hostname after the first one almost instantaneous and perfectly reliable. This doesn't really fix the underlying problem in Comcast's DNS servers, but it does mitigate the pain I experience because of it.

No comments:

Post a Comment