Home | History | Annotate | Line # | Download | only in doc
NSD-FOR-BIND-USERS revision 1.1.1.1
      1 NSD for BIND users
      2 ------------------
      3 Contents
      4 1.  Zone compiler.
      5 2.  Authoritative only.
      6 3.  Config file format.
      7 4.  Keys not per IP address.
      8 5.  NOTIFY of NS-entries.
      9 6.  Less options.
     10 7.  Master-Slave meshes.
     11 8.  AXFR behaviour.
     12 9.  Ports.
     13 10. nsd-control setup
     14 
     15 Please see the README for general information. This document
     16 assumes the reader is familiar with BIND tools and explains
     17 the differences between BIND and NSD.
     18 
     19 1. Zone compiler.
     20 
     21 In its memory NSD maintains fragments of data that are ready to put 
     22 'on the wire' without a lot of additional work by the server. Those 
     23 fragments of data need to be compiled from the zone file. Therefore 
     24 NSD has a zone compiler that translates the text format zone files
     25 into a binary format database file that the server reads.
     26 
     27 2. Authoritative only.
     28 
     29 NSD only serves authoritatively. So, NSD does not provide caching, and
     30 does not provide recursion, or resolver functionality. NSD can, in other
     31 words, function as master or slave server.
     32 
     33 This also means no root zone '.' type hint is used; leave out the root
     34 zone entirely from your configuration. NSD does not cache the root.
     35 NSD will not provide an upward referral in case an authoritative answer 
     36 cannot be found. Because of this design choice (see Appendix B.1 of the 
     37 REQUIREMENTS file) NSD does not need to maintain knowledge of the 
     38 root-server set and there is no need for a root.hints file.
     39 Also leave out localhost zones from NSD config.
     40 
     41 3. Config file format.
     42 
     43 The config file for NSD nsd.conf(5) is different from BIND named.conf(5).
     44 See the manual pages for differences in syntax. The zone files with 
     45 resource records have the same format however.
     46 
     47 A short configuration file for BIND can look like this:
     48 
     49 // Name server configuration named.conf
     50 options {
     51 	directory "/etc/dns";
     52 	pid-file "/etc/dns/pid-file";
     53 	dnssec-enable yes;
     54 	listen-on-v6 { any; };
     55 	recursion no;
     56 };
     57 
     58 // logging options for the DNS Server
     59 logging {
     60 	channel mainlog {
     61 		file "/var/log/dns.log" size 10m;
     62 		severity info;
     63 	};
     64 	category default {
     65 		mainlog;
     66 	};
     67 };
     68 
     69 // root hints
     70 zone "." IN {
     71 	type hint;
     72 	file "root.servers";
     73 };
     74 
     75 zone "localhost" IN {
     76 	type master;
     77 	file "localhost.zone";
     78 	allow-update { none; };
     79 };
     80 
     81 zone "0.0.127.in-addr.arpa" IN {
     82 	type master;
     83 	file "localhost.rev";
     84 	allow-update { none; };
     85 };
     86 
     87 // authoritative server for example.com
     88 zone "example.com" IN {
     89 	type master;
     90 	file "example.com.signed";
     91 };
     92 
     93 The equivalent configuration file for NSD is shown below. Note no
     94 ;s at the end of statements. No braces {}, and comment is with #.
     95 
     96 # Name server config for NSD, nsd.conf
     97 server:
     98 	zonesdir: "/etc/dns"
     99 	pidfile: "/etc/dns/pid-file"
    100 	# dnssec is automatically enabled in NSD for signed zones.
    101 	# ip6 is also enabled for NSD. (ip4-only: yes to turn off).
    102 	# NSD does not do recursion.
    103 	database: "/etc/dns/nsd.db"
    104 	# logging clause comes here, no size or severity options.
    105 	logfile: "/var/log/dns.log"
    106 
    107 # NOTE: no root hints.
    108 #   no localhost, and no 0.0.127.in-addr.arpa zone.
    109 
    110 # authoritative server for example.com
    111 zone:
    112 	name: "example.com"
    113 	zonefile: "example.com.signed"
    114 
    115 4. Keys not per IP address.
    116 
    117 BIND associates TSIG keys with an IP address. When communicating from/to
    118 that address BIND will TSIG sign.  NSD associates TSIG keys with the
    119 acl entries, when performing these functions NSD will sign with TSIG.
    120 It is thus possible to configure NSD to use a different key for
    121 notifications then for zone transfers, and a different key in one
    122 direction from the other.
    123 Additionally, NSD will reply TSIG signed queries with TSIG signed responses.
    124 
    125 In BIND you might have a master that uses tsig for zone updates.
    126 
    127 // ... rest of named.conf config file
    128 
    129 // the TSIG key shared secret with the slave server
    130 key key23.example.com. {
    131 	algorithm hmac-md5;
    132 	secret "6KM6qiKfwfEpamEq72HQdA==";
    133 };
    134 
    135 // when BIND communicates with this server, use the key
    136 server 168.192.0.15 {
    137 	keys { key23.example.com.; };
    138 };
    139 
    140 zone "example.com" IN {
    141 	type master;
    142 	file "example.com.signed";
    143 	allow-transfer { key key23.example.com.; };
    144 };
    145 
    146 For NSD the master configuration would look a little different.
    147 
    148 # ... rest of nsd.conf config file.
    149 
    150 # The TSIG key shared secret with the slave server
    151 key:
    152 	name: "key23.example.com."
    153 	algorithm: hmac-md5
    154 	secret: "6KM6qiKfwfEpamEq72HQdA=="
    155 
    156 # no need to list the server <addr> { keys { keyname; }; }; statement
    157 
    158 zone:
    159 	name: "example.com"
    160 	zonefile: "key23.example.com."
    161 	# the allow-transfer and server statements from BIND rolled into one.
    162 	provide-xfr: 168.192.0.15 key23.example.com.
    163 	#
    164 	# since NSD does not send notifies to the servers listed in the NS rrs,
    165 	# the above server must be explicitly named to get notify messages.
    166 	# see item 5, below. Note, the keyname is repeated here.
    167 	notify: 168.192.0.15 key23.example.com.
    168 
    169 5. NOTIFY of NS-entries.
    170 
    171 BIND sends notification messages automatically to the servers named
    172 in the SOA and NS entries of a zone. NSD does not. It sends only to
    173 the 'notify:' entries in the config file. If you want NSD to send 
    174 notifications to these servers, include notify: statements in the config
    175 file for them.
    176 
    177 6. Less options.
    178 
    179 NSD has less options than bind has. It is designed to be small.
    180 
    181 Some options that are *not* available in NSD are:
    182 	provide-ixfr
    183 	trusted-keys {}
    184 	controls {}
    185 	logging options
    186 	lwres {}
    187 	rrset-order
    188 	recursion yes;
    189 	cache options
    190 	zone types: hint, forward, stub
    191 	view clauses 
    192 	
    193 7. Master-Slave meshes.
    194 
    195 NSD can be configure as both a slave of a (hidden) master and as
    196 a master to further slaves as well.  This way meshes of name servers
    197 can be created, like with BIND.
    198 
    199 8. AXFR behaviour.
    200 
    201 To do a manual AXFR, nsd-xfer will perform like the BIND tools. But,
    202 the initial query for the SOA is done by TCP, where the BIND tools
    203 use UDP for that SOA query. According to RFC (1034, 1035) specs, both
    204 UDP and TCP for the initial SOA probe are OK.
    205 
    206 An AXFR initiated by the built-in transfer process will not start with a
    207 SOA query at all.  The first packet of the AXFR transfer will be used
    208 to determine the SOA version number in that case.  This is a conscious
    209 breach of RFC spec to ease implementation and efficiency.
    210 
    211 Note that usually the built-in transfer process will request an IXFR, 
    212 and preceed the IXFR with a UDP IXFR request like the RFC says.
    213 
    214 9. Ports.
    215 
    216 Nsd can be configured to run on another port than port 53. See the 
    217 'port:' statement in the nsd.conf file.  Access control list elements
    218 can be appended with @port_number to refer to a specific port only,
    219 such as 10.11.12.100@8853. NSD will not set its source port for 
    220 outgoing connections to be equal to the configured port, ephemeral 
    221 ports are used for notify, ixfr and axfr requests to other servers.
    222 
    223 10. nsd-control setup
    224 
    225 The rndc tool for BIND named needs a secret to communicate securely with
    226 the server.  The NSD tool nsd-control can setup its secrets with the
    227 nsd-control-setup command.  It uses public keys, and SSL connections.
    228 
    229