djbdns:put tinydns and dnscache on the same ip

August 1, 2008 by gregorgede · Leave a Comment
Filed under: djbdns 

one good thing that makes djbdns secure is the separation of dns-resolver (dnscache) and dns-server (tinydns).
but sometimes we want them to run on the same ip, for example when we set it up for internal use in our LAN.

a few tips to do so:

1. when configuring tinydns, make it listens on 127.0.0.1

$ tinydns-conf tinydns dnslog /etc/tinydns 127.0.0.1
$ ln -s /etc/tinydns /service

2. when configuring dnscache, make it listens on ip that you will tell all computers in your LAN to use it as the DNS server (eg. 192.168.10.2)

$ dnscache-conf dnscache dnslog /etc/dnscachex 192.168.10.2
$ ln -s /etc/dncachex /service

3. all computers in your LAN will ask dnscache on 192.168.10.2 to resolve a domain name. dnscache will then figure it out.
supposed that your tinydns is serving any domain ended with intra.net and all servers are in 192.168.1.* then you need to tell dnscache to ask tinydns for it:

$ echo “127.0.0.1″ > /etc/dnscachex/root/servers/intra.net
$ echo “127.0.0.1″ > /etc/dnscachex/root/servers/1.168.192.in-addr.arpa
$ svc -t /service/dnscachex

now dnscache will ask tinydns for any domain that ended with intra.net



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!