Skip to main content
If you are not familiar with manually install and edit of nameservers, we suggest you to get control panel for your server. This document describes the process of installing Bind 9.x on your Linux box as a Caching DNS server. The steps to install it are as follows:
  1. Download the latest stable release from ISC.org *
  2. Extract the tarball like so:
tar zxvf bind-9.x.tar.gz cd bind-9.x
  1. Configure the software:
./configure --prefix=/usr \ --sysconfdir=/etc \ --enable-threads \ --localstatedir=/var/state \ --with-libtool \ --with-openssl=/usr/ssl
  1. Compile it:
  1. 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)
  1. Update your library resolutions:
ldconfig -v
  1. Create the Bind user and group
groupadd named useradd -d /var/named -g named -s /bin/false named
  1. Adjust the group/perms on /var/run
vigr (add named to the 'daemon' group) chown root:daemon /var/run chmod 775 /var/run
  1. Create the Bind rundir
mkdir -p /var/named/pz chown -R named:named /var/named chmod -R 755 /var/named
  1. 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
  1. 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
  1. Move the script to your monthly cron directory
mv update\_named /etc/cron.monthly
  1. Create /var/named/pz/127.0.0 as below,
  1. Create /var/named/pz/192.168.1
ln -s 127.0.0 192.168.1
  1. Create /etc/resolv.conf
echo "nameserver 127.0.0.1" > /etc/resolv.conf
  1. 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
  1. Create /etc/rndc.conf
  1. Create /etc/rndc.key
  1. And finally, create /etc/named.conf as below
  1. 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!