Configuring BIND

After a detailed perusal of the docs, configuration of the nameserver began, following the template files kindly included in the distribution.

Script started on Wed Oct 27 20:46:41 1999
beorn% ssh gandalf
dfraser@gandalf's password: 
Last login: Wed Oct 27 17:40:17 1999 from 192.168.1.1
NetBSD 1.4.1 (GENERIC) #1: Tue Aug 10 00:03:09 MEST 1999

Welcome to NetBSD!

No mail.

MacDonald has the gift on compressing the largest amount of words into
the smallest amount of thoughts."
                -- Winston Churchill
gandalf% su
Password:

First, we'll make a directory to store the BIND datafiles, and copy the examples that came with the distribution to handy locations.

%mkdir /var/named
%chmod 755 /var/named
%cd /usr/local/src/bind8.2.2/src/conf/workstation/
%ls
named.conf  pri         root.cache  stub
%cp root.cache /var/namedb
%cp named.conf /etc
%cp -R pri /var/named
%cd /var/named/pri
%ls
127.0.0   localhost
%cat localhost
; localhost.
$TTL 3600
@               in      soa     localhost. postmaster.localhost. (
                                1993050801      ;serial
                                3600            ;refresh
                                1800            ;retry
                                604800          ;expiration
                                3600 )          ;minimum

                        ns      localhost.

                        a       127.0.0.1

Now I'll make a copy of this handy localhost zone configuration and modify it to make my fraser.csd.uwo.ca zone.

%cp localhost fraser.csd.uwo.ca
%jed fraser.csd.uwo.ca 
%cat fraser.csd.uwo.ca
; fraser.csd.uwo.ca

@               in      soa     fraser.csd.uwo.ca. postmaster.capybara.org. (
                                1993050801      ;serial
                                3600            ;refresh
                                1800            ;retry
                                604800          ;expiration
                                3600 )          ;minimum

                        ns      fraser.csd.uwo.ca.

                in      a       24.112.183.217
www             in      a       129.100.10.247
mail            in      cname   www


Now, I have to put the root.cache in the right place to ensure BIND gets bootstrapped properly

%pwd
/var/named/pri
%cd ..
%cp /usr/local/src/bind8.2.2/src/conf/workstation/root.cache .

And then I have to edit the main BIND configuration file to tell it about my zone, and the zone I'm going to be doing secondary for.

%cd /etc
%jed named.conf
%cat /etc/named.conf
options {
        directory "/var/named";
};

zone "." {
        type hint;
        file "root.cache";
};

zone "localhost" {
        type master;
        file "pri/localhost";
};

zone "0.0.127.in-addr.arpa" {
        type master;
        file "pri/127.0.0";
};

zone "fraser.csd.uwo.ca" {
        type master;
        file "pri/fraser.csd.uwo.ca";
};

zone "skysys.org" {
        type slave;
        file "skysys.org.cache";
        masters {
                206.221.233.218;
        };
};

Now, we'll run a quick test to see if the configuration was sane.

%named -f -d 1
Debug level 1
Version = named 8.2.2-REL Fri Oct 22 00:00:14 EDT 1999
        dfraser@beorn.capybara.org:/usr/local/src/bind8.2.2/src/bin/named
conffile = /etc/named.conf
starting.  named 8.2.2-REL Fri Oct 22 00:00:14 EDT 1999
        dfraser@beorn.capybara.org:/usr/local/src/bind8.2.2/src/bin/named
ns_init(/etc/named.conf)
Adding 64 template zones
evSetTimer(ctx 0xef000, func 0x1e248, uap 0, due 941076340.681918000, inter 3600.000000000)
evSetTimer(ctx 0xef000, func 0x331c0, uap 0, due 941076340.682784000, inter 3600.000000000)
evSetTimer(ctx 0xef000, func 0x2de24, uap 0, due 941076340.683526000, inter 3600.000000000)
evSetTimer(ctx 0xef000, func 0x1e2c8, uap 0, due 941076340.684262000, inter 3600.000000000)
update_zone_info('.', 3)
source = root.cache
reloading hint zone
db_load(root.cache, , 1, Nil, Normal)
hint zone "" (IN) loaded (serial 0)
zone[1] type 3: '.' z_time 0, z_refresh 0
update_zone_info('localhost', 1)
source = pri/localhost
purge_zone(localhost,1)
reloading zone
db_load(pri/localhost, localhost, 2, Nil, Normal)
master zone "localhost" (IN) loaded (serial 1993050801)
evSetTimer(ctx 0xef000, func 0x3e21c, uap 0xb81c8, due 941072766.274681000, inter 0.000000000)
zone[2] type 1: 'localhost' z_time 0, z_refresh 0
update_zone_info('0.0.127.in-addr.arpa', 1)
source = pri/127.0.0
purge_zone(0.0.127.in-addr.arpa,1)
reloading zone
db_load(pri/127.0.0, 0.0.127.in-addr.arpa, 3, Nil, Normal)
master zone "0.0.127.in-addr.arpa" (IN) loaded (serial 1993050801)
evSetTimer(ctx 0xef000, func 0x3e21c, uap 0xb8258, due 941072757.322842000, inter 0.000000000)
zone[3] type 1: '0.0.127.in-addr.arpa' z_time 0, z_refresh 0
update_zone_info('fraser.csd.uwo.ca', 1)
source = pri/fraser.csd.uwo.ca
purge_zone(fraser.csd.uwo.ca,1)
reloading zone
db_load(pri/fraser.csd.uwo.ca, fraser.csd.uwo.ca, 4, Nil, Normal)
Zone "fraser.csd.uwo.ca" (file pri/fraser.csd.uwo.ca): No default TTL set using SOA minimum instead
master zone "fraser.csd.uwo.ca" (IN) loaded (serial 1993050801)

[snip .. stuff working]
%exit
exit
gandalf% exit
logout
Connection to gandalf closed.
beorn% exit
exit

Script done on Wed Oct 27 21:06:51 1999

Everything looks good so far. Now we have to set up the system to run BIND at startup.