Setting up a DNS zone in Bind9

In this article, I will give an example of adding a DNS zone to Bind9.

We use the db.local file as a template, copy it:

sudo cp /etc/bind/db.local /etc/bind/db.ixnfo.com

Open the created copy in a text editor:

sudo nano /etc/bind/db.ixnfo.com

For example, by default, you might see the following content:

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
@       IN      A       127.0.0.1
@       IN      AAAA    ::1

Let’s change the data to suit our needs, for example:

$TTL    86400
@       IN      SOA     ixnfo.com. admin.ixnfo.com. (
                              3         ; Serial
                          86400         ; Refresh
                           3600         ; Retry
                             1w         ; Expire
                           3600         ; Negative Cache TTL
                              )
; NS records
@     IN      NS      ns55.ixnfo2.com.
@     IN      A       192.168.5.5
www   IN      A       192.168.5.5
mail   IN      A       192.168.5.5
ns1   IN      A       192.168.5.6
ns2   IN      A       192.168.5.7

Open the main configuration file in a text editor:

sudo nano /etc/bind/named.conf

And add a link to the file with the settings of the new zone:

zone "ixnfo.com" {
        type master;
        file "/etc/bind/db.ixnfo.com";
};

After editing, check the configuration for errors:

sudo named-checkconf

Restart bind9 to apply the changes:

sudo service bind9 restart

Let’s check the zone:

sudo named-checkzone ixnfo.com db.ixnfo.com

See also my articles:
Configure the PTR record
My other articles about DNS

Leave a comment

Leave a Reply