Make your own free website on Tripod.com
Configuring BIND
DNS through BIND


Executive Summary

    # cd /etc/namedb
    # sh make-localhost
    # cp /pathto/named.conf .
    # cp /pathto/named.root .
    # cp /pathto/lab.ts .
    # cp /pathto/192.168.10 .
    # vi /etc/rc.conf
                named_enable="YES"
    # /usr/sbin/ndc start
Finished

Still under heavy construction.  ie it is not done yet.  doing exec sums first.

BIND 8 is the version used in FreeBSD 4.7 installed by default.
BIND 9 is avalible (ports/net/bind9) but I'm using 8 main because in comes already installed and just has to configured and that's what I used in the past.

Of course if you have DNS provided by your ISP just use the forwarders.

Configuring

Create the local reverse DNS zone file.
    # cd /etc/namedb
    # sh make-localhost
This creates /etc/namedb/localhost.rev   I've seen this call named.local in other implementations of BIND.  It also creates "localhost-v6.rev" but I'm not using IPv6.  If you change your hostname or domain name you will have to edit/rebuild these files.


Create the main confuration file named.conf

##** begin named.conf
options {
    directory "/etc/namedb";
};
zone "." {
    type hint;
    file "named.root";
};
zone "lab.ts" {
    type master;
    file "lab.ts";
};
zone "0.0.127.in-addr.arpa" {
    type master;
    file "localhost.rev";
};
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.INT" {
    type master;
    file "localhost-v6.rev";
};
zone "10.168.192.IN-ADDR.ARPA" {
    type master;
    file "192.168.10";
};
##**end named.conf

In the options area we have the directory where the files are located.
The rest of the enteries are for the zone information files.
zone name, type, and filename.


Create the rest of your zone files

The files called in named.conf.
named.root    The root zone file.  Points to root name servers
lab.ts              The local zone file.  For your local domain
192.168.10     The reverse lookup.  Getting the host name when you have the IP address.

named.root
This file is made available by InterNIC registration services under anonymous FTP as
/domain/named.root
on server   FTP.RS.INTERNIC.NET

lab.ts
##** begin lab.ts
$TTL    43200
@            IN    SOA    homer.lab.ts.    root.homer.lab.ts. (
                2002100401 ; serial
                3600 ; refresh
                900 ; retry
                1209600 ; expire
                43200 ; default_ttl
                )
@            IN    MX    5    homer.lab.ts.
@            IN    NS    homer.lab.ts.
homer     IN    A    192.168.10.25
uncle       IN    A    192.168.10.45
rick         IN    A    192.168.10.5
hpux       IN    A    192.168.10.29
getafix    IN    A    192.168.10.24
##** end lab.ts

192.168.10
##** begin "192.168.10"
$TTL    43200
@        IN    SOA    homer.lab.ts.    root.homer.lab.ts. (
            2002100401 ; serial
            3600 ; refresh
            900 ; retry
            1209600 ; expire
            43200 ; default_ttl
            )
@        IN    NS      homer.lab.ts.
25        IN    PTR    homer.lab.ts.
45        IN    PTR    uncle.lab.ts.
5          IN    PTR    rick.lab.ts.
29        IN    PTR    hpux.lab.ts.
24        IN    PTR    getafix.lab.ts.
##** end "192.168.10"

Acromyn
Description
$TTL Time to Live
@

IN

SOA
Start of zone authority
NS Authoritative name server
A a host address
CNAME
canonical name for an alias
MX
Mail exchanger (server)
PTR
domain name pointer used in reverse DNS



File format



Enabling BIND

To start at boot
    edit /etc/rc.conf
    named_enable="YES"

To start manually
    # ndc start

Woohoo we're done.

Next sendmail
Index