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