Setting Up bind9

The test server is also a DNS server. It hosts three local domains with two hosts each. The IP address of each host is the same, like it would be the case on a rented server in the internet if it hosts several domains. Each domain also has a mail server which is advertised by its MX record in the zone file.

In a regular installation of bind9 on a Debian system, we modify named.conf.local like this:

//
// Do any local configuration here
//

// Manage the file logs
include "/etc/bind/named.conf.log";

zone "annwn.local" {
         type master;
         file "/etc/bind/db.annwn.local";
};
zone "sol.local" {
         type master;
         file "/etc/bind/db.sol.local";
};
zone "centauri.local" {
         type master;
         file "/etc/bind/db.centauri.local";
};
zone "0.168.192.in-addr.arpa" {
         type master;
         file "/etc/bind/db.0.168.192.in-addr.arpa.inv";
};


// Consider adding the 1918 zones here, if they are not used in your
// organization
include "/etc/bind/zones.rfc1918";

And our zone files are like this.

db.annwn.local:

;
; BIND data file for domain annwn.local
;
$TTL    3600
@       IN      SOA     luchtaine.annwn.local root.annwn.local (
                        2011112501      ; Serial
                                  3600  ; Refresh [1h]
                                   600  ; Retry [10m]
                                 86400  ; Expire [1d]
                                   600 )        ; Negative Cache TTL [1h]
;
@       IN      NS      luchtaine.annwn.local.
@       IN      MX      10 luchtaine.annwn.local.

luchtaine       IN      A       192.168.0.250
morrigan        IN      A       192.168.0.160

smtp            IN      CNAME   luchtaine
imap            IN      CNAME   luchtaine
ldap            IN      CNAME   luchtaine

db.sol.local:

;
; BIND data file for domain sol.local
;
$TTL    3600
@       IN      SOA     luchtaine.annwn.local root.annwn.local (
                        2011112501      ; Serial
                                  3600  ; Refresh [1h]
                                   600  ; Retry [10m]
                                 86400  ; Expire [1d]
                                   600 )        ; Negative Cache TTL [1h]
;
@       IN      NS      luchtaine.annwn.local.
@       IN      MX      10 luchtaine.annwn.local.

mercury         IN      A       192.168.0.250
venus           IN      A       192.168.0.160

smtp            IN      CNAME   mercury
imap            IN      CNAME   mercury
ldap            IN      CNAME   mercury

db.centauri.local:

;
; BIND data file for domain centauri.local
;
$TTL    3600
@       IN      SOA     luchtaine.annwn.local root.annwn.local (
                        2011112501      ; Serial
                                  3600  ; Refresh [1h]
                                   600  ; Retry [10m]
                                 86400  ; Expire [1d]
                                   600 )        ; Negative Cache TTL [1h]
;
@       IN      NS      luchtaine.annwn.local.
@       IN      MX      10 luchtaine.annwn.local.

alpha           IN      A       192.168.0.250
beta            IN      A       192.168.0.160

smtp            IN      CNAME   alpha
imap            IN      CNAME   alpha
ldap            IN      CNAME   alpha

For reverse lookups, we provide this data file, db.0.168.192.in-addr.arpa.inv:

;
; BIND _reverse_ data file 192.168.0.x
;
$TTL    3600
@       IN      SOA     luchtaine.annwn.local root.annwn.local (
                        2011112501      ; Serial
                                  3600  ; Refresh [1h]
                                   600  ; Retry [10m]
                                 86400  ; Expire [1d]
                                   600 )        ; Negative Cache TTL [1h]
;
@       IN      NS      luchtaine.annwn.local.

250     IN      PTR     luchtaine.annwn.local.
160     IN      PTR     morrigan.annwn.local.

250     IN      PTR     mercury.sol.local.
160     IN      PTR     venus.sol.local.

250     IN      PTR     alpha.centauri.local.
160     IN      PTR     beta.centauri.local.