- Download the latest stable release from ISC.org *
- Extract the tarball like so:
tar zxvf bind-9.x.tar.gz cd bind-9.x
- Configure the software:
./configure --prefix=/usr \ --sysconfdir=/etc \ --enable-threads \ --localstatedir=/var/state \ --with-libtool \ --with-openssl=/usr/ssl
- Compile it:
- Remove all existing Bind software:
rpm -q -a | grep '^bind' | while read line do rpm -e --nodeps $line done
Install your new Bind:
make install cd doc/man/bin (not needed on 9.2.0 and above) for i in 1 5 8 (not needed on 9.2.0 and above) do (not needed on 9.2.0 and above) install *.$i /usr/man/man$i (not needed on 9.2.0 and above) done (not needed on 9.2.0 and above) cd ../dnssec (not needed on 9.2.0 and above) install *.8 /usr/man/man8 (not needed on 9.2.0 and above)
- Update your library resolutions:
ldconfig -v
- Create the Bind user and group
groupadd named useradd -d /var/named -g named -s /bin/false named
- Adjust the group/perms on /var/run
vigr (add named to the 'daemon' group) chown root:daemon /var/run chmod 775 /var/run
- Create the Bind rundir
mkdir -p /var/named/pz chown -R named:named /var/named chmod -R 755 /var/named
- Create a script to maintain the root.hints file
cat << "EOF" > update\_named #!/bin/sh cd /var/named wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache -O /var/named/db.root if [ -s /var/named/db.root ] ; then chown named:named /var/named/db.root /etc/rc.d/named stop mv /var/named/root.hints /var/named/root.hints.old mv /var/named/db.root /var/named/root.hints /etc/rc.d/named start fi EOF
- Make the script executable, and execute it (Bind will probably fail, but your root.hints file will get updated like we wanted)
chmod 700 update\_named ./update\_named
- Move the script to your monthly cron directory
mv update\_named /etc/cron.monthly
- Create /var/named/pz/127.0.0 as below,
- Create /var/named/pz/192.168.1
ln -s 127.0.0 192.168.1
- Create /etc/resolv.conf
echo "nameserver 127.0.0.1" > /etc/resolv.conf
- Create your rndc password (we’ll use “hush” for ours)
mmencode (this command is part of the metamail package) hush aHVz (mmencode returns this) ^C
- Create /etc/rndc.conf
- Create /etc/rndc.key
- And finally, create /etc/named.conf as below
- The only thing left to do is start Bind:
/usr/sbin/named -u named
Congrats! You now have a fairly secure, caching name server that can be controlled using rndc!
Enjoy your new Bind server!
