wget bind-9.2.5.tar.gz
gzip -cd bind-9.2.5.tar.gz |tar cvf -
cd bind-9.2.5
./configure --prefix=/usr/local/bind_9.2.5
make
make install
cd /usr/local/
ln -s bind_9.2.5 BIND
cd /var
mkdir chroot
cd chroot/
mkdir named
cd named/
ls
mkdir -p etc dev var/cache/bind var/run/bind/run
ls -al
mknod dev/null c 1 3
ln -s /dev/random .
useradd -s /bin/false -d /dev/null named
cat /etc/passwd
chown -R named var etc
cd dev/
/usr/local/BIND9/sbin/named -t /var/chroot/named -c /etc/named.conf -u named
In the end , creat a rndc.key file and config the rndc control in named.conf. create a init script in /etc/init.d
cat
---
#
# bind This shell script takes care of starting and stopping
# named (BIND DNS server).
#
# write by zsg,20050809
#
NAMED=/usr/local/BIND/sbin/named
RNDC=/usr/local/BIND/sbin/rndc
CHROOT=/var/chroot/named
[ -f $NAMED ] || exit 0
[ -f $/etc/named.conf ] || exit 0
# See how we were called.
case "" in
start)
# Start daemons.
echo -n "Starting named: "
$NAMED -t $CHROOT -u named -c /etc/named.conf
echo
touch $/var/run/named.lock
;;
stop)
# Stop daemons.
echo -n "Shutting down named: "
pkill named
rm -f /var/lock/subsys/named
echo
;;
status)
$RNDC status
exit $?
;;
restart)
stop
start
exit $?
;;
reload)
$RNDC reload
exit $?
;;
*)
"/etc/init.d/bind" 53 lines, 972 characters
---