Setup DNS server Bind chroot CentOS 6

I. Edit /etc/hosts
# vi /etc/hosts

II. Install & Setting Bind chroot for DNS Server
-Install Bind
# yum -y install bind bind-chroot

-Setting iptables open DNS port
# system-config-firewall-tui


# iptables -A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT
# iptables -A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT
# service iptables save
# service iptables restart

-Konfigurasi awal
# cp -R /usr/share/doc/bind-9.8.2/sample/var/named/* /var/named/chroot/var/named/
# cp -R /usr/share/doc/bind-9.8.2/sample/etc/* /var/named/chroot/etc/
# touch /var/named/chroot/var/named/data/cache_dump.db
# touch /var/named/chroot/var/named/data/named_stats.txt
# touch /var/named/chroot/var/named/data/named_mem_stats.txt
# touch /var/named/chroot/var/named/data/
# mkdir /var/named/chroot/var/named/dynamic
# touch /var/named/chroot/var/named/dynamic/managed-keys.bind
# chmod -R 777 /var/named/chroot/var/named/data
# chmod -R 777 /var/named/chroot/var/named/dynamic

-Set if you don’t use IPv6(if use, don’t set it)
# echo 'OPTIONS="-4"' >> /etc/sysconfig/named

-Setting RNDC
# rndc-confgen -a -c /etc/rndc.key
# chmod 755 /etc/rndc.key

-Konfigurasi /var/named/chroot/etc/named.conf
# touch /var/named/chroot/etc/named.conf
# vi /var/named/chroot/etc/named.conf

-Setting Forward Lookup Zone
# cd /var/named/chroot/var/named
# touch
# vi

-Setting Reverse Lookup Zone
# cd /var/named/chroot/var/named
# touch
# vi

-Edit /etc/resolv.conf
# vi /etc/resolv.conf

-Restart Bind service & Setting run level
# service named restart
# chkconfig named on

Make sure it’s running:
# rndc status

-Testing DNS Query


Related posts:


  1. hello, thanks for your great post. It help to me.
    but, I get an error after the service named restart command.

    [root@rpidvoproxy rpidavao]# service named restart
    Stopping named: [ OK ]
    Starting named:
    Error in named configuration:
    zone localhost.localdomain/IN: loaded serial 0
    zone localhost/IN: loaded serial 0
    zone loaded serial 0
    zone loaded serial 0
    zone loaded serial 0
    zone loading from master file failed: file not found
    zone not loaded due to errors.
    internal/ file not found
    zone loaded serial 2012113002
    [root@rpidvoproxy rpidavao]#

    give some advice that is this error.


      1. hello bachem.

        thanks your time to reply.

        I repeat your instruction “-Konfigurasi awal” , then copy from your named.conf and paste into my named.conf and some editing information of hostname, ip’s, slave ip.

        After repeating those instrucition, then named restart…. wow! its running now, then dig 172.11.56.
        I thinks there is mistake of my named.conf….

        Again, thanks for your time.

Leave a Reply

Your email address will not be published. Required fields are marked *