Configuring Secondary Authoritative DNS Server on CentOS

From my previous post about Configuring Primary Authoritative DNS Server, this is how you can configure a secondary. I have used another vps to configure this secondary DNS so that they are from a different provider, on a different IP subnets and also another states.

For secondary the steps is very similar on how you configure the primary. You start off by installing the required package

yum install bind bind-utils -y

Then you can start configuring /etc/named.conf where you add/configure these within the options

        listen-on port 53 { 192.168.2.2; };
        allow-query     { 192.168.1.1; localhost; };
        allow-recursion { localhost; };
        /*

I did include allow-transfer as this is the secondary DNS and will request transfer from the primary.

At below section of /etc/named.conf, I will point to my zones records where here I set them as slave rather than primary

zone "fuchsiaapp.com" {
        type slave;
        file "/var/named/fuchsiaapp.com.db";
        allow-update { none; };
        masters { 192.168.1.1; };
        allow-query     { any; };
};

zone "66.174.107.in-addr.arpa" IN {
        type slave;
        file "/var/named/fuchsiaapp.com.rr.db";
        allow-update { none; };
        masters { 192.168.1.1; };
        allow-query     { any; };
};

After that you just need to restart named process. On CentOS 6.5 you will execute

service named restart

Or CentOS 7 you will run

systemctl restart named.service

Then finally you can run some dig or nslookup to check on your DNS response

Leave a Reply

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