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