Overview

Installing tinydns server and setting up a domain on it .

Requirements

  • Centos server ( any other Linux/Unix distro can be used )
  • Atleast 1 configured IP address :: Let it be 192.168.1.2
  • A domain :: Let it be exampledomain.com

Installation

ucspi-tcp is a public domain Unix TCP command-line tool it must be installed for running tinydns. Daemontools must be installed for monitoring and supervising tinydns.

Step 1

Install ucspitcp and daemontools

root@serv:~# yum install make gcc

root@serv:~# cd /usr/src
root@serv:~# wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
root@serv:~# wget http://www.qmail.org/moni.csi.hu/pub/ucspi-tcp-0.88.errno.patch

root@serv:~# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
root@serv:~# tar -vxzf ucspi-tcp-0.88.tar.gz
root@serv:~# cd ucspi-tcp-0.88
root@serv:~# echo “gcc -O2 -include /usr/include/errno.h” > conf-cc
root@serv:~# patch -p1 < /usr/src/ucspi-tcp-0.88.errno.patch
root@serv:~# make
root@serv:~# make install

root@serv:~# mkdir -p /package
root@serv:~# chmod 1755 /package
root@serv:~# cd /package
root@serv:~# wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
root@serv:~# tar -zxvf daemontools-0.76.tar.gz
root@serv:~# rm daemontools-0.76.tar.gz
root@serv:~# cd admin/daemontools-0.76
root@serv:~# patch -p1 < /usr/src/daemontools-0.76.errno.patch
root@serv:~# package/install

Step 2

Install djbdns package

root@serv:~# cd /usr/src/
root@serv:~# wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
root@serv:~# tar -xf djbdns-1.05.tar.gz
root@serv:~# cd djbdns-1.05
root@serv:~# echo gcc -O2 -include /usr/include/errno.h > conf-cc
root@serv:~# make
root@serv:~# make setup check

Configuration

Configure tinydns to listen on IP 192.168.1.2

root@serv:~# useradd dnslog
root@serv:~# useradd tinydns
root@serv:~# tinydns-conf tinydns dnslog /etc/tinydns 192.168.1.2

Add a domain to tinydns

root@serv:~# cd /etc/tinydns/root/
root@serv:~# add-ns ns1.exampledomain.com 192.168.1.2
root@serv:~# add-host exampledomain.com 192.168.1.2
root@serv:~# make

Add it to svscan to keep the service under monitoring

root@serv:~# ln -s /etc/tinydns /service/tinydns
root@serv:~# svc -d /service/tinydns
root@serv:~# svc -u /service/tinydns

Main Log file

/service/tinydns/log/main/current