Basic DNS Server Configuration №207.1
Implementations of DNS
(Domain Name System) name server software
-
BIND
(on Unix and Linux platforms most often referred to asnamed
(name daemon) -
dnsmasq
-
djbdns
-
PowerDNS
-
Unbound
(popular on the ‘BSDs’)
Comparison of DNS server software at en.wikipedia.org
Configuring a named
server (BIND
)
-
svc
named
(name daemon) is an Internet domain name server - .. and the de facto standard on Unix-like operating systems.
-
Part of the
BIND 9
distribution from ISC. -
Online resource:
man named(8)
at man.NetBSD.org -
file
/etc/named.conf
is the main configuration file fornamed
-
/etc/bind/named.conf
on Debian. -
Online resource:
man named.conf(5)
at man.NetBSD.org
Example configuration of a (master) named
:
# file: named.conf
# brief: main configuration file for named(8)
# -------------------------------------------
options {
listen-on port 53 {
127.0.0.1;
10.0.8.216;
};
listen-on-v6 port 53 { none; };
forwarders { # own nameserver
9.9.9.9; # definitions
1.1.1.1;
10.0.1.253;
};
forward first; # ask defined DNS first
recursion yes; # generally allow
allow-recursion { 10.0.8.0/24; }; # restrict recursion requests PRÜFUNG
allow-query { CALLER; }; # access rights
#minimal-responses yes; # reduced answer
directory "/var/cache/bind"; # zone file root dir (Debian)
also-notify { 10.0.8.121; }; # slave addresses
dnssec-enable yes;
dnssec-validation yes;
};
acl CALLER {
10.0.8.0/24;
localhost;
};
logging {
channel QUERY1 {
file "/var/log/bind/queries1.log";
severity info;
print-time yes;
print-category yes;
print-severity yes;
};
category queries { QUERY1; };
};
zone "example.com" IN /* default */ { # forward lookup zone
type master;
file "example.com.zone.signed"; # signed (for transferring)
allow-transfer { key example.tsig.key; };
notify yes; # to notify slave nameservers
};
zone "0.168.192.in-addr.arpa" IN { # reverse lookup zone
type master;
file "0.168.192.in-addr.arpa.zone";
allow-transfer { key example.tsig.key; };
};
include "/etc/bind/example.tsig.key";
# EOF /etc/bind/named.conf ---------------------------------------
Example configuration of a secondary zone
in a named.conf
of a slave server:
# file: named.conf
# brief: bind configuration file (slave side)
# -------------------------------------------
options {
listen-on port 53 {
127.0.0.1;
10.0.8.121;
};
directory "/var/named";
allow-query { any; };
};
zone "example.com" IN {
type slave;
masters { 10.0.8.216; };
file "example.com.zone";
allow-query { any; };
};
zone "0.168.192.in-addr.arpa" IN {
type slave;
masters { 10.0.8.216; };
file "0.168.192.in-addr.arpa.zone";
allow-query { any; };
};
server 10.0.8.216 {
keys { example.tsig.key; };
};
include "/etc/named/example.tsig.key";
# EOF /etc/named.conf -----------------------
-
cmd
/usr/sbin/rndc
remotely controls name servers -
Important subcommands:
-
reload
reloads configuration and zone files -
status
queries status -
flush
flushes the cache -
freeze
freezes writes on zone files (e. g. to modify them manually) -
thaw
unfreezes
-
-
Online resource:
man rndc(8)
at man.NetBSD.org -
cmd
kill
terminates or signals processes -
cmd
host
is aDNS
lookup utility -
cmd
dig
is anotherDNS
lookup utility