How To Setup TinyDNS Server In 3 Minutes
Last weekend was my first time to setup and configure DNS server for a small office network with hundred units of networked computers. As usual, due to cost factor, the management decides to run an open-source DNS daemon on an aging Intel-based PC with Red Hat Linux 9.
After searching for some information, I decided to deploy djbdns (a.k.a tinydns) – a tiny, powerful, open-source DNS daemon of Dan Bernstein.
Almost one week of monitoring, the djbdns / tinydns server performance is quite acceptable! So, I take this opportunity to write out my so-called summarized version of djbdns / tinydns setup guide for quick reference.
I can confirm that this guide will take 3 minutes (more or less) to setup a DNS server for an internal network of any size, by using Dan Bernstein’s djbdns / tinydns daemon.
Before proceed to djbdns / tinydns installation steps, please download daemontools-0.76.tar.gz and djbdns-1.05.tar.gz from Dan Bernstein’s official site. Alternative download of djbdns / tinydns and daemontools from WalkerNews.net Download Center (md5 checksum printed on homepage).
Assumption for these “3-minutes djbdns / tinydns setup guide”:
That’s all done for the DNS server setup! You can proceed to configure DNS setting of networked computers to resolve hostname-IP address with djbdns / tinydns, i.e. 172.101.20.25:
Credit of the original djbdns / tinydns and daemontools setup guide that I’ve referred to.

After searching for some information, I decided to deploy djbdns (a.k.a tinydns) – a tiny, powerful, open-source DNS daemon of Dan Bernstein.
I can confirm that this guide will take 3 minutes (more or less) to setup a DNS server for an internal network of any size, by using Dan Bernstein’s djbdns / tinydns daemon.
Before proceed to djbdns / tinydns installation steps, please download daemontools-0.76.tar.gz and djbdns-1.05.tar.gz from Dan Bernstein’s official site. Alternative download of djbdns / tinydns and daemontools from WalkerNews.net Download Center (md5 checksum printed on homepage).
Assumption for these “3-minutes djbdns / tinydns setup guide”:
- All the djbdns / tinydns compilation and setup are done with root user ID. Try to avoid using sudo command for simplicity,
- djbdns / tinydns daemon is running on Red Hat Linux 9 with IP address 172.101.20.25 (non-public, private IP of the internal network)
- How to compile and install daemontools?
- Create the package installation directory with 1755 permission:
mkdir –p /package
chmod 1755 /package
Copy daemontools-0.76.tar.gz into /package directory and untar the gzipped source code:
tar -zxvpf daemontools-0.76.tar.gz
cd admin/daemontools-0.76
Fix daemontools compilation problem on latest version of glibc package:
vi src/error.hto replaceextern int errno;with#include <errno.h>
Compile and install daemontools
package/install
Once the daemontools compilation completed successfully, you should have seen these last few lines:
Copying commands into ./command…
Creating symbolic link daemontools -> daemontools-0.76…
Making command links in /command…
Making compatibility links in /usr/local/bin…
Creating /service…
Adding svscanboot to inittab…
init should start svscan now
Execute commandps -elf | grep svscanshould confirm that/bin/sh /command/svscanbootandsvscan /serviceare running too.
- How to compile and install djbdns / tinydns?
- Copy djbdns-1.05.tar.gz into /package directory and un-tar the gzipped source code:
tar -zxvpf djbdns-1.05.tar.gz
cd /package/djbdns-1.05
Fix djbdns / tinydns compilation problem on latest version of glibc package:
vi error.hto replaceextern int errno;with#include <errno.h>
Compile and install djbdns server
make
make setup check
- Configure djbdns / tinydns server
- Create user account to run tinydns service and logging facility:
/usr/sbin/useradd –s /bin/false tinydns
/usr/sbin/useradd –s /bin/false dnslog
Configure tinydns service with the bundled tinydns-conf utility:
tinydns-conf tinydns dnslog /etc/tinydns 172.101.20.25
The tinydns-conf utility will configure tinydns user account to run tinydns service, dnslog user account to run DNS logging facility, creates /etc/tinydns directory and defines that the tinydns service will listen on the server IP address (172.101.20.25).
Create symbolic link of /etc/tinydns to /service directory so that the svscan of daemontools will start up tinydns service and continue monitor the states:
ln –s /etc/tinydns /service
To confirm the tinydns service is running:
svstat /service/tinydns
Alternative, you can use netstat or lsof command to confirm the UDP port 53 (domain service port as per RFC-1035) has been opened by djbdns / tinydns:
netstat -tulpa | grep domain
lsof -i | grep domain
Now, it’s time to maintain the hostname-IP information of networked computers to djbdns / tinydns daemon:
cd /service/tinydns/root
vi data
and insert the djbdns / tinydns server IP as the first record:
..:172.101.20.25:a:259200
Subsequently, add hostname-IP of other networked computers into this ASCII text file. For example,
=blog.walkernews.net:172.101.20.25:86400
=download.walkernews.net:172.101.20.26:86400
to add hostname-IP of blog.walkernews.net (the djbdns / tinydns server itself) and download.walkernews.net (just another internal networked host).
After save and exit the /service/tinydns/root/data file, typemakecommand (must be done inside /service/tinydns/root directory) to “compile” the /service/tinydns/root/data to /service/tinydns/root/data.cdb (Applesoft BASIC program data file format), which is used by the daemon to resolve hostname-IP requests.
That’s all done for the DNS server setup! You can proceed to configure DNS setting of networked computers to resolve hostname-IP address with djbdns / tinydns, i.e. 172.101.20.25:
- Red Hat Linux and most Linux distribution
- Add or update the client’s DNS setting:
vi /etc/resolv.conf
with at least these two simple lines:
search walkernews.net
nameserver 172.101.20.25
After save and exit the /etc/resolv.conf file, the Linux networking components should able to resolve a given hostname by referring to DNS server at 172.101.20.25. Thesearch walkernews.netwill tell Linux to automatically complete FQDN format for a given hostname. For example,ping blogis equal to blog.walkernews.net.
- Windows 2000, Windows XP, Windows 2003, Windows Vista
Right-click the Local Area Network connection and click on the Properties to bring up Local Area Connection Properties dialog box,
Select Internet Protocol Version 4 (TCP/IPv4) and click on the Properties button to bring up Internet Protocol Version 4 (TCP/IPv4) Properties dialog box,
Click on the Advanced button to bring up Advanced TCP/IP Settings dialog box,
Click on the DNS tab and enter the djbdns / tinydns IP address as of following snapshot:

Credit of the original djbdns / tinydns and daemontools setup guide that I’ve referred to.
Custom Search








2010 •
[...] the DNS server to resolve both http://www.walkernews.net and http://www.example.com to one IP address, i.e. 192.168.10.20 in [...]
There is an error near the top where it says:
Copy djbdns-1.05.tar.gz into /package directory and untar the gzipped source code:
tar -zxvpf djbdns-1.05.tar.gz
cd admin/daemontools-0.76
It should read:
Copy daemontools-0.76.tar.gz into /package directory and untar the gzipped source code:
tar -zxvpf daemontools-0.76.tar.gz
cd admin/daemontools-0.76
Also, can u tell us what
/usr/sbin/useradd –s /bin/false tinydns
/usr/sbin/useradd –s /bin/false dnslog
are supposed to do? I mean, I am looking for simple instructions (for a simple mind) and those don’t actually do anything except show usage help.
I take back the last comment about /usr/sbin/useradd –s /bin/false tinydns etc. because I notice when I copy it to Putty, the -s turns into .s for some reason.
Sorry – and thanks for simple instructions (although the typo at the top threw me for a few minutes)
Hi Car Broker, thank you very much to correct my typo mistake.
I’m really appreciate it and make the correction just now.
Awesome! I’m very appreciate this article! It’s very useful ;)
Thanks for your sharing~