Farid Ahmadian / Slackware

Slackware 12.2 - BIND DNS server / forward and reverse zone configuration examples

Public domain


/etc/named.conf

include "/etc/rndc.key";

acl mynet { 192.168.1.0/24; 172.16.20.0/24; };

controls { inet 127.0.0.1 port 953 allow { localhost; none; } keys { rndc-key; }; };

options {
  directory "/var/named";
  allow-query { localhost; mynet; none; };
  allow-recursion { localhost; mynet; none; };
};

zone "." {
  type hint;
  file "caching-example/named.ca";
};

zone "localhost" {
  type master;
  file "caching-example/localhost.zone";
  allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
  type master;
  file "caching-example/named.local";
  allow-update { none; };
};

zone "example.net" {
  type master;
  file "example.net/example.net.fwd";
};

zone "20.16.172.in-addr.arpa" {
  type master;
  file "example.net/example.net.rev";
};

/var/named/example.net/example.net.fwd

$TTL 1D
$ORIGIN example.net.
@                       SOA     ns1     hostmaster      (
                                                2008111100    ; sn  = serial
                                                1H            ; ref = refresh
                                                10M           ; ret = retry
                                                1W            ; ex  = expiry
                                                3H            ; min = minimun
                                                        )
                        NS      ns1
ns1                     A       172.16.20.100
www                     A       172.16.20.2
ftp                     CNAME   www

/var/named/example.net/example.net.rev

$TTL 1D
$ORIGIN 20.16.172.in-addr.arpa.
@                       SOA     ns1.example.net.        hostmaster.example.net. (
                                                                2008111100  ; sn  = serial
                                                                1H          ; ref = refresh
                                                                10M         ; ret = retry
                                                                1W          ; ex  = expiry
                                                                3H          ; min = minimum
                                                                                )
                        NS      ns1.example.net.
100                     PTR     ns1.example.net.
2                       PTR     www.example.net.

/etc/rndc.key

// Key generator : # dnssec-keygen -a hmac-md5 -b 128 -n HOST rndc-key
key "rndc-key" {
  algorithm hmac-md5;
  secret "4SpFROCnaqT0eYs9YWmKxA==";
};

Essentials

------------------------------------------------------------
FQDN ( Fully Qualified Domain Name ) : www.example.net.
------------------------------------------------------------
Domain example.net :
  ns1.example.net   172.16.20.100
  www.example.net   172.16.20.2
  ftp.example.net   172.16.20.2
------------------------------------------------------------
named.conf :
  1- comment : #    //   /* */
  2- options : directoy "/var/named/"
  3- zone definition : type , file
zone file :
  1- comment :  ;
  2- directive : $TTL , $ORIGIN
  3- resource records : SOA NS A PTR CNAME
       name ttl class SOA   name-server email-add sn ref ret ex min
       name ttl class NS    name-server
       name ttl class A     ipv4
       name ttl class PTR   name
       name ttl class CNAME canonical-name
  4- root servers :
       ftp://ftp.internic.net/domain/named.cache
       ftp://ftp.internic.net/domain/named.root

Bind Version Check

dig @4.2.2.1 version.bind  chaos txt

Root Servers List

dig +tcp @a.root-servers.net ns .

BY: Pejman Moghadam
TAG: dns, bind
DATE: 2008-11-11 12:50:12


Farid Ahmadian / Slackware [ TXT ]

With many thanks and best wishes for dear Pejman Moghadam, someone who taught me alot in linux and life :)