Thursday 15 April 2010

dns cache

I installed dnsmasq a long time ago, but it turns out I never told my dhcp to use it.
All done now thanks to the following post:
http://www.ubuntugeek.com/local-dns-cache-for-faster-browsing-on-ubuntu-machine.html

My steps (for in case I need to do it again :) :
sudo apt-get install dnsmasq

Now edit /etc/dhcp3/dhclient.conf
and uncomment the following line:
prepend domain-name-servers 127.0.0.1;

I didn't have a /etc/dnsmasq.conf , and it does not seem to be needed because my dns caching works fine now without it; I assume its got good defaults.

To test it quickly add nameserver 127.0.0.1 to the top of /etc/resolv.conf
(it normally gets overwritten by the network manager)
dig yahoo.com

You will see something like
;; Query time: 38 msec
there.
Now do it again, and you should see something like:
;; Query time: 2 msec

sweet!

No comments:

Post a Comment