install djbdns(tinydns) on redhat-like system & get data from bind
as normal user :
$wget http://www.djbdnsrocks.org/downloads/djbdnsrocks.tar.gz
$tar zxvf djbdnsrocks.tar.gz
$su -
as root :
1. installation
A. install daemontools:
$mkdir -p /package
$chmod 1755 /package
$cd /package
$tar zxvf /home/normaluser/djbdnsrocks/daemontools-0.76.tar.gz
$cd /package/admin/daemontools-0.76/src
$rpm -qa | grep patch
we need to install patch package if it’s not yet installed.
usually they’re on CD 2.
$rpm -Uvh patch-2.5.4-29.2.1.i386.rpm patchutils-0.2.31-2.2.1.i386.rpm
$patch < /home/normaluser/djbdnsrocks/daemontools_errnopatch
$cd /package/admin/daemontools-0.76/
$rpm -qa | grep gcc
if gcc compiler is not yet installed, here’s what to do :
$rpm -Uvh binutils-2.16.91.0.6-4.i386.rpm
$rpm -Uvh cpp-4.1.0-3.i386.rpm
$rpm -Uvh glibc-headers-2.4-4.i386.rpm
$rpm -Uvh glibc-devel-2.4-4.i386.rpm
$rpm -Uvh libgomp-4.1.0-3.i386.rpm
$rpm -Uvh gcc-4.1.0-3.i386.rpm
$ ./package/install
B. install ucspi-tcp:
$cd /home/normaluser/djbdnsrocks
$tar zxvf ucspi-tcp-0.88.tar.gz
$cd ucspi-tcp-0.88
$patch < /home/normaluser/djbdnsrocks/ucspi-tcp_errnopatch
$make
$make setup check
C. install djbdns :
$cd /home/normaluser/djbdnsrocks
$tar zxvf djbdns-1.05.tar.gz
$cd djbdns-1.05
$patch < /home/normaluser/djbdnsrocks/djbdns_errnopatch
$make
$ make setup check
$ groupadd dnsuser
$ /usr/sbin/useradd -g dnsuser -s /sbin/nologin -d /dev/null tinydns
$ /usr/sbin/useradd -g dnsuser -s /sbin/nologin -d /dev/null dnslog
$/usr/local/bin/tinydns-conf tinydns dnslog /etc/tinydns x.x.x.x
where x.x.x.x is the ip of tinydns server
$ ln -s /etc/tinydns/service
2. get data from bind:
A. edit named.conf on bind server and add the ip of tinydns server to allow zone transfer from tinydns server.
here’s an example:
zone “domain.com” IN { type master;
file “domain.com.zone”;
allow-query { any; };
allow-transfer { x.x.x.x;};
};
where x.x.x.x is the ip of tinydns server
B. back to tinydns server and do these:
$cd /etc/tinydns/root
$tcpclient x.x.x.x 53 axfr-get domain.com zone-domain zone-domain.tmp
where x.x.x.x is the ip of bind server
$sort -u zone-domain > data
$vi data
find a line like this :
Zdomain.com:domain.com.:hostmaster.domain.com.:2008080101:28800:7200:604800:86400:86400
and change it to this :
Zdomain.com:domain.com.:hostmaster.domain.com.::28800:7200:604800:86400:86400
save and exit
$make
C . test it :
$cd /etc/tinydns/root
$tinydns-get a domain.com
$dnsq a domain.com x.x.x.x
where x.x.x.x is the ip of bind server
both should produce the same answers
finish……..
just a little more note
to show and hide line numbers on vi editor, press escape then
type :set number
to show
or type :set nonumber
to hide
references:
http://cr.yp.to/djbdns/run-server-bind.html
http://www.djbdnsrocks.org







