As you know, a DNS server translates the domain names (.i.e. www.karkomaonline.com) into numerical values that computers recognize and also translates numerical values into domain names. The server stores previous queries so that later requests can be handled more quickly.
A DNS caching resolver performs the function of caching answers to previous queries so that there is no need to repeatedly query for the same information.
This tip will show you how to set up a caching DNS using the djbdns software package.
djbdns package consists of:
- A caching DNS resolver, dnscache (our friend for this tip)
- A DNS server, tinydns
- Miscellanea tools such as walldns, pickdns, client tools, etc…
Why djbdns?
- Because it’s secure
- Because it’s reliable
- Because it’s small and fast
- Because it’s easy to manage
- Because it’s better than Bind (almost for me)
Installing your own cache is as easy as…
emerge djbdns
rm -Rf /service/tinydns /servicd/axfrdns /var/tinydns /var/axfrdns
Note that emerge automatically configures a DNS server. As our interest is in running a caching DNS resolver, we should delete the configuration files related to the DNS server. Also note that emerge will create dnscache and dnslog users in your system.
Tell dnscache the IP address it should listen to (change this according to your configuration) and tell svscan to handle the service:
dnscache-conf dnscache dnslog /etc/dnscache 192.168.10.1
ln -s /etc/dnscache /service
Allow queries from your internal net:
cd /service/dnscache
touch root/ip/192.168.10
Point your client machines to the new caching server:
vi /etc/resolv.conf
nameserver 192.168.10.1
That’s it! Now figure out how to do the job with Bind
)
References:
I’ve found a couple of interesting links:
More info can be found here… http://www.faqts.com/knowledge_base/index.phtml/fid/699/