Configuring a DNS Server on freebsd   February 7th, 2010

Step 1. Create named.conf file with the following content:

Note: options “directory”, “, “pid-file”, “dump-file”, “statistics-file” might have other values if you configure bind server on Linux. The following values are for FreeBSD.

Note: do not forget to put “;” after every IP, incuding last IP, and to enclose rules between { }.

options {
        directory       "/etc/namedb";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";

        forwarders      { 213.157.176.3; 213.157.176.1; };
        allow-recursion { 10.0.0.1/16; 127.0.0.1; };
        allow-transfer  { 213.157.176.3; 213.157.176.1; 192.162.16.0/24; };
        listen-on       { 127.0.0.1; 86.X.Y.Z; };
};

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

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "master/localhost.rev";
};


zone "Z.Y.X.86.in-addr.arpa" {
        type master;
        file "master/Z.Y.X.86.in-addr.arpa";
};

zone "example.com" in {
        type master;
        file "/etc/namedb/example.com";
};

Few explanations regarding following variables: Read the rest of this entry »