Search Posts

Steps to install bind dns server on VPS

DNS Server:-
A DNS Server is a computer server that contains a database of public ip address and their hostnames.

Install bind dns server on centos6


Checking updates with “yum update -y”


Install bind with “ yum install bind bind-utils -y”


Will open named.conf with “nano /etc/named.conf”

Replacing *.*.*.* with corresponding ip address

options {
        #listen-on port 53 {; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
        allow-transfer     { localhost; *.*.*.*; };
        recursion no;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

Above,listen-on must be commented.Recursion should be turn off to prevent server from being abused in “reflection” attacks
Next,Add the new zone for domain,you should add the following to your named.conf below the existing zones

zone "" IN {
                type master;
                file "";
                allow-update { none; };

Save zone file
Step5:-Next,Need to open zone file and set A,MX,CNAME records and replace corresponding ip address instead of and replace domain name instead of

$TTL 86400
@   IN  SOA (
        2013042201  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
; Specify our two nameservers
                IN      NS    
                IN      NS    
; Resolve nameserver hostnames to IP, replace with your two droplet IP addresses.
ns1             IN      A     
ns2             IN      A     
;Specify MX record   IN      MX      10   IN      A
; Define hostname ; IP pairs which you wish to resolve
@               IN      A     
www             IN      CNAME 
mail            IN      A     

Step6:-Start restart with “servive named restart
Step7:-Enable startup service “chkconfig named on
Step8:-You can verify that is fully operational by using dig again,replacing with the ip of you.

dig @

Step9:-After any changes you make to the master zone files,you will need to instruct BIND to reload.To reload the zone files,we need to run the following command on the master name server.

rndc reload

Leave a Reply

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

Social media & sharing icons powered by UltimatelySocial

Enjoy this blog? Please spread the word :)