Building a Private tinydns Server

You’ve outgrown hosts files, so you want to use a DNS server for your LAN only. You won’t be providing any public services. How do you do this with tinydns?

Set up a dnscache server for your LAN. Set up a tinydns server, and enter your internal hosts in /etc/tinydns/root/data.

Using the domain to illustrate, the next step is to tell your local dnscache to query your local, private tinydns server for your domain information. Create these files using the IP address of your private tinydns server:

# echo > /service/dnscache/root/servers/ echo > /service/dnscache/root/servers/

The dnscache user should own these files:

# chown dnscache: /service/dnscache/root/servers/ chown dnscache: /service/dnscache/root/servers/

Next, restart dnscache:

# svc -t /service/dnscache

dnscache will now consult the local tinydns server for local addresses, and it will consult the /service/dnscache/root/servers/@ file for external addresses.

You can easily do this for multiple domains; just add more domain files to /service/dnscache/root/servers/.

You have to have officially registered domain names for this to work, even if you are not running any public services. If you want the ability to invent whatever domain names you want for your LAN, see this.

Remember that dnscache and tinydns should be on separate machines. Always separate the caching/resolving server from the authoritative server. If you must put them on the same machine, give them separate IP addresses. tinydns can have, and dnscache can take the network IP address.