named.conf sections
The named.conf consists of a general section (options, logging etc) and the zones section.
All lines (except the opening curly brackets only rows) must end with a semicolon.
The named.conf general section
The option container in named.conf.
options{
directory /var/named/; this is the base directory for all files referenced in named.conf
allow-transfer { 192.168.1.100; }; this is a secondary authoritative DNS server
};
Logging example
logging{
channel my_syslog{
syslog local1;
severity info;
};
category queries { my_syslog; };
category default { my_syslog; };
};
Also you need to modify /etc/syslog.conf like this:
local1.info /var/log/bind.log
Finally restart syslog and bind.
rndc key
include “/var/named/rndc.key”;
The rndc.key file will be generated with sbin/rndc-confgen -a.
The zones section
Domain zone file entry
It specifies 3 things: the domain (name or reverse resolution), if it’s primary or secondary and the zone file.
zone “www.domain.com” {
type master;
file “filename”;
};
In case of a secondary DNS server the type changes to slave and another line is required:
masters { 192.168.0.1; };
Negative resolution
The negative resolution zone pointer is the same as the normal one with the exception of the address: it is written in reverse and suffixed by .in-addr.arpa. For instance for 192.168.0.10 the first row is:
zone “10.0.168.192.in-addr.arpa” {