2 - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
3 - Copyright (C) 2000-2003 Internet Software Consortium.
5 - Permission to use, copy, modify, and distribute this software for any
6 - purpose with or without fee is hereby granted, provided that the above
7 - copyright notice and this permission notice appear in all copies.
9 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 - PERFORMANCE OF THIS SOFTWARE.
17 <!-- $Id: Bv9ARM.ch04.html,v 1.87.48.2 2009/04/03 01:52:21 tbox Exp $ -->
20 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21 <title>Chapter 4. Advanced DNS Features</title>
22 <meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
23 <link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
24 <link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
25 <link rel="prev" href="Bv9ARM.ch03.html" title="Chapter 3. Name Server Configuration">
26 <link rel="next" href="Bv9ARM.ch05.html" title="Chapter 5. The BIND 9 Lightweight Resolver">
28 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
29 <div class="navheader">
30 <table width="100%" summary="Navigation header">
31 <tr><th colspan="3" align="center">Chapter 4. Advanced DNS Features</th></tr>
33 <td width="20%" align="left">
34 <a accesskey="p" href="Bv9ARM.ch03.html">Prev</a> </td>
35 <th width="60%" align="center"> </th>
36 <td width="20%" align="right"> <a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
42 <div class="chapter" lang="en">
43 <div class="titlepage"><div><div><h2 class="title">
44 <a name="Bv9ARM.ch04"></a>Chapter 4. Advanced DNS Features</h2></div></div></div>
46 <p><b>Table of Contents</b></p>
48 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#notify">Notify</a></span></dt>
49 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#dynamic_update">Dynamic Update</a></span></dt>
50 <dd><dl><dt><span class="sect2"><a href="Bv9ARM.ch04.html#journal">The journal file</a></span></dt></dl></dd>
51 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#incremental_zone_transfers">Incremental Zone Transfers (IXFR)</a></span></dt>
52 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2564066">Split DNS</a></span></dt>
53 <dd><dl><dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2564084">Example split DNS setup</a></span></dt></dl></dd>
54 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#tsig">TSIG</a></span></dt>
56 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571141">Generate Shared Keys for Each Pair of Hosts</a></span></dt>
57 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571214">Copying the Shared Secret to Both Machines</a></span></dt>
58 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571225">Informing the Servers of the Key's Existence</a></span></dt>
59 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571268">Instructing the Server to Use the Key</a></span></dt>
60 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571325">TSIG Key Based Access Control</a></span></dt>
61 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571510">Errors</a></span></dt>
63 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2571524">TKEY</a></span></dt>
64 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2571709">SIG(0)</a></span></dt>
65 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#DNSSEC">DNSSEC</a></span></dt>
67 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571778">Generating Keys</a></span></dt>
68 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571925">Signing the Zone</a></span></dt>
69 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572006">Configuring Servers</a></span></dt>
71 <dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2572220">IPv6 Support in <acronym class="acronym">BIND</acronym> 9</a></span></dt>
73 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572282">Address Lookups Using AAAA Records</a></span></dt>
74 <dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572304">Address to Name Lookups Using Nibble Format</a></span></dt>
78 <div class="sect1" lang="en">
79 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
80 <a name="notify"></a>Notify</h2></div></div></div>
82 <acronym class="acronym">DNS</acronym> NOTIFY is a mechanism that allows master
83 servers to notify their slave servers of changes to a zone's data. In
84 response to a <span><strong class="command">NOTIFY</strong></span> from a master server, the
85 slave will check to see that its version of the zone is the
86 current version and, if not, initiate a zone transfer.
89 For more information about <acronym class="acronym">DNS</acronym>
90 <span><strong class="command">NOTIFY</strong></span>, see the description of the
91 <span><strong class="command">notify</strong></span> option in <a href="Bv9ARM.ch06.html#boolean_options" title="Boolean Options">the section called “Boolean Options”</a> and
92 the description of the zone option <span><strong class="command">also-notify</strong></span> in
93 <a href="Bv9ARM.ch06.html#zone_transfers" title="Zone Transfers">the section called “Zone Transfers”</a>. The <span><strong class="command">NOTIFY</strong></span>
94 protocol is specified in RFC 1996.
96 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
97 <h3 class="title">Note</h3>
98 As a slave zone can also be a master to other slaves, <span><strong class="command">named</strong></span>,
99 by default, sends <span><strong class="command">NOTIFY</strong></span> messages for every zone
100 it loads. Specifying <span><strong class="command">notify master-only;</strong></span> will
101 cause <span><strong class="command">named</strong></span> to only send <span><strong class="command">NOTIFY</strong></span> for master
105 <div class="sect1" lang="en">
106 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
107 <a name="dynamic_update"></a>Dynamic Update</h2></div></div></div>
109 Dynamic Update is a method for adding, replacing or deleting
110 records in a master server by sending it a special form of DNS
111 messages. The format and meaning of these messages is specified
115 Dynamic update is enabled by including an
116 <span><strong class="command">allow-update</strong></span> or <span><strong class="command">update-policy</strong></span>
117 clause in the <span><strong class="command">zone</strong></span> statement. The
118 <span><strong class="command">tkey-gssapi-credential</strong></span> and
119 <span><strong class="command">tkey-domain</strong></span> clauses in the
120 <span><strong class="command">options</strong></span> statement enable the
121 server to negotiate keys that can be matched against those
122 in <span><strong class="command">update-policy</strong></span> or
123 <span><strong class="command">allow-update</strong></span>.
126 Updating of secure zones (zones using DNSSEC) follows RFC
127 3007: RRSIG, NSEC and NSEC3 records affected by updates are
128 automatically regenerated by the server using an online
129 zone key. Update authorization is based on transaction
130 signatures and an explicit server policy.
132 <div class="sect2" lang="en">
133 <div class="titlepage"><div><div><h3 class="title">
134 <a name="journal"></a>The journal file</h3></div></div></div>
136 All changes made to a zone using dynamic update are stored
137 in the zone's journal file. This file is automatically created
138 by the server when the first dynamic update takes place.
139 The name of the journal file is formed by appending the extension
140 <code class="filename">.jnl</code> to the name of the
142 file unless specifically overridden. The journal file is in a
143 binary format and should not be edited manually.
146 The server will also occasionally write ("dump")
147 the complete contents of the updated zone to its zone file.
148 This is not done immediately after
149 each dynamic update, because that would be too slow when a large
150 zone is updated frequently. Instead, the dump is delayed by
151 up to 15 minutes, allowing additional updates to take place.
154 When a server is restarted after a shutdown or crash, it will replay
155 the journal file to incorporate into the zone any updates that
157 place after the last zone dump.
160 Changes that result from incoming incremental zone transfers are
162 journalled in a similar way.
165 The zone files of dynamic zones cannot normally be edited by
166 hand because they are not guaranteed to contain the most recent
167 dynamic changes — those are only in the journal file.
168 The only way to ensure that the zone file of a dynamic zone
169 is up to date is to run <span><strong class="command">rndc stop</strong></span>.
172 If you have to make changes to a dynamic zone
173 manually, the following procedure will work: Disable dynamic updates
175 <span><strong class="command">rndc freeze <em class="replaceable"><code>zone</code></em></strong></span>.
176 This will also remove the zone's <code class="filename">.jnl</code> file
177 and update the master file. Edit the zone file. Run
178 <span><strong class="command">rndc thaw <em class="replaceable"><code>zone</code></em></strong></span>
179 to reload the changed zone and re-enable dynamic updates.
183 <div class="sect1" lang="en">
184 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
185 <a name="incremental_zone_transfers"></a>Incremental Zone Transfers (IXFR)</h2></div></div></div>
187 The incremental zone transfer (IXFR) protocol is a way for
188 slave servers to transfer only changed data, instead of having to
189 transfer the entire zone. The IXFR protocol is specified in RFC
190 1995. See <a href="Bv9ARM.ch09.html#proposed_standards">Proposed Standards</a>.
193 When acting as a master, <acronym class="acronym">BIND</acronym> 9
194 supports IXFR for those zones
195 where the necessary change history information is available. These
196 include master zones maintained by dynamic update and slave zones
197 whose data was obtained by IXFR. For manually maintained master
198 zones, and for slave zones obtained by performing a full zone
199 transfer (AXFR), IXFR is supported only if the option
200 <span><strong class="command">ixfr-from-differences</strong></span> is set
201 to <strong class="userinput"><code>yes</code></strong>.
204 When acting as a slave, <acronym class="acronym">BIND</acronym> 9 will
205 attempt to use IXFR unless
206 it is explicitly disabled. For more information about disabling
207 IXFR, see the description of the <span><strong class="command">request-ixfr</strong></span> clause
208 of the <span><strong class="command">server</strong></span> statement.
211 <div class="sect1" lang="en">
212 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
213 <a name="id2564066"></a>Split DNS</h2></div></div></div>
215 Setting up different views, or visibility, of the DNS space to
216 internal and external resolvers is usually referred to as a
217 <span class="emphasis"><em>Split DNS</em></span> setup. There are several
218 reasons an organization would want to set up its DNS this way.
221 One common reason for setting up a DNS system this way is
222 to hide "internal" DNS information from "external" clients on the
223 Internet. There is some debate as to whether or not this is actually
225 Internal DNS information leaks out in many ways (via email headers,
226 for example) and most savvy "attackers" can find the information
227 they need using other means.
228 However, since listing addresses of internal servers that
229 external clients cannot possibly reach can result in
230 connection delays and other annoyances, an organization may
231 choose to use a Split DNS to present a consistent view of itself
232 to the outside world.
235 Another common reason for setting up a Split DNS system is
236 to allow internal networks that are behind filters or in RFC 1918
237 space (reserved IP space, as documented in RFC 1918) to resolve DNS
238 on the Internet. Split DNS can also be used to allow mail from outside
239 back in to the internal network.
241 <div class="sect2" lang="en">
242 <div class="titlepage"><div><div><h3 class="title">
243 <a name="id2564084"></a>Example split DNS setup</h3></div></div></div>
245 Let's say a company named <span class="emphasis"><em>Example, Inc.</em></span>
246 (<code class="literal">example.com</code>)
247 has several corporate sites that have an internal network with
249 Internet Protocol (IP) space and an external demilitarized zone (DMZ),
250 or "outside" section of a network, that is available to the public.
253 <span class="emphasis"><em>Example, Inc.</em></span> wants its internal clients
254 to be able to resolve external hostnames and to exchange mail with
255 people on the outside. The company also wants its internal resolvers
256 to have access to certain internal-only zones that are not available
257 at all outside of the internal network.
260 In order to accomplish this, the company will set up two sets
261 of name servers. One set will be on the inside network (in the
263 IP space) and the other set will be on bastion hosts, which are
265 hosts that can talk to both sides of its network, in the DMZ.
268 The internal servers will be configured to forward all queries,
269 except queries for <code class="filename">site1.internal</code>, <code class="filename">site2.internal</code>, <code class="filename">site1.example.com</code>,
270 and <code class="filename">site2.example.com</code>, to the servers
272 DMZ. These internal servers will have complete sets of information
273 for <code class="filename">site1.example.com</code>, <code class="filename">site2.example.com</code>,<span class="emphasis"><em></em></span> <code class="filename">site1.internal</code>,
274 and <code class="filename">site2.internal</code>.
277 To protect the <code class="filename">site1.internal</code> and <code class="filename">site2.internal</code> domains,
278 the internal name servers must be configured to disallow all queries
279 to these domains from any external hosts, including the bastion
283 The external servers, which are on the bastion hosts, will
284 be configured to serve the "public" version of the <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones.
285 This could include things such as the host records for public servers
286 (<code class="filename">www.example.com</code> and <code class="filename">ftp.example.com</code>),
287 and mail exchange (MX) records (<code class="filename">a.mx.example.com</code> and <code class="filename">b.mx.example.com</code>).
290 In addition, the public <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones
291 should have special MX records that contain wildcard (`*') records
292 pointing to the bastion hosts. This is needed because external mail
293 servers do not have any other way of looking up how to deliver mail
294 to those internal hosts. With the wildcard records, the mail will
295 be delivered to the bastion host, which can then forward it on to
299 Here's an example of a wildcard MX record:
301 <pre class="programlisting">* IN MX 10 external1.example.com.</pre>
303 Now that they accept mail on behalf of anything in the internal
304 network, the bastion hosts will need to know how to deliver mail
305 to internal hosts. In order for this to work properly, the resolvers
307 the bastion hosts will need to be configured to point to the internal
308 name servers for DNS resolution.
311 Queries for internal hostnames will be answered by the internal
312 servers, and queries for external hostnames will be forwarded back
313 out to the DNS servers on the bastion hosts.
316 In order for all this to work properly, internal clients will
317 need to be configured to query <span class="emphasis"><em>only</em></span> the internal
318 name servers for DNS queries. This could also be enforced via
320 filtering on the network.
323 If everything has been set properly, <span class="emphasis"><em>Example, Inc.</em></span>'s
324 internal clients will now be able to:
326 <div class="itemizedlist"><ul type="disc">
328 Look up any hostnames in the <code class="literal">site1</code>
330 <code class="literal">site2.example.com</code> zones.
333 Look up any hostnames in the <code class="literal">site1.internal</code> and
334 <code class="literal">site2.internal</code> domains.
336 <li>Look up any hostnames on the Internet.</li>
337 <li>Exchange mail with both internal and external people.</li>
340 Hosts on the Internet will be able to:
342 <div class="itemizedlist"><ul type="disc">
344 Look up any hostnames in the <code class="literal">site1</code>
346 <code class="literal">site2.example.com</code> zones.
349 Exchange mail with anyone in the <code class="literal">site1</code> and
350 <code class="literal">site2.example.com</code> zones.
354 Here is an example configuration for the setup we just
355 described above. Note that this is only configuration information;
356 for information on how to configure your zone files, see <a href="Bv9ARM.ch03.html#sample_configuration" title="Sample Configurations">the section called “Sample Configurations”</a>.
359 Internal DNS server config:
361 <pre class="programlisting">
363 acl internals { 172.16.72.0/24; 192.168.1.0/24; };
365 acl externals { <code class="varname">bastion-ips-go-here</code>; };
371 forwarders { // forward to external servers
372 <code class="varname">bastion-ips-go-here</code>;
374 allow-transfer { none; }; // sample allow-transfer (no one)
375 allow-query { internals; externals; }; // restrict query access
376 allow-recursion { internals; }; // restrict recursion
381 zone "site1.example.com" { // sample master zone
383 file "m/site1.example.com";
384 forwarders { }; // do normal iterative
385 // resolution (do not forward)
386 allow-query { internals; externals; };
387 allow-transfer { internals; };
390 zone "site2.example.com" { // sample slave zone
392 file "s/site2.example.com";
393 masters { 172.16.72.3; };
395 allow-query { internals; externals; };
396 allow-transfer { internals; };
399 zone "site1.internal" {
401 file "m/site1.internal";
403 allow-query { internals; };
404 allow-transfer { internals; }
407 zone "site2.internal" {
409 file "s/site2.internal";
410 masters { 172.16.72.3; };
412 allow-query { internals };
413 allow-transfer { internals; }
417 External (bastion host) DNS server config:
419 <pre class="programlisting">
420 acl internals { 172.16.72.0/24; 192.168.1.0/24; };
422 acl externals { bastion-ips-go-here; };
427 allow-transfer { none; }; // sample allow-transfer (no one)
428 allow-query { any; }; // default query access
429 allow-query-cache { internals; externals; }; // restrict cache access
430 allow-recursion { internals; externals; }; // restrict recursion
435 zone "site1.example.com" { // sample slave zone
437 file "m/site1.foo.com";
438 allow-transfer { internals; externals; };
441 zone "site2.example.com" {
443 file "s/site2.foo.com";
444 masters { another_bastion_host_maybe; };
445 allow-transfer { internals; externals; }
449 In the <code class="filename">resolv.conf</code> (or equivalent) on
452 <pre class="programlisting">
454 nameserver 172.16.72.2
455 nameserver 172.16.72.3
456 nameserver 172.16.72.4
460 <div class="sect1" lang="en">
461 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
462 <a name="tsig"></a>TSIG</h2></div></div></div>
464 This is a short guide to setting up Transaction SIGnatures
465 (TSIG) based transaction security in <acronym class="acronym">BIND</acronym>. It describes changes
466 to the configuration file as well as what changes are required for
467 different features, including the process of creating transaction
468 keys and using transaction signatures with <acronym class="acronym">BIND</acronym>.
471 <acronym class="acronym">BIND</acronym> primarily supports TSIG for server
472 to server communication.
473 This includes zone transfer, notify, and recursive query messages.
474 Resolvers based on newer versions of <acronym class="acronym">BIND</acronym> 8 have limited support
478 TSIG can also be useful for dynamic update. A primary
479 server for a dynamic zone should control access to the dynamic
480 update service, but IP-based access control is insufficient.
481 The cryptographic access control provided by TSIG
482 is far superior. The <span><strong class="command">nsupdate</strong></span>
483 program supports TSIG via the <code class="option">-k</code> and
484 <code class="option">-y</code> command line options or inline by use
485 of the <span><strong class="command">key</strong></span>.
487 <div class="sect2" lang="en">
488 <div class="titlepage"><div><div><h3 class="title">
489 <a name="id2571141"></a>Generate Shared Keys for Each Pair of Hosts</h3></div></div></div>
491 A shared secret is generated to be shared between <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host2</em></span>.
492 An arbitrary key name is chosen: "host1-host2.". The key name must
493 be the same on both hosts.
495 <div class="sect3" lang="en">
496 <div class="titlepage"><div><div><h4 class="title">
497 <a name="id2571158"></a>Automatic Generation</h4></div></div></div>
499 The following command will generate a 128-bit (16 byte) HMAC-MD5
500 key as described above. Longer keys are better, but shorter keys
501 are easier to read. Note that the maximum key length is 512 bits;
502 keys longer than that will be digested with MD5 to produce a
506 <strong class="userinput"><code>dnssec-keygen -a hmac-md5 -b 128 -n HOST host1-host2.</code></strong>
509 The key is in the file <code class="filename">Khost1-host2.+157+00000.private</code>.
510 Nothing directly uses this file, but the base-64 encoded string
511 following "<code class="literal">Key:</code>"
512 can be extracted from the file and used as a shared secret:
514 <pre class="programlisting">Key: La/E5CjG9O+os1jq0a2jdA==</pre>
516 The string "<code class="literal">La/E5CjG9O+os1jq0a2jdA==</code>" can
517 be used as the shared secret.
520 <div class="sect3" lang="en">
521 <div class="titlepage"><div><div><h4 class="title">
522 <a name="id2571196"></a>Manual Generation</h4></div></div></div>
524 The shared secret is simply a random sequence of bits, encoded
525 in base-64. Most ASCII strings are valid base-64 strings (assuming
526 the length is a multiple of 4 and only valid characters are used),
527 so the shared secret can be manually generated.
530 Also, a known string can be run through <span><strong class="command">mmencode</strong></span> or
531 a similar program to generate base-64 encoded data.
535 <div class="sect2" lang="en">
536 <div class="titlepage"><div><div><h3 class="title">
537 <a name="id2571214"></a>Copying the Shared Secret to Both Machines</h3></div></div></div>
539 This is beyond the scope of DNS. A secure transport mechanism
540 should be used. This could be secure FTP, ssh, telephone, etc.
543 <div class="sect2" lang="en">
544 <div class="titlepage"><div><div><h3 class="title">
545 <a name="id2571225"></a>Informing the Servers of the Key's Existence</h3></div></div></div>
547 Imagine <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host 2</em></span>
549 both servers. The following is added to each server's <code class="filename">named.conf</code> file:
551 <pre class="programlisting">
554 secret "La/E5CjG9O+os1jq0a2jdA==";
558 The algorithm, <code class="literal">hmac-md5</code>, is the only one supported by <acronym class="acronym">BIND</acronym>.
559 The secret is the one generated above. Since this is a secret, it
560 is recommended that either <code class="filename">named.conf</code> be non-world
561 readable, or the key directive be added to a non-world readable
562 file that is included by
563 <code class="filename">named.conf</code>.
566 At this point, the key is recognized. This means that if the
567 server receives a message signed by this key, it can verify the
568 signature. If the signature is successfully verified, the
569 response is signed by the same key.
572 <div class="sect2" lang="en">
573 <div class="titlepage"><div><div><h3 class="title">
574 <a name="id2571268"></a>Instructing the Server to Use the Key</h3></div></div></div>
576 Since keys are shared between two hosts only, the server must
577 be told when keys are to be used. The following is added to the <code class="filename">named.conf</code> file
578 for <span class="emphasis"><em>host1</em></span>, if the IP address of <span class="emphasis"><em>host2</em></span> is
581 <pre class="programlisting">
583 keys { host1-host2. ;};
587 Multiple keys may be present, but only the first is used.
588 This directive does not contain any secrets, so it may be in a
593 If <span class="emphasis"><em>host1</em></span> sends a message that is a request
594 to that address, the message will be signed with the specified key. <span class="emphasis"><em>host1</em></span> will
595 expect any responses to signed messages to be signed with the same
599 A similar statement must be present in <span class="emphasis"><em>host2</em></span>'s
600 configuration file (with <span class="emphasis"><em>host1</em></span>'s address) for <span class="emphasis"><em>host2</em></span> to
601 sign request messages to <span class="emphasis"><em>host1</em></span>.
604 <div class="sect2" lang="en">
605 <div class="titlepage"><div><div><h3 class="title">
606 <a name="id2571325"></a>TSIG Key Based Access Control</h3></div></div></div>
608 <acronym class="acronym">BIND</acronym> allows IP addresses and ranges
609 to be specified in ACL
611 <span><strong class="command">allow-{ query | transfer | update }</strong></span>
613 This has been extended to allow TSIG keys also. The above key would
614 be denoted <span><strong class="command">key host1-host2.</strong></span>
617 An example of an <span><strong class="command">allow-update</strong></span> directive would be:
619 <pre class="programlisting">
620 allow-update { key host1-host2. ;};
623 This allows dynamic updates to succeed only if the request
624 was signed by a key named "<span><strong class="command">host1-host2.</strong></span>".
627 You may want to read about the more powerful
628 <span><strong class="command">update-policy</strong></span> statement in
629 <a href="Bv9ARM.ch06.html#dynamic_update_policies" title="Dynamic Update Policies">the section called “Dynamic Update Policies”</a>.
632 <div class="sect2" lang="en">
633 <div class="titlepage"><div><div><h3 class="title">
634 <a name="id2571510"></a>Errors</h3></div></div></div>
636 The processing of TSIG signed messages can result in
637 several errors. If a signed message is sent to a non-TSIG aware
638 server, a FORMERR (format error) will be returned, since the server will not
639 understand the record. This is a result of misconfiguration,
640 since the server must be explicitly configured to send a TSIG
641 signed message to a specific server.
644 If a TSIG aware server receives a message signed by an
645 unknown key, the response will be unsigned with the TSIG
646 extended error code set to BADKEY. If a TSIG aware server
647 receives a message with a signature that does not validate, the
648 response will be unsigned with the TSIG extended error code set
649 to BADSIG. If a TSIG aware server receives a message with a time
650 outside of the allowed range, the response will be signed with
651 the TSIG extended error code set to BADTIME, and the time values
652 will be adjusted so that the response can be successfully
653 verified. In any of these cases, the message's rcode (response code) is set to
654 NOTAUTH (not authenticated).
658 <div class="sect1" lang="en">
659 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
660 <a name="id2571524"></a>TKEY</h2></div></div></div>
661 <p><span><strong class="command">TKEY</strong></span>
662 is a mechanism for automatically generating a shared secret
663 between two hosts. There are several "modes" of
664 <span><strong class="command">TKEY</strong></span> that specify how the key is generated
665 or assigned. <acronym class="acronym">BIND</acronym> 9 implements only one of
666 these modes, the Diffie-Hellman key exchange. Both hosts are
667 required to have a Diffie-Hellman KEY record (although this
668 record is not required to be present in a zone). The
669 <span><strong class="command">TKEY</strong></span> process must use signed messages,
670 signed either by TSIG or SIG(0). The result of
671 <span><strong class="command">TKEY</strong></span> is a shared secret that can be used to
672 sign messages with TSIG. <span><strong class="command">TKEY</strong></span> can also be
673 used to delete shared secrets that it had previously
677 The <span><strong class="command">TKEY</strong></span> process is initiated by a
679 or server by sending a signed <span><strong class="command">TKEY</strong></span>
681 (including any appropriate KEYs) to a TKEY-aware server. The
682 server response, if it indicates success, will contain a
683 <span><strong class="command">TKEY</strong></span> record and any appropriate keys.
685 this exchange, both participants have enough information to
686 determine the shared secret; the exact process depends on the
687 <span><strong class="command">TKEY</strong></span> mode. When using the
689 <span><strong class="command">TKEY</strong></span> mode, Diffie-Hellman keys are
691 and the shared secret is derived by both participants.
694 <div class="sect1" lang="en">
695 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
696 <a name="id2571709"></a>SIG(0)</h2></div></div></div>
698 <acronym class="acronym">BIND</acronym> 9 partially supports DNSSEC SIG(0)
699 transaction signatures as specified in RFC 2535 and RFC 2931.
701 uses public/private keys to authenticate messages. Access control
702 is performed in the same manner as TSIG keys; privileges can be
703 granted or denied based on the key name.
706 When a SIG(0) signed message is received, it will only be
707 verified if the key is known and trusted by the server; the server
708 will not attempt to locate and/or validate the key.
711 SIG(0) signing of multiple-message TCP streams is not
715 The only tool shipped with <acronym class="acronym">BIND</acronym> 9 that
716 generates SIG(0) signed messages is <span><strong class="command">nsupdate</strong></span>.
719 <div class="sect1" lang="en">
720 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
721 <a name="DNSSEC"></a>DNSSEC</h2></div></div></div>
723 Cryptographic authentication of DNS information is possible
724 through the DNS Security (<span class="emphasis"><em>DNSSEC-bis</em></span>) extensions,
725 defined in RFC 4033, RFC 4034, and RFC 4035.
726 This section describes the creation and use of DNSSEC signed zones.
729 In order to set up a DNSSEC secure zone, there are a series
730 of steps which must be followed. <acronym class="acronym">BIND</acronym>
733 that are used in this process, which are explained in more detail
734 below. In all cases, the <code class="option">-h</code> option prints a
735 full list of parameters. Note that the DNSSEC tools require the
736 keyset files to be in the working directory or the
737 directory specified by the <code class="option">-d</code> option, and
738 that the tools shipped with BIND 9.2.x and earlier are not compatible
739 with the current ones.
742 There must also be communication with the administrators of
743 the parent and/or child zone to transmit keys. A zone's security
744 status must be indicated by the parent zone for a DNSSEC capable
745 resolver to trust its data. This is done through the presence
746 or absence of a <code class="literal">DS</code> record at the
751 For other servers to trust data in this zone, they must
752 either be statically configured with this zone's zone key or the
753 zone key of another zone above this one in the DNS tree.
755 <div class="sect2" lang="en">
756 <div class="titlepage"><div><div><h3 class="title">
757 <a name="id2571778"></a>Generating Keys</h3></div></div></div>
759 The <span><strong class="command">dnssec-keygen</strong></span> program is used to
763 A secure zone must contain one or more zone keys. The
764 zone keys will sign all other records in the zone, as well as
765 the zone keys of any secure delegated zones. Zone keys must
766 have the same name as the zone, a name type of
767 <span><strong class="command">ZONE</strong></span>, and must be usable for
769 It is recommended that zone keys use a cryptographic algorithm
770 designated as "mandatory to implement" by the IETF; currently
771 the only one is RSASHA1.
774 The following command will generate a 768-bit RSASHA1 key for
775 the <code class="filename">child.example</code> zone:
778 <strong class="userinput"><code>dnssec-keygen -a RSASHA1 -b 768 -n ZONE child.example.</code></strong>
781 Two output files will be produced:
782 <code class="filename">Kchild.example.+005+12345.key</code> and
783 <code class="filename">Kchild.example.+005+12345.private</code>
785 12345 is an example of a key tag). The key filenames contain
786 the key name (<code class="filename">child.example.</code>),
788 is DSA, 1 is RSAMD5, 5 is RSASHA1, etc.), and the key tag (12345 in
790 The private key (in the <code class="filename">.private</code>
792 used to generate signatures, and the public key (in the
793 <code class="filename">.key</code> file) is used for signature
797 To generate another key with the same properties (but with
798 a different key tag), repeat the above command.
801 The <span><strong class="command">dnssec-keyfromlabel</strong></span> program is used
802 to get a key pair from a crypto hardware and build the key
803 files. Its usage is similar to <span><strong class="command">dnssec-keygen</strong></span>.
806 The public keys should be inserted into the zone file by
807 including the <code class="filename">.key</code> files using
808 <span><strong class="command">$INCLUDE</strong></span> statements.
811 <div class="sect2" lang="en">
812 <div class="titlepage"><div><div><h3 class="title">
813 <a name="id2571925"></a>Signing the Zone</h3></div></div></div>
815 The <span><strong class="command">dnssec-signzone</strong></span> program is used
819 Any <code class="filename">keyset</code> files corresponding to
820 secure subzones should be present. The zone signer will
821 generate <code class="literal">NSEC</code>, <code class="literal">NSEC3</code>
822 and <code class="literal">RRSIG</code> records for the zone, as
823 well as <code class="literal">DS</code> for the child zones if
824 <code class="literal">'-g'</code> is specified. If <code class="literal">'-g'</code>
825 is not specified, then DS RRsets for the secure child
826 zones need to be added manually.
829 The following command signs the zone, assuming it is in a
830 file called <code class="filename">zone.child.example</code>. By
831 default, all zone keys which have an available private key are
832 used to generate signatures.
835 <strong class="userinput"><code>dnssec-signzone -o child.example zone.child.example</code></strong>
838 One output file is produced:
839 <code class="filename">zone.child.example.signed</code>. This
841 should be referenced by <code class="filename">named.conf</code>
843 input file for the zone.
845 <p><span><strong class="command">dnssec-signzone</strong></span>
846 will also produce a keyset and dsset files and optionally a
847 dlvset file. These are used to provide the parent zone
848 administrators with the <code class="literal">DNSKEYs</code> (or their
849 corresponding <code class="literal">DS</code> records) that are the
850 secure entry point to the zone.
853 <div class="sect2" lang="en">
854 <div class="titlepage"><div><div><h3 class="title">
855 <a name="id2572006"></a>Configuring Servers</h3></div></div></div>
857 To enable <span><strong class="command">named</strong></span> to respond appropriately
858 to DNS requests from DNSSEC aware clients,
859 <span><strong class="command">dnssec-enable</strong></span> must be set to yes.
862 To enable <span><strong class="command">named</strong></span> to validate answers from
863 other servers both <span><strong class="command">dnssec-enable</strong></span> and
864 <span><strong class="command">dnssec-validation</strong></span> must be set and some
865 <span><strong class="command">trusted-keys</strong></span> must be configured
866 into <code class="filename">named.conf</code>.
869 <span><strong class="command">trusted-keys</strong></span> are copies of DNSKEY RRs
870 for zones that are used to form the first link in the
871 cryptographic chain of trust. All keys listed in
872 <span><strong class="command">trusted-keys</strong></span> (and corresponding zones)
873 are deemed to exist and only the listed keys will be used
874 to validated the DNSKEY RRset that they are from.
877 <span><strong class="command">trusted-keys</strong></span> are described in more detail
878 later in this document.
881 Unlike <acronym class="acronym">BIND</acronym> 8, <acronym class="acronym">BIND</acronym>
882 9 does not verify signatures on load, so zone keys for
883 authoritative zones do not need to be specified in the
887 After DNSSEC gets established, a typical DNSSEC configuration
888 will look something like the following. It has a one or
889 more public keys for the root. This allows answers from
890 outside the organization to be validated. It will also
891 have several keys for parts of the namespace the organization
892 controls. These are here to ensure that <span><strong class="command">named</strong></span> is immune
893 to compromises in the DNSSEC components of the security
896 <pre class="programlisting">
900 "." 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwSJxrGkxJWoZu6I7PzJu/
901 E9gx4UC1zGAHlXKdE4zYIpRhaBKnvcC2U9mZhkdUpd1Vso/HAdjNe8LmMlnzY3
902 zy2Xy4klWOADTPzSv9eamj8V18PHGjBLaVtYvk/ln5ZApjYghf+6fElrmLkdaz
903 MQ2OCnACR817DF4BBa7UR/beDHyp5iWTXWSi6XmoJLbG9Scqc7l70KDqlvXR3M
904 /lUUVRbkeg1IPJSidmK3ZyCllh4XSKbje/45SKucHgnwU5jefMtq66gKodQj+M
905 iA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ97S+LKUTpQcq27R7AT3/V5hRQxScI
906 Nqwcz4jYqZD2fQdgxbcDTClU0CRBdiieyLMNzXG3";
908 /* Key for our organization's forward zone */
909 example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM65KbhTjrW1ZaARmPhEZZe
910 3Y9ifgEuq7vZ/zGZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb4JKUbb
911 OTcM8pwXlj0EiX3oDFVmjHO444gLkBO UKUf/mC7HvfwYH/Be22GnC
912 lrinKJp1Og4ywzO9WglMk7jbfW33gUKvirTHr25GL7STQUzBb5Usxt
913 8lgnyTUHs1t3JwCY5hKZ6CqFxmAVZP20igTixin/1LcrgX/KMEGd/b
914 iuvF4qJCyduieHukuY3H4XMAcR+xia2 nIUPvm/oyWR8BW/hWdzOvn
915 SCThlHf3xiYleDbt/o1OTQ09A0=";
917 /* Key for our reverse zone. */
918 2.0.192.IN-ADDRPA.NET. 257 3 5 "AQOnS4xn/IgOUpBPJ3bogzwcxOdNax071L18QqZnQQQA
919 VVr+iLhGTnNGp3HoWQLUIzKrJVZ3zggy3WwNT6kZo6c0
920 tszYqbtvchmgQC8CzKojM/W16i6MG/ea fGU3siaOdS0
921 yOI6BgPsw+YZdzlYMaIJGf4M4dyoKIhzdZyQ2bYQrjyQ
922 4LB0lC7aOnsMyYKHHYeRv PxjIQXmdqgOJGq+vsevG06
923 zW+1xgYJh9rCIfnm1GX/KMgxLPG2vXTD/RnLX+D3T3UL
924 7HJYHJhAZD5L59VvjSPsZJHeDCUyWYrvPZesZDIRvhDD
925 52SKvbheeTJUm6EhkzytNN2SN96QRk8j/iI8ib";
931 dnssec-validation yes;
934 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
935 <h3 class="title">Note</h3>
936 None of the keys listed in this example are valid. In particular,
937 the root key is not valid.
941 <div class="sect1" lang="en">
942 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
943 <a name="id2572220"></a>IPv6 Support in <acronym class="acronym">BIND</acronym> 9</h2></div></div></div>
945 <acronym class="acronym">BIND</acronym> 9 fully supports all currently
946 defined forms of IPv6
947 name to address and address to name lookups. It will also use
948 IPv6 addresses to make queries when running on an IPv6 capable
952 For forward lookups, <acronym class="acronym">BIND</acronym> 9 supports
953 only AAAA records. RFC 3363 deprecated the use of A6 records,
954 and client-side support for A6 records was accordingly removed
955 from <acronym class="acronym">BIND</acronym> 9.
956 However, authoritative <acronym class="acronym">BIND</acronym> 9 name servers still
957 load zone files containing A6 records correctly, answer queries
958 for A6 records, and accept zone transfer for a zone containing A6
962 For IPv6 reverse lookups, <acronym class="acronym">BIND</acronym> 9 supports
963 the traditional "nibble" format used in the
964 <span class="emphasis"><em>ip6.arpa</em></span> domain, as well as the older, deprecated
965 <span class="emphasis"><em>ip6.int</em></span> domain.
966 Older versions of <acronym class="acronym">BIND</acronym> 9
967 supported the "binary label" (also known as "bitstring") format,
968 but support of binary labels has been completely removed per
970 Many applications in <acronym class="acronym">BIND</acronym> 9 do not understand
971 the binary label format at all any more, and will return an
973 In particular, an authoritative <acronym class="acronym">BIND</acronym> 9
974 name server will not load a zone file containing binary labels.
977 For an overview of the format and structure of IPv6 addresses,
978 see <a href="Bv9ARM.ch09.html#ipv6addresses" title="IPv6 addresses (AAAA)">the section called “IPv6 addresses (AAAA)”</a>.
980 <div class="sect2" lang="en">
981 <div class="titlepage"><div><div><h3 class="title">
982 <a name="id2572282"></a>Address Lookups Using AAAA Records</h3></div></div></div>
984 The IPv6 AAAA record is a parallel to the IPv4 A record,
985 and, unlike the deprecated A6 record, specifies the entire
986 IPv6 address in a single record. For example,
988 <pre class="programlisting">
990 host 3600 IN AAAA 2001:db8::1
993 Use of IPv4-in-IPv6 mapped addresses is not recommended.
994 If a host has an IPv4 address, use an A record, not
995 a AAAA, with <code class="literal">::ffff:192.168.42.1</code> as
999 <div class="sect2" lang="en">
1000 <div class="titlepage"><div><div><h3 class="title">
1001 <a name="id2572304"></a>Address to Name Lookups Using Nibble Format</h3></div></div></div>
1003 When looking up an address in nibble format, the address
1004 components are simply reversed, just as in IPv4, and
1005 <code class="literal">ip6.arpa.</code> is appended to the
1007 For example, the following would provide reverse name lookup for
1009 <code class="literal">2001:db8::1</code>.
1011 <pre class="programlisting">
1012 $ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
1013 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 14400 IN PTR host.example.com.
1018 <div class="navfooter">
1020 <table width="100%" summary="Navigation footer">
1022 <td width="40%" align="left">
1023 <a accesskey="p" href="Bv9ARM.ch03.html">Prev</a> </td>
1024 <td width="20%" align="center"> </td>
1025 <td width="40%" align="right"> <a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
1029 <td width="40%" align="left" valign="top">Chapter 3. Name Server Configuration </td>
1030 <td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
1031 <td width="40%" align="right" valign="top"> Chapter 5. The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</td>