Chapter 4. Setting Up a DNS Server

Table of Contents

4.1. /var/lib/etc/named.conf
4.2. /var/lib/named/var/named/zone Files
4.2.1. 127.0.0
4.2.2. db.12.12.12..hosts
4.2.3. db.guibland.com.hosts

4.1. /var/lib/etc/named.conf

The purpose of this reference guide for named is to provide a sample configuration for a typical setup. Additional information for configuring a BIND server may be found at http://www.isc.org/products/BIND/. The purpose of DNS is to resolve all names of our nodes without editing each /etc/hosts file.

To quickly set up a DNS server, just check the file: /etc/clusterserver.conf and launch setup_dns.pl. Keep in mind Bind is chrooted.

Example of named.conf

key mykey {
    algorithm hmac-md5;
    secret "eoqj88fEwvNpSMoCAaH+NQ==";
};

include "/etc/bogon_acl.conf";
include "/etc/trusted_networks_acl.conf";

controls {
    inet 127.0.0.1 port 953
    allow { 127.0.0.1; 12.12.12.253; } keys { mykey; };
};

options {
    version "";
    directory "/var/named";
    dump-file "/var/tmp/named_dump.db";
    pid-file "/var/run/named.pid";
    statistics-file "/var/tmp/named.stats";
    zone-statistics yes;
    auth-nxdomain yes;
    query-source address * port *;
    listen-on port 53 { any; };
    cleaning-interval 120;
    transfers-in 20;
    transfers-per-ns 2;
    lame-ttl 0;
    max-ncache-ttl 10800;
    notify no;
    transfer-format many-answers;
    max-transfer-time-in 60;
    interface-interval 0;
    allow-query { any; };
    allow-recursion { any; };
    allow-transfer { any; };
};
zone "ac" { type delegation-only; };
zone "cc" { type delegation-only; };
zone "com" { type delegation-only; };
zone "cx" { type delegation-only; };
zone "lv" { type delegation-only; };
zone "museum" { type delegation-only; };
zone "net" { type delegation-only; };
zone "nu" { type delegation-only; };
zone "ph" { type delegation-only; };
zone "sh" { type delegation-only; };
zone "tm" { type delegation-only; };
zone "ws" { type delegation-only; };

zone "." IN {
        type hint;
        file "named.ca";
};

zone "localdomain" IN {
        type master;
        file "master/localdomain.zone";
        allow-update { none; };
};

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

};

zone "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.arpa" IN {
        type master;
        file "reverse/named.ip6.local";
        allow-update { none; };
};

zone "255.in-addr.arpa" IN {
        type master;
        file "reverse/named.broadcast";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "reverse/named.zero";
        allow-update { none; };
};
zone "12.12.12.in-addr.arpa" {
    type master;
    file "zone/db.12.12.12.hosts";
    forwarders { };
};
zone "guibland.com" {
    type master;
    file "zone/db.guibland.com.hosts";
    forwarders { };
};

The options tag specifies the “named” directory , the pid file, and the forwarders, which is needed to resolve out-of-zone names. We have various zones, 0.0.127.in-addr.arpa for loopback, 12.12.12.in-addr.arpa, and guibland.com, our domain name.

4.2. /var/lib/named/var/named/zone Files

4.2.1. 127.0.0

example of db.127.0.0

$TTL 3D
@               IN      SOA     guibland.com. root.guibland.com. (
                2002260304       ; Serial
                28800   ; Refresh
                7200    ; Retry
                604800  ; Expire
                86400)  ; Minimum TTL
                NS      dnsserver.guibland.com.
1                       PTR     localhost.

4.2.2. db.12.12.12..hosts

A typical db.12.12.12.hosts

$TTL 3D
@       IN      SOA     dnsserver.clusterdev.   root.dnsserver.guibland.com. (
                        2002260310
                        10800   ; Refresh
                        3600    ; Retry
                        604800  ; Expire
                        86400 ) ; Minimum TTL 
                        NS      dnsserver.guibland.com.
10      IN      PTR     dnsserver.guibland.com.
14      IN      PTR     node4.guibland.com.
13      IN      PTR     node3.guibland.com.
12      IN      PTR     node2.guibland.com.
11      IN      PTR     node1.guibland.com.

4.2.3. db.guibland.com.hosts

A typical db.guibland.com.hosts

$TTL 3D
@       IN      SOA     dnsserver.clusterdev. root.dnsserver.guibland.com. (
                2002260306       ; Serial
                8H   ; Refresh
                2H   ; Retry
                4W  ; Expire
                1D)  ; Minimum TTL
                TXT     "Cluster developement" 
                IN      NS      dnsserver.guibland.com.
localhost               A       127.0.0.1
dns                     IN      CNAME   dnsserver.guibland.com.
dnsserver.guibland.com.   IN      A       12.12.12.10
node1.guibland.com.       IN      A       12.12.12.11
node2.guibland.com.       IN      A       12.12.12.12
node3.guibland.com.       IN      A       12.12.12.13
node4.guibland.com.       IN      A       12.12.12.14