Unbuntu Local DNS Cache

August 20, 2010

I had trouble with very slow DNS resolution on Ubuntu 10.04. After trying various fixes in forum posts, none of which had any effect, I opted to install a local dns cache: dnsmasq

To install:

$ sudo apt-get install dnsmasq

Next, edit /etc/dnsmasq.conf and change the listen-address line to be:

listen-address=127.0.0.1

Edit /etc/resolv.conf and add in the local ip address at the top of the file:

nameserver 127.0.0.1

Finally, restart dnsmasq:

$ sudo /etc/init.d/dnsmasq restart

References

Tags: dnsmasq ubuntu dns