local DNS caching?

Solution 1:

This is a little confusing since you describe another setup than you mention in the topic.

First Local DNS Caching

This is pretty easy to achieve using dnsmasq

To set this up install the dnsmasq package of your distribution. Since Debian based systems are common these days I'll assume this distro.

$ apt-get install dnsmasq

Now edit /etc/dnsmasq.conf and set the listen-address directive to the IP address of the network interface connected to your network.

Now restart the dnsmasq service

$ /etc/init.d/dnsmasq restart

Edit your resolv.conf and enter the nameservers supplied by your providers or another one:

# Google DNS 1 
nameserver 8.8.8.8
# Google DNS 2
nameserver 8.8.4.4

Now you can set your Linux machine as DNS server of your LAN clients and use DNS caching.

To test if it is working you might use dig

$ dig example.com

You will see something like

;; Query time: 38 msec

Now type the command again, and you should see something like:

;; Query time: 2 msec

ISP like real DNS Server

This would be possible using real nameserver software like bind. But if you have no experience on this you should probably start reading ahead at bind9.net since this would be to broad to answer.

Solution 2:

There are only two caching recursive DNS servers that I can strongly recommend (avaiable both for Windows and UNIX variants)

  1. BIND (http://www.isc.org/)
  2. Unbound (http://www.unbound.net/)

The particular reason I recommend these two is DNSSEC - they both have full DNSSEC validation built-in. You won't get that with dnsmasq or tinydns.

BIND is generally considered to be the reference implementation of DNS, although I'd note that because it's a full general purpose DNS server it has lots of knobs and settings that a recursive-only server doesn't need.

Unbound was designed from the ground up to be recursive only. It's fast and lightweight.

Solution 3:

Bind is the most popular: http://www.isc.org/software/bind

If you want something for windows, Windows Server has a DNS Server built in.

Not sure why you would want a local DNS server, it wont speed up DNS lookups necessarily. Keep in mind the DNS server has to run multiple queries before resolving to the IP. At a DSL or even cable, they will be slower than a DNS server at a datacenter with big pipes....