Manually adding a DNS Zone to Bind9 server

  • Create a Zone file in /etc/bind/  Example – /etc/bind/pri.domain.com
  • Add the entries . Example below
    $TTL 3600
    @ IN SOA ns2.dnserver.net. manish.gmail.com. (
    2019051606 ; serial, todays date + todays serial #
    7200 ; refresh, seconds
    540 ; retry, seconds
    604800 ; expire, seconds
    3600 ) ; minimum, seconds
    ;
    
    domain.com. 3600 A xxx.xxx.xxx.xxx
    mail 3600 A xxx.xxx.xxx.xxx
    www 3600 A xxx.xxx.xxx.xxx
    domain.com. 3600 AAAA xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
    mail 3600 AAAA xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
    www 3600 AAAA xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
    domain.com. 3600 MX 10 mail.domain.net.
    domain.com. 3600 NS ns1.dnserver.net.
    domain.com. 3600 NS ns2.dnserver.net.
    domain.com. 3600 TXT "v=spf1 mx a ~all"
    default._domainkey.domain.com. 3600 TXT "v=DKIM1; t=s; p=......NBgkqhki................................................"
    _dmarc.domain.com. 3600 TXT "v=DMARC1; p=quarantine"
  • Add the zone to /etc/bind/named.conf.local . Example below

    zone "domain.com" {
        type master;
        allow-transfer {none;};
        file "/etc/bind/pri.domain.com";
    };
  • service bind9 restart for Ubuntu and likes. For CentOS and likes service named restart

Leave a Reply