Centos 6 – BIND [chroot] fresh install

Published on Author gryzliLeave a comment

Here I will describe some basic steps for doing fresh install of chrooted bind version under Centos 6.

 

 

Install the rpm packages

yum install bind bind-chroot bind bind-libs

 

Move the necessary directories

mv /var/named/named.* /var/named/chroot/var/named/
mv /var/named/{data,dynamic} /var/named/chroot/var/named/

This part is very important, cause if you don’t do this, bind won’t start.

Also if /var/named/chroot/var/named/dynamic directory is missing you will most likely  experience strange CPU starving problems. In my case named was eating lot of CPU without doing anything.

Edit /etc/named.conf and fine-tune little bit

Also I removed the IP/port bindings from named.conf in order the server to listen on all of my interfaces. By default it listens only on localhost.

Add the following section in /etc/named.conf

view "external" {
        allow-transfer {none;};
        zone "." IN {
                type hint;
                file "named.ca";
        };
        include "/etc/named.rfc1912.zones";
        include "/etc/named.root.key";
        zone "blog.gryzli.info" IN {
                type master; 
                file "blog.gryzli.info.zone";
        };
};

 

Create the zone file blog.gryzli.info.zone

$ vim /var/named/chroot/var/named/blog.gryzli.info.zone

$TTL    60M
@               IN SOA  ns1.gryzli.info. root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           ns1.gryzli.info.
                IN NS           ns2.gryzli.info.


@              IN      A      1.2.3.4
www            IN      CNAME   @

 

Finally we must restart named:

/etc/init.d/named restart

 

Leave a Reply

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