Bv9ARM.ch04.html revision 5dde14e1704e22184ae81ca12a1d8335c014c965
6c2a76b3e2ccd32c35814b6e0f54da00190749d7Evan Hunt - Copyright (C) 2004-2015 Internet Systems Consortium, Inc. ("ISC")
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater - Copyright (C) 2000-2003 Internet Software Consortium.
c7fd128f8ea8a527fe27c1b95ab46df7155bc8e4Tinderbox User - Permission to use, copy, modify, and/or distribute this software for any
ba9e87b35e561bc7354ce3f4b9685b747b7be507Tinderbox User - purpose with or without fee is hereby granted, provided that the above
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews - copyright notice and this permission notice appear in all copies.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
0726d872f6f36901ea09321df57084614e5bb6faTinderbox User - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
a2c370ca12bb0360ff7e969474ead3f788c65fffTinderbox User - PERFORMANCE OF THIS SOFTWARE.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2b7254075b883d70852a2757210793603085a0f1Tinderbox User<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<link rel="home" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews<link rel="prev" href="Bv9ARM.ch03.html" title="Chapter�3.�Name Server Configuration">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<link rel="next" href="Bv9ARM.ch05.html" title="Chapter�5.�The BIND 9 Lightweight Resolver">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<table width="100%" summary="Navigation header">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<tr><th colspan="3" align="center">Chapter�4.�Advanced DNS Features</th></tr>
415d630b6309922caee8469384a6fab75cf05032Mark Andrews<a accesskey="p" href="Bv9ARM.ch03.html">Prev</a>�</td>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
415d630b6309922caee8469384a6fab75cf05032Mark Andrews<div class="titlepage"><div><div><h1 class="title">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a name="Bv9ARM.ch04"></a>Chapter�4.�Advanced DNS Features</h1></div></div></div>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#notify">Notify</a></span></dt>
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#dynamic_update">Dynamic Update</a></span></dt>
7fcb9dbe08bc0111c5e03e953ba889f86a38b854Tinderbox User<dd><dl><dt><span class="section"><a href="Bv9ARM.ch04.html#journal">The journal file</a></span></dt></dl></dd>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<dt><span class="section"><a href="Bv9ARM.ch04.html#incremental_zone_transfers">Incremental Zone Transfers (IXFR)</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#split_dns">Split DNS</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dd><dl><dt><span class="section"><a href="Bv9ARM.ch04.html#split_dns_sample">Example split DNS setup</a></span></dt></dl></dd>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<dt><span class="section"><a href="Bv9ARM.ch04.html#tsig">TSIG</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.5">Generating a Shared Key</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.6">Loading A New Key</a></span></dt>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.7">Instructing the Server to Use a Key</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.8">TSIG-Based Access Control</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.9">Errors</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#tkey">TKEY</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#sig0">SIG(0)</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#DNSSEC">DNSSEC</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec_keys">Generating Keys</a></span></dt>
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec_signing">Signing the Zone</a></span></dt>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec_config">Configuring Servers</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec.dynamic.zones">DNSSEC, Dynamic Zones, and Automatic Signing</a></span></dt>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.3">Converting from insecure to secure</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.8">Dynamic DNS update method</a></span></dt>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.16">Fully automatic zone signing</a></span></dt>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.25">Private-type records</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.32">DNSKEY rollovers</a></span></dt>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.34">Dynamic DNS update method</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.39">Automatic key rollovers</a></span></dt>
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.41">NSEC3PARAM rollovers via UPDATE</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.43">Converting from NSEC to NSEC3</a></span></dt>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.45">Converting from NSEC3 to NSEC</a></span></dt>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.47">Converting from secure to insecure</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.51">Periodic re-signing</a></span></dt>
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.53">NSEC3 and OPTOUT</a></span></dt>
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#rfc5011.support">Dynamic Trust Anchor Management</a></span></dt>
ebe53509ca55a141131c104b6d722236b606e0efTinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.11.3">Validating Resolver</a></span></dt>
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.11.4">Authoritative Server</a></span></dt>
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt<dt><span class="section"><a href="Bv9ARM.ch04.html#pkcs11">PKCS#11 (Cryptoki) support</a></span></dt>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.6">Prerequisites</a></span></dt>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.7">Native PKCS#11</a></span></dt>
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.8">OpenSSL-based PKCS#11</a></span></dt>
7cc0a5d21ef046bfd630c4769943d896a7d7472cTinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.9">PKCS#11 Tools</a></span></dt>
3ccf87473f7cf6d9faac156df38a935a238f96fdTinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.10">Using the HSM</a></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.11">Specifying the engine on the command line</a></span></dt>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.12">Running named with automatic zone re-signing</a></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#dlz-info">DLZ (Dynamically Loadable Zones)</a></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.13.6">Configuring DLZ</a></span></dt>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.13.7">Sample DLZ Driver</a></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#dyndb-info">DynDB (Dynamic Database)</a></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.14.5">Configuring DynDB</a></span></dt>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.14.6">Sample DynDB Module</a></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#catz-info">Catalog Zones</a></span></dt>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.15.4">Principle of Operation</a></span></dt>
415d630b6309922caee8469384a6fab75cf05032Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.15.5">Configuring Catalog Zones</a></span></dt>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.15.6">Catalog Zone format</a></span></dt>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#ipv6">IPv6 Support in <acronym class="acronym">BIND</acronym> 9</a></span></dt>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.16.6">Address Lookups Using AAAA Records</a></span></dt>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.16.7">Address to Name Lookups Using Nibble Format</a></span></dt>
415d630b6309922caee8469384a6fab75cf05032Mark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<a name="notify"></a>Notify</h2></div></div></div>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <acronym class="acronym">DNS</acronym> NOTIFY is a mechanism that allows master
415d630b6309922caee8469384a6fab75cf05032Mark Andrews servers to notify their slave servers of changes to a zone's data. In
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson response to a <span class="command"><strong>NOTIFY</strong></span> from a master server, the
415d630b6309922caee8469384a6fab75cf05032Mark Andrews slave will check to see that its version of the zone is the
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews current version and, if not, initiate a zone transfer.
28a5dd720187fddb16055a0f64b63a7b66f29f64Mark Andrews For more information about <acronym class="acronym">DNS</acronym>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>NOTIFY</strong></span>, see the description of the
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <span class="command"><strong>notify</strong></span> option in <a class="xref" href="Bv9ARM.ch06.html#boolean_options" title="Boolean Options">the section called “Boolean Options”</a> and
ebe53509ca55a141131c104b6d722236b606e0efTinderbox User the description of the zone option <span class="command"><strong>also-notify</strong></span> in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <a class="xref" href="Bv9ARM.ch06.html#zone_transfers" title="Zone Transfers">the section called “Zone Transfers”</a>. The <span class="command"><strong>NOTIFY</strong></span>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews protocol is specified in RFC 1996.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont As a slave zone can also be a master to other slaves, <span class="command"><strong>named</strong></span>,
51aeb0ae19596e99b029cfa933e73b76ebec480aTinderbox User by default, sends <span class="command"><strong>NOTIFY</strong></span> messages for every zone
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews it loads. Specifying <span class="command"><strong>notify master-only;</strong></span> will
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont cause <span class="command"><strong>named</strong></span> to only send <span class="command"><strong>NOTIFY</strong></span> for master
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews zones that it loads.
33b0d10552ea5f7716385b2cedff64daa1486c50Tinderbox User<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="dynamic_update"></a>Dynamic Update</h2></div></div></div>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews Dynamic Update is a method for adding, replacing or deleting
33b0d10552ea5f7716385b2cedff64daa1486c50Tinderbox User records in a master server by sending it a special form of DNS
b378314925e78f21853a98cec924788ce1822c6cTinderbox User messages. The format and meaning of these messages is specified
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews in RFC 2136.
66317da170ed35b08f5847db2d48b225826327cbTinderbox User Dynamic update is enabled by including an
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <span class="command"><strong>allow-update</strong></span> or an <span class="command"><strong>update-policy</strong></span>
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews clause in the <span class="command"><strong>zone</strong></span> statement.
01a5c5503482fb3ba52088bf0178a7213273bf96Mark Andrews If the zone's <span class="command"><strong>update-policy</strong></span> is set to
2b7254075b883d70852a2757210793603085a0f1Tinderbox User <strong class="userinput"><code>local</code></strong>, updates to the zone
33b0d10552ea5f7716385b2cedff64daa1486c50Tinderbox User will be permitted for the key <code class="varname">local-ddns</code>,
415d630b6309922caee8469384a6fab75cf05032Mark Andrews which will be generated by <span class="command"><strong>named</strong></span> at startup.
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater See <a class="xref" href="Bv9ARM.ch06.html#dynamic_update_policies" title="Dynamic Update Policies">the section called “Dynamic Update Policies”</a> for more details.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews Dynamic updates using Kerberos signed requests can be made
415d630b6309922caee8469384a6fab75cf05032Mark Andrews using the TKEY/GSS protocol by setting either the
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater <span class="command"><strong>tkey-gssapi-keytab</strong></span> option, or alternatively
415d630b6309922caee8469384a6fab75cf05032Mark Andrews by setting both the <span class="command"><strong>tkey-gssapi-credential</strong></span>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews and <span class="command"><strong>tkey-domain</strong></span> options. Once enabled,
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Kerberos signed requests will be matched against the update
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews policies for the zone, using the Kerberos principal as the
415d630b6309922caee8469384a6fab75cf05032Mark Andrews signer for the request.
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews Updating of secure zones (zones using DNSSEC) follows RFC
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User 3007: RRSIG, NSEC and NSEC3 records affected by updates are
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews automatically regenerated by the server using an online
415d630b6309922caee8469384a6fab75cf05032Mark Andrews zone key. Update authorization is based on transaction
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater signatures and an explicit server policy.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<div class="titlepage"><div><div><h3 class="title">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a name="journal"></a>The journal file</h3></div></div></div>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson All changes made to a zone using dynamic update are stored
415d630b6309922caee8469384a6fab75cf05032Mark Andrews in the zone's journal file. This file is automatically created
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews by the server when the first dynamic update takes place.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User The name of the journal file is formed by appending the extension
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <code class="filename">.jnl</code> to the name of the
415d630b6309922caee8469384a6fab75cf05032Mark Andrews corresponding zone
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater file unless specifically overridden. The journal file is in a
415d630b6309922caee8469384a6fab75cf05032Mark Andrews binary format and should not be edited manually.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews The server will also occasionally write ("dump")
415d630b6309922caee8469384a6fab75cf05032Mark Andrews the complete contents of the updated zone to its zone file.
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater This is not done immediately after
415d630b6309922caee8469384a6fab75cf05032Mark Andrews each dynamic update, because that would be too slow when a large
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews zone is updated frequently. Instead, the dump is delayed by
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User up to 15 minutes, allowing additional updates to take place.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews During the dump process, transient files will be created
415d630b6309922caee8469384a6fab75cf05032Mark Andrews with the extensions <code class="filename">.jnw</code> and
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson <code class="filename">.jbk</code>; under ordinary circumstances, these
415d630b6309922caee8469384a6fab75cf05032Mark Andrews will be removed when the dump is complete, and can be safely
415d630b6309922caee8469384a6fab75cf05032Mark Andrews When a server is restarted after a shutdown or crash, it will replay
5f7586ddbd3edd11272cdd30ed613d936129328bTinderbox User the journal file to incorporate into the zone any updates that
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews place after the last zone dump.
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User Changes that result from incoming incremental zone transfers are
5affecff6e148a8e124d03f5dbac0da11e30dcc5Tinderbox User journalled in a similar way.
dc7e5458bbcb59ea310ed64ac7e77016e62e9c15Tinderbox User The zone files of dynamic zones cannot normally be edited by
5b3dd19d815f0389d566d20c2fee57cb37d1dd47Tinderbox User hand because they are not guaranteed to contain the most recent
1fce11b1d3f2d461d261156b8cdc64ab864f06a9Tinderbox User dynamic changes — those are only in the journal file.
fab54780409846f7c71f6026d665f18c77c649efTinderbox User The only way to ensure that the zone file of a dynamic zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is up to date is to run <span class="command"><strong>rndc stop</strong></span>.
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User If you have to make changes to a dynamic zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews manually, the following procedure will work:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Disable dynamic updates to the zone using
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User <span class="command"><strong>rndc freeze <em class="replaceable"><code>zone</code></em></strong></span>.
6c2a76b3e2ccd32c35814b6e0f54da00190749d7Evan Hunt This will update the zone's master file with the changes
8927a982bde7e4b665966b55f0fa57c5cf21b9d8Mark Andrews stored in its <code class="filename">.jnl</code> file.
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User Edit the zone file. Run
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>rndc thaw <em class="replaceable"><code>zone</code></em></strong></span>
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User to reload the changed zone and re-enable dynamic updates.
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User <span class="command"><strong>rndc sync <em class="replaceable"><code>zone</code></em></strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will update the zone file with changes from the journal file
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews without stopping dynamic updates; this may be useful for viewing
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the current zone state. To remove the <code class="filename">.jnl</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews file after updating the zone file, use
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>rndc sync -clean</strong></span>.
c317b09bf112121245fafe61f38b95dc6e96acabTinderbox User<div class="titlepage"><div><div><h2 class="title" style="clear: both">
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User<a name="incremental_zone_transfers"></a>Incremental Zone Transfers (IXFR)</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The incremental zone transfer (IXFR) protocol is a way for
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews slave servers to transfer only changed data, instead of having to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews transfer the entire zone. The IXFR protocol is specified in RFC
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 1995. See <a class="xref" href="Bv9ARM.ch11.html#proposed_standards" title="Proposed Standards">Proposed Standards</a>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When acting as a master, <acronym class="acronym">BIND</acronym> 9
8ac5ddf659a81ed668579818981fc1a5f28405d1Tinderbox User supports IXFR for those zones
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews where the necessary change history information is available. These
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User include master zones maintained by dynamic update and slave zones
1ef84760d1d9c2f4610c3f9c777267388971ae80Tinderbox User whose data was obtained by IXFR. For manually maintained master
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zones, and for slave zones obtained by performing a full zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews transfer (AXFR), IXFR is supported only if the option
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>ixfr-from-differences</strong></span> is set
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to <strong class="userinput"><code>yes</code></strong>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When acting as a slave, <acronym class="acronym">BIND</acronym> 9 will
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews attempt to use IXFR unless
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews it is explicitly disabled. For more information about disabling
e5c7ef08d1bf9f8388de8174a47da78b9eeb7e5cTinderbox User IXFR, see the description of the <span class="command"><strong>request-ixfr</strong></span> clause
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews of the <span class="command"><strong>server</strong></span> statement.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews<a name="split_dns"></a>Split DNS</h2></div></div></div>
e5c7ef08d1bf9f8388de8174a47da78b9eeb7e5cTinderbox User Setting up different views, or visibility, of the DNS space to
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews internal and external resolvers is usually referred to as a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="emphasis"><em>Split DNS</em></span> setup. There are several
2ca9cf1582ae972f8edc2b03bd846973b05dee6bTinderbox User reasons an organization would want to set up its DNS this way.
33b0d10552ea5f7716385b2cedff64daa1486c50Tinderbox User One common reason for setting up a DNS system this way is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to hide "internal" DNS information from "external" clients on the
1ef84760d1d9c2f4610c3f9c777267388971ae80Tinderbox User Internet. There is some debate as to whether or not this is actually
c4d2e7c8c8fe06009165275bee0703b0ef85e19fTinderbox User Internal DNS information leaks out in many ways (via email headers,
076e51f1ff9497ae61a99994189ed8bf5a0d3472Tinderbox User for example) and most savvy "attackers" can find the information
076e51f1ff9497ae61a99994189ed8bf5a0d3472Tinderbox User they need using other means.
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User However, since listing addresses of internal servers that
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews external clients cannot possibly reach can result in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews connection delays and other annoyances, an organization may
076e51f1ff9497ae61a99994189ed8bf5a0d3472Tinderbox User choose to use a Split DNS to present a consistent view of itself
5affecff6e148a8e124d03f5dbac0da11e30dcc5Tinderbox User to the outside world.
5affecff6e148a8e124d03f5dbac0da11e30dcc5Tinderbox User Another common reason for setting up a Split DNS system is
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User to allow internal networks that are behind filters or in RFC 1918
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews space (reserved IP space, as documented in RFC 1918) to resolve DNS
8ac5ddf659a81ed668579818981fc1a5f28405d1Tinderbox User on the Internet. Split DNS can also be used to allow mail from outside
076e51f1ff9497ae61a99994189ed8bf5a0d3472Tinderbox User back in to the internal network.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<div class="titlepage"><div><div><h3 class="title">
3ccf87473f7cf6d9faac156df38a935a238f96fdTinderbox User<a name="split_dns_sample"></a>Example split DNS setup</h3></div></div></div>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Let's say a company named <span class="emphasis"><em>Example, Inc.</em></span>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews has several corporate sites that have an internal network with
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson Internet Protocol (IP) space and an external demilitarized zone (DMZ),
415d630b6309922caee8469384a6fab75cf05032Mark Andrews or "outside" section of a network, that is available to the public.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <span class="emphasis"><em>Example, Inc.</em></span> wants its internal clients
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User to be able to resolve external hostnames and to exchange mail with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews people on the outside. The company also wants its internal resolvers
8292deab031e7599cd7622aa7675fbe139ca6095Mark Andrews to have access to certain internal-only zones that are not available
c1e2310a3725eeed45e5e7c86750c64c5a02e993Francis Dupont at all outside of the internal network.
4b61b671f5de767ec1d1b8e6cf7b849bddf08e98Tinderbox User In order to accomplish this, the company will set up two sets
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews of name servers. One set will be on the inside network (in the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews IP space) and the other set will be on bastion hosts, which are
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews hosts that can talk to both sides of its network, in the DMZ.
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews The internal servers will be configured to forward all queries,
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews except queries for <code class="filename">site1.internal</code>, <code class="filename">site2.internal</code>, <code class="filename">site1.example.com</code>,
f1a2709aad7baa4161fdb6f63edf99b0150af252Evan Hunt and <code class="filename">site2.example.com</code>, to the servers
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews DMZ. These internal servers will have complete sets of information
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews for <code class="filename">site1.example.com</code>, <code class="filename">site2.example.com</code>, <code class="filename">site1.internal</code>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and <code class="filename">site2.internal</code>.
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews To protect the <code class="filename">site1.internal</code> and <code class="filename">site2.internal</code> domains,
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater the internal name servers must be configured to disallow all queries
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews to these domains from any external hosts, including the bastion
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews The external servers, which are on the bastion hosts, will
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater be configured to serve the "public" version of the <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones.
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews This could include things such as the host records for public servers
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews (<code class="filename">www.example.com</code> and <code class="filename">ftp.example.com</code>),
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User and mail exchange (MX) records (<code class="filename">a.mx.example.com</code> and <code class="filename">b.mx.example.com</code>).
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater In addition, the public <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews should have special MX records that contain wildcard (`*') records
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews pointing to the bastion hosts. This is needed because external mail
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User servers do not have any other way of looking up how to deliver mail
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews to those internal hosts. With the wildcard records, the mail will
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews be delivered to the bastion host, which can then forward it on to
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews internal hosts.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Here's an example of a wildcard MX record:
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews<pre class="programlisting">* IN MX 10 external1.example.com.</pre>
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews Now that they accept mail on behalf of anything in the internal
3fb635d1c5fad0b7380b8195750dc1057bb1abd6Tinderbox User network, the bastion hosts will need to know how to deliver mail
01a5c5503482fb3ba52088bf0178a7213273bf96Mark Andrews to internal hosts. In order for this to work properly, the resolvers
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews the bastion hosts will need to be configured to point to the internal
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews name servers for DNS resolution.
3bd8b5a8fb126e45c67ff53b68183c889cc27918Tinderbox User Queries for internal hostnames will be answered by the internal
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews servers, and queries for external hostnames will be forwarded back
3bd8b5a8fb126e45c67ff53b68183c889cc27918Tinderbox User out to the DNS servers on the bastion hosts.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews In order for all this to work properly, internal clients will
4840ef4581a577a29a18d180b6bc2e7355378ed7Mark Andrews need to be configured to query <span class="emphasis"><em>only</em></span> the internal
4840ef4581a577a29a18d180b6bc2e7355378ed7Mark Andrews name servers for DNS queries. This could also be enforced via
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews filtering on the network.
4840ef4581a577a29a18d180b6bc2e7355378ed7Mark Andrews If everything has been set properly, <span class="emphasis"><em>Example, Inc.</em></span>'s
4840ef4581a577a29a18d180b6bc2e7355378ed7Mark Andrews internal clients will now be able to:
4840ef4581a577a29a18d180b6bc2e7355378ed7Mark Andrews<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
4840ef4581a577a29a18d180b6bc2e7355378ed7Mark Andrews Look up any hostnames in the <code class="literal">site1</code>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews <code class="literal">site2.example.com</code> zones.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews Look up any hostnames in the <code class="literal">site1.internal</code> and
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews <code class="literal">site2.internal</code> domains.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews<li class="listitem">Look up any hostnames on the Internet.</li>
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews<li class="listitem">Exchange mail with both internal and external people.</li>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews Hosts on the Internet will be able to:
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Look up any hostnames in the <code class="literal">site1</code>
aea84ccf3998d55a6510ba8eef63183dfc7eeefbTinderbox User <code class="literal">site2.example.com</code> zones.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Exchange mail with anyone in the <code class="literal">site1</code> and
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <code class="literal">site2.example.com</code> zones.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Here is an example configuration for the setup we just
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews described above. Note that this is only configuration information;
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson for information on how to configure your zone files, see <a class="xref" href="Bv9ARM.ch03.html#sample_configuration" title="Sample Configurations">the section called “Sample Configurations”</a>.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Internal DNS server config:
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrewsacl internals { 172.16.72.0/24; 192.168.1.0/24; };
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsacl externals { <code class="varname">bastion-ips-go-here</code>; };
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews forward only;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews // forward to external servers
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <code class="varname">bastion-ips-go-here</code>;
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews // sample allow-transfer (no one)
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews allow-transfer { none; };
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User // restrict query access
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews allow-query { internals; externals; };
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews // restrict recursion
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews allow-recursion { internals; };
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews// sample master zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews type master;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews // do normal iterative resolution (do not forward)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews forwarders { };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-query { internals; externals; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-transfer { internals; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington// sample slave zone
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington masters { 172.16.72.3; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington forwarders { };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-query { internals; externals; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-transfer { internals; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington forwarders { };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-query { internals; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-transfer { internals; }
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington masters { 172.16.72.3; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington forwarders { };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-query { internals };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-transfer { internals; }
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington External (bastion host) DNS server config:
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonacl internals { 172.16.72.0/24; 192.168.1.0/24; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonacl externals { bastion-ips-go-here; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington // sample allow-transfer (no one)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-transfer { none; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington // default query access
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-query { any; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington // restrict cache access
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-query-cache { internals; externals; };
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington // restrict recursion
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington allow-recursion { internals; externals; };
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews// sample slave zone
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews type master;
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater allow-transfer { internals; externals; };
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews masters { another_bastion_host_maybe; };
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater allow-transfer { internals; externals; }
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater In the <code class="filename">resolv.conf</code> (or equivalent) on
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater the bastion host(s):
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox Usernameserver 172.16.72.2
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox Usernameserver 172.16.72.3
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox Usernameserver 172.16.72.4
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User<div class="titlepage"><div><div><h2 class="title" style="clear: both">
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User<a name="tsig"></a>TSIG</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews TSIG (Transaction SIGnatures) is a mechanism for authenticating DNS
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User messages, originally specified in RFC 2845. It allows DNS messages
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to be cryptographically signed using a shared secret. TSIG can
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews be used in any DNS transaction, as a way to restrict access to
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User certain server functions (e.g., recursive queries) to authorized
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User clients when IP-based access control is insufficient or needs to
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User be overridden, or as a way to ensure message authenticity when it
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User is critical to the integrity of the server, such as with dynamic
2b7254075b883d70852a2757210793603085a0f1Tinderbox User UPDATE messages or zone transfers from a master to a slave server.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews This is a guide to setting up TSIG in <acronym class="acronym">BIND</acronym>.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews It describes the configuration syntax and the process of creating
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span> supports TSIG for server-to-server
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews communication, and some of the tools included with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <acronym class="acronym">BIND</acronym> support it for sending messages to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span>:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a class="xref" href="man.nsupdate.html" title="nsupdate"><span class="refentrytitle"><span class="application">nsupdate</span></span>(1)</a> supports TSIG via the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="option">-k</code>, <code class="option">-l</code> and
415d630b6309922caee8469384a6fab75cf05032Mark Andrews <code class="option">-y</code> command line options, or via
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews the <span class="command"><strong>key</strong></span> command when running
415d630b6309922caee8469384a6fab75cf05032Mark Andrews interactively.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a class="xref" href="man.dig.html" title="dig"><span class="refentrytitle">dig</span>(1)</a> supports TSIG via the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="option">-k</code> and <code class="option">-y</code> command
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews line options.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
51aeb0ae19596e99b029cfa933e73b76ebec480aTinderbox User<a name="id-1.5.6.5"></a>Generating a Shared Key</h3></div></div></div>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington TSIG keys can be generated using the <span class="command"><strong>tsig-keygen</strong></span>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington command; the output of the command is a <span class="command"><strong>key</strong></span> directive
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington suitable for inclusion in <code class="filename">named.conf</code>. The
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington key name, algorithm and size can be specified by command line parameters;
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington the defaults are "tsig-key", HMAC-SHA256, and 256 bits, respectively.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington Any string which is a valid DNS name can be used as a key name.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington For example, a key to be shared between servers called
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host2</em></span> could
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington be called "host1-host2.", and this key could be generated using:
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $ tsig-keygen host1-host2. > host1-host2.key
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington This key may then be copied to both hosts. The key name and secret
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington must be identical on both hosts.
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews (Note: copying a shared secret from one server to another is beyond
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews the scope of the DNS. A secure transport mechanism should be used:
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington secure FTP, SSL, ssh, telephone, encrypted email, etc.)
415d630b6309922caee8469384a6fab75cf05032Mark Andrews <span class="command"><strong>tsig-keygen</strong></span> can also be run as
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <span class="command"><strong>ddns-confgen</strong></span>, in which case its output includes
415d630b6309922caee8469384a6fab75cf05032Mark Andrews additional configuration text for setting up dynamic DNS in
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews <span class="command"><strong>named</strong></span>. See <a class="xref" href="man.ddns-confgen.html" title="ddns-confgen"><span class="refentrytitle"><span class="application">ddns-confgen</span></span>(8)</a>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a name="id-1.5.6.6"></a>Loading A New Key</h3></div></div></div>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews For a key shared between servers called
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host2</em></span>,
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User the following could be added to each server's
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewskey "host1-host2." {
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews algorithm hmac-sha256;
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington secret "DAopyf1mhCbFVZw7pgmNPBoLUq8wEUT7UuPoLENP2HY=";
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington (This is the same key generated above using
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington <span class="command"><strong>tsig-keygen</strong></span>.)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington Since this text contains a secret, it
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington is recommended that either <code class="filename">named.conf</code> not be
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington world-readable, or that the <span class="command"><strong>key</strong></span> directive
b7aab05edae933e169d5f83c653935b17c7f0a8bMark Andrews be stored in a file which is not world-readable, and which is
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington included in <code class="filename">named.conf</code> via the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington <span class="command"><strong>include</strong></span> directive.
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews Once a key has been added to <code class="filename">named.conf</code> and the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington server has been restarted or reconfigured, the server can recognize
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington the key. If the server receives a message signed by the
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews key, it will be able to verify the signature. If the signature
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington is valid, the response will be signed using the same key.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews TSIG keys that are known to a server can be listed using the
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews command <span class="command"><strong>rndc tsig-list</strong></span>.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<div class="titlepage"><div><div><h3 class="title">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a name="id-1.5.6.7"></a>Instructing the Server to Use a Key</h3></div></div></div>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington A server sending a request to another server must be told whether
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington to use a key, and if so, which key to use.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington For example, a key may be specified for each server in the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington <span class="command"><strong>masters</strong></span> statement in the definition of a
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington slave zone; in this case, all SOA QUERY messages, NOTIFY
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington messages, and zone transfer requests (AXFR or IXFR) will be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews signed using the specified key. Keys may also be specified
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews in the <span class="command"><strong>also-notify</strong></span> statement of a master
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews or slave zone, causing NOTIFY messages to be signed using
5835beb229e17d583fb4b6fd4246bd014a68ddf6Tinderbox User the specified key.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Keys can also be specified in a <span class="command"><strong>server</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews directive. Adding the following on <span class="emphasis"><em>host1</em></span>,
3fb635d1c5fad0b7380b8195750dc1057bb1abd6Tinderbox User if the IP address of <span class="emphasis"><em>host2</em></span> is 10.1.2.3, would
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User cause <span class="emphasis"><em>all</em></span> requests from <span class="emphasis"><em>host1</em></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to <span class="emphasis"><em>host2</em></span>, including normal DNS queries, to be
77997fab4b6b2d2c36ec66ace387447e8bc5c18eMark Andrews signed using the <span class="command"><strong>host1-host2.</strong></span> key:
872e1437295dce8162ac7374317d593320ac2dd6Tinderbox Userserver 10.1.2.3 {
872e1437295dce8162ac7374317d593320ac2dd6Tinderbox User keys { host1-host2. ;};
872e1437295dce8162ac7374317d593320ac2dd6Tinderbox User Multiple keys may be present in the <span class="command"><strong>keys</strong></span>
872e1437295dce8162ac7374317d593320ac2dd6Tinderbox User statement, but only the first one is used. As this directive does
872e1437295dce8162ac7374317d593320ac2dd6Tinderbox User not contain secrets, it can be used in a world-readable file.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Requests sent by <span class="emphasis"><em>host2</em></span> to <span class="emphasis"><em>host1</em></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews would <span class="emphasis"><em>not</em></span> be signed, unless a similar
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>server</strong></span> directive were in <span class="emphasis"><em>host2</em></span>'s
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews configuration file.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington Whenever any server sends a TSIG-signed DNS request, it will expect
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews the response to be signed with the same key. If a response is not
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington signed, or if the signature is not valid, the response will be
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews<div class="titlepage"><div><div><h3 class="title">
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<a name="id-1.5.6.8"></a>TSIG-Based Access Control</h3></div></div></div>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington TSIG keys may be specified in ACL definitions and ACL directives
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington such as <span class="command"><strong>allow-query</strong></span>, <span class="command"><strong>allow-transfer</strong></span>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington and <span class="command"><strong>allow-update</strong></span>.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington The above key would be denoted in an ACL element as
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington <span class="command"><strong>key host1-host2.</strong></span>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington An example of an <span class="command"><strong>allow-update</strong></span> directive using
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsallow-update { !{ !localnets; any; }; key host1-host2. ;};
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews This allows dynamic updates to succeed only if the UPDATE
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User request comes from an address in <span class="command"><strong>localnets</strong></span>,
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <span class="emphasis"><em>and</em></span> if it is signed using the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>host1-host2.</strong></span> key.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews See <a class="xref" href="Bv9ARM.ch06.html#dynamic_update_policies" title="Dynamic Update Policies">the section called “Dynamic Update Policies”</a> for a discussion of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the more flexible <span class="command"><strong>update-policy</strong></span> statement.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews<div class="titlepage"><div><div><h3 class="title">
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<a name="id-1.5.6.9"></a>Errors</h3></div></div></div>
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews Processing of TSIG-signed messages can result in several errors:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If a TSIG-aware server receives a message signed by an
2b7254075b883d70852a2757210793603085a0f1Tinderbox User unknown key, the response will be unsigned, with the TSIG
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews extended error code set to BADKEY.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews If a TSIG-aware server receives a message from a known key
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews but with an invalid signature, the response will be unsigned,
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews with the TSIG extended error code set to BADSIG.
1fdd58445074579ee3b65c871137a7a1740eb542Mark Andrews If a TSIG-aware server receives a message with a time
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews outside of the allowed range, the response will be signed, with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the TSIG extended error code set to BADTIME, and the time values
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will be adjusted so that the response can be successfully
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In all of the above cases, the server will return a response code
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews of NOTAUTH (not authenticated).
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews TKEY (Transaction KEY) is a mechanism for automatically negotiating
01d58b1620a17eb49f16f31049ee099bfa6a84b8Tinderbox User a shared secret between two hosts, originally specified in RFC 2930.
01d58b1620a17eb49f16f31049ee099bfa6a84b8Tinderbox User There are several TKEY "modes" that specify how a key is to be
01d58b1620a17eb49f16f31049ee099bfa6a84b8Tinderbox User generated or assigned. <acronym class="acronym">BIND</acronym> 9 implements only
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews one of these modes: Diffie-Hellman key exchange. Both hosts are
01d58b1620a17eb49f16f31049ee099bfa6a84b8Tinderbox User required to have a KEY record with algorithm DH (though this
f48877f10cfccd0cdbb7aa5f832fbafcf60ce1daTinderbox User record is not required to be present in a zone).
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The TKEY process is initiated by a client or server by sending
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews a query of type TKEY to a TKEY-aware server. The query must include
34d1f3b65324f8fcf358fa2f47891441d4b1d2f0Tinderbox User an appropriate KEY record in the additional section, and
dde130e859339194eebd7184eaf440981838a7f0Mark Andrews must be signed using either TSIG or SIG(0) with a previously
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews established key. The server's response, if successful, will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews contain a TKEY record in its answer section. After this transaction,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews both participants will have enough information to calculate a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews shared secret using Diffie-Hellman key exchange. The shared secret
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews can then be used by to sign subsequent transactions between the
dde130e859339194eebd7184eaf440981838a7f0Mark Andrews two servers.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews TSIG keys known by the server, including TKEY-negotiated keys, can
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User be listed using <span class="command"><strong>rndc tsig-list</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews TKEY-negotiated keys can be deleted from a server using
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>rndc tsig-delete</strong></span>. This can also be done via
e8c17c74535be290abaaa160a434ed80bf0ad2feMark Andrews the TKEY protocol itself, by sending an authenticated TKEY query
bf19cffa72b8335c632232c497b64574f44d1176Tinderbox User specifying the "key deletion" mode.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="sig0"></a>SIG(0)</h2></div></div></div>
c4d2e7c8c8fe06009165275bee0703b0ef85e19fTinderbox User <acronym class="acronym">BIND</acronym> partially supports DNSSEC SIG(0)
c4d2e7c8c8fe06009165275bee0703b0ef85e19fTinderbox User transaction signatures as specified in RFC 2535 and RFC 2931.
c4d2e7c8c8fe06009165275bee0703b0ef85e19fTinderbox User SIG(0) uses public/private keys to authenticate messages. Access control
662620c15ce856d8242e295228c54d1e0546d8c4Tinderbox User is performed in the same manner as TSIG keys; privileges can be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews granted or denied in ACL directives based on the key name.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When a SIG(0) signed message is received, it will only be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews verified if the key is known and trusted by the server. The
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews server will not attempt to recursively fetch or validate the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews SIG(0) signing of multiple-message TCP streams is not supported.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The only tool shipped with <acronym class="acronym">BIND</acronym> 9 that
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews generates SIG(0) signed messages is <span class="command"><strong>nsupdate</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="DNSSEC"></a>DNSSEC</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Cryptographic authentication of DNS information is possible
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews through the DNS Security (<span class="emphasis"><em>DNSSEC-bis</em></span>) extensions,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews defined in RFC 4033, RFC 4034, and RFC 4035.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This section describes the creation and use of DNSSEC signed zones.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In order to set up a DNSSEC secure zone, there are a series
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews of steps which must be followed. <acronym class="acronym">BIND</acronym>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews with several tools
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that are used in this process, which are explained in more detail
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews below. In all cases, the <code class="option">-h</code> option prints a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews full list of parameters. Note that the DNSSEC tools require the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews keyset files to be in the working directory or the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews directory specified by the <code class="option">-d</code> option, and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that the tools shipped with BIND 9.2.x and earlier are not compatible
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews with the current ones.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews There must also be communication with the administrators of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the parent and/or child zone to transmit keys. A zone's security
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews status must be indicated by the parent zone for a DNSSEC capable
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews resolver to trust its data. This is done through the presence
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews or absence of a <code class="literal">DS</code> record at the
f39894c0b1cafb24035c14c74868e48be25f04a5Mark Andrews For other servers to trust data in this zone, they must
7f9e2fff07b9c17e0d7a0ea7abc9304ce9d01b61Tinderbox User either be statically configured with this zone's zone key or the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone key of another zone above this one in the DNS tree.
bf8c3776f1bf1a1270e5e0443ae5a8df022632a8Mark Andrews<div class="titlepage"><div><div><h3 class="title">
bf8c3776f1bf1a1270e5e0443ae5a8df022632a8Mark Andrews<a name="dnssec_keys"></a>Generating Keys</h3></div></div></div>
bf8c3776f1bf1a1270e5e0443ae5a8df022632a8Mark Andrews The <span class="command"><strong>dnssec-keygen</strong></span> program is used to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews generate keys.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews A secure zone must contain one or more zone keys. The
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone keys will sign all other records in the zone, as well as
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the zone keys of any secure delegated zones. Zone keys must
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews have the same name as the zone, a name type of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>ZONE</strong></span>, and must be usable for
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews authentication.
ec8755f605d7dcb2de1076040e77bc2d7ec33b4aTinderbox User It is recommended that zone keys use a cryptographic algorithm
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews designated as "mandatory to implement" by the IETF; currently
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the only one is RSASHA1.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The following command will generate a 768-bit RSASHA1 key for
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the <code class="filename">child.example</code> zone:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <strong class="userinput"><code>dnssec-keygen -a RSASHA1 -b 768 -n ZONE child.example.</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Two output files will be produced:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">Kchild.example.+005+12345.key</code> and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">Kchild.example.+005+12345.private</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 12345 is an example of a key tag). The key filenames contain
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the key name (<code class="filename">child.example.</code>),
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews algorithm (3
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is DSA, 1 is RSAMD5, 5 is RSASHA1, etc.), and the key tag (12345 in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The private key (in the <code class="filename">.private</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews used to generate signatures, and the public key (in the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">.key</code> file) is used for signature
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews verification.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To generate another key with the same properties (but with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews a different key tag), repeat the above command.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <span class="command"><strong>dnssec-keyfromlabel</strong></span> program is used
7f9e2fff07b9c17e0d7a0ea7abc9304ce9d01b61Tinderbox User to get a key pair from a crypto hardware and build the key
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews files. Its usage is similar to <span class="command"><strong>dnssec-keygen</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The public keys should be inserted into the zone file by
73537e8418e0c030063dbd863cf57feec026030aTinderbox User including the <code class="filename">.key</code> files using
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>$INCLUDE</strong></span> statements.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="dnssec_signing"></a>Signing the Zone</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <span class="command"><strong>dnssec-signzone</strong></span> program is used
9160e27507ba636887f6352bee5cb3729108fc76Tinderbox User to sign a zone.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Any <code class="filename">keyset</code> files corresponding to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews secure subzones should be present. The zone signer will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews generate <code class="literal">NSEC</code>, <code class="literal">NSEC3</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and <code class="literal">RRSIG</code> records for the zone, as
a03cb08d0c4f1ca5fbc121d2f02bdffa7eb52286Mark Andrews well as <code class="literal">DS</code> for the child zones if
a03cb08d0c4f1ca5fbc121d2f02bdffa7eb52286Mark Andrews <code class="literal">'-g'</code> is specified. If <code class="literal">'-g'</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is not specified, then DS RRsets for the secure child
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User zones need to be added manually.
8f977d4d64b0ebe562607aaa044671ed34609978Tinderbox User The following command signs the zone, assuming it is in a
8f977d4d64b0ebe562607aaa044671ed34609978Tinderbox User file called <code class="filename">zone.child.example</code>. By
cdf1c3d486ec082ef6c92297d22d54a67cca0c90Tinderbox User default, all zone keys which have an available private key are
cdf1c3d486ec082ef6c92297d22d54a67cca0c90Tinderbox User used to generate signatures.
4e40289129b2a87cea5ec403620b3bb9a6182f9fTinderbox User <strong class="userinput"><code>dnssec-signzone -o child.example zone.child.example</code></strong>
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt One output file is produced:
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt <code class="filename">zone.child.example.signed</code>. This
efdfbc256c997060cfa0c2306c4fdd9dbc31342cTinderbox User should be referenced by <code class="filename">named.conf</code>
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt input file for the zone.
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt<p><span class="command"><strong>dnssec-signzone</strong></span>
efdfbc256c997060cfa0c2306c4fdd9dbc31342cTinderbox User will also produce a keyset and dsset files and optionally a
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt dlvset file. These are used to provide the parent zone
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt administrators with the <code class="literal">DNSKEYs</code> (or their
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt corresponding <code class="literal">DS</code> records) that are the
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt secure entry point to the zone.
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt<div class="titlepage"><div><div><h3 class="title">
d786bb0f8beee4425dc5ba21ea19f8f353c85a65Evan Hunt<a name="dnssec_config"></a>Configuring Servers</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To enable <span class="command"><strong>named</strong></span> to respond appropriately
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to DNS requests from DNSSEC aware clients,
4b568c8873e83be023f2995e0a30de804499842dTinderbox User <span class="command"><strong>dnssec-enable</strong></span> must be set to yes.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (This is the default setting.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To enable <span class="command"><strong>named</strong></span> to validate answers from
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews other servers, the <span class="command"><strong>dnssec-enable</strong></span> option
5b3dd19d815f0389d566d20c2fee57cb37d1dd47Tinderbox User must be set to <strong class="userinput"><code>yes</code></strong>, and the
5b3dd19d815f0389d566d20c2fee57cb37d1dd47Tinderbox User <span class="command"><strong>dnssec-validation</strong></span> options must be set to
5b3dd19d815f0389d566d20c2fee57cb37d1dd47Tinderbox User <strong class="userinput"><code>yes</code></strong> or <strong class="userinput"><code>auto</code></strong>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If <span class="command"><strong>dnssec-validation</strong></span> is set to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <strong class="userinput"><code>auto</code></strong>, then a default
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews trust anchor for the DNS root zone will be used.
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User If it is set to <strong class="userinput"><code>yes</code></strong>, however,
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews then at least one trust anchor must be configured
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews with a <span class="command"><strong>trusted-keys</strong></span> or
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews <span class="command"><strong>managed-keys</strong></span> statement in
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews <code class="filename">named.conf</code>, or DNSSEC validation
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews will not occur. The default setting is
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews <strong class="userinput"><code>yes</code></strong>.
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews <span class="command"><strong>trusted-keys</strong></span> are copies of DNSKEY RRs
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews for zones that are used to form the first link in the
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews cryptographic chain of trust. All keys listed in
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews <span class="command"><strong>trusted-keys</strong></span> (and corresponding zones)
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews are deemed to exist and only the listed keys will be used
4b568c8873e83be023f2995e0a30de804499842dTinderbox User to validated the DNSKEY RRset that they are from.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>managed-keys</strong></span> are trusted keys which are
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews automatically kept up to date via RFC 5011 trust anchor
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews maintenance.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>trusted-keys</strong></span> and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>managed-keys</strong></span> are described in more detail
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews later in this document.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Unlike <acronym class="acronym">BIND</acronym> 8, <acronym class="acronym">BIND</acronym>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 9 does not verify signatures on load, so zone keys for
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews authoritative zones do not need to be specified in the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews configuration file.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews After DNSSEC gets established, a typical DNSSEC configuration
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will look something like the following. It has one or
3fb635d1c5fad0b7380b8195750dc1057bb1abd6Tinderbox User more public keys for the root. This allows answers from
7692464e78fc43578c394b8d1d30e81fec1d8523Tinderbox User outside the organization to be validated. It will also
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews have several keys for parts of the namespace the organization
34f0f38b72c3ee40233b7b4e09ccab0ac1a74d2aTinderbox User controls. These are here to ensure that <span class="command"><strong>named</strong></span>
5b3dd19d815f0389d566d20c2fee57cb37d1dd47Tinderbox User is immune to compromises in the DNSSEC components of the security
5b3dd19d815f0389d566d20c2fee57cb37d1dd47Tinderbox User of parent zones.
076e51f1ff9497ae61a99994189ed8bf5a0d3472Tinderbox Usermanaged-keys {
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User /* Root Key */
b625bdae12277225b076a002dd4af80902529181Tinderbox User "." initial-key 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwS
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 66gKodQj+MiA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dgxbcDTClU0CRBdiieyLMNzXG3";
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewstrusted-keys {
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews /* Key for our organization's forward zone */
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM6
34f0f38b72c3ee40233b7b4e09ccab0ac1a74d2aTinderbox User 5KbhTjrW1ZaARmPhEZZe3Y9ifgEuq7vZ/z
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews GZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews 4JKUbbOTcM8pwXlj0EiX3oDFVmjHO444gL
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews g4ywzO9WglMk7jbfW33gUKvirTHr25GL7S
7354f3248ddf6b3c331f7da4cc0089e5514fd205Evan Hunt TQUzBb5Usxt8lgnyTUHs1t3JwCY5hKZ6Cq
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews F4qJCyduieHukuY3H4XMAcR+xia2nIUPvm
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews /* Key for our reverse zone. */
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt 2.0.192.IN-ADDRPA.NET. 257 3 5 "AQOnS4xn/IgOUpBPJ3bogzwc
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt xOdNax071L18QqZnQQQAVVr+i
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt LhGTnNGp3HoWQLUIzKrJVZ3zg
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt gy3WwNT6kZo6c0tszYqbtvchm
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt siaOdS0yOI6BgPsw+YZdzlYMa
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt IJGf4M4dyoKIhzdZyQ2bYQrjy
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt Q4LB0lC7aOnsMyYKHHYeRvPxj
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt IQXmdqgOJGq+vsevG06zW+1xg
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt 59VvjSPsZJHeDCUyWYrvPZesZ
b123be91958e0bc58a10c165be64d47661199e3bEvan Hunt DIRvhDD52SKvbheeTJUm6Ehkz
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dnssec-enable yes;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dnssec-validation yes;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews None of the keys listed in this example are valid. In particular,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the root key is not valid.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When DNSSEC validation is enabled and properly configured,
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User the resolver will reject any answers from signed, secure zones
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews which fail to validate, and will return SERVFAIL to the client.
8f3657636521817d2971ae29aa3fb66e33709753Mark Andrews Responses may fail to validate for any of several reasons,
8f3657636521817d2971ae29aa3fb66e33709753Mark Andrews including missing, expired, or invalid signatures, a key which
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews does not match the DS RRset in the parent zone, or an insecure
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews response from a zone which, according to its parent, should have
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews been secure.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When the validator receives a response from an unsigned zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that has a signed parent, it must confirm with the parent
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that the zone was intentionally left unsigned. It does
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews this by verifying, via signed and validated NSEC/NSEC3 records,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that the parent zone contains no DS records for the child.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If the validator <span class="emphasis"><em>can</em></span> prove that the zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is insecure, then the response is accepted. However, if it
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cannot, then it must assume an insecure response to be a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews forgery; it rejects the response and logs an error.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The logged error reads "insecurity proof failed" and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "got insecure response; parent indicates it should be secure".
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (Prior to BIND 9.7, the logged error was "not insecure".
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User This referred to the zone, not the response.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="dnssec.dynamic.zones"></a>DNSSEC, Dynamic Zones, and Automatic Signing</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>As of BIND 9.7.0 it is possible to change a dynamic zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews from insecure to signed and back again. A secure zone can use
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews either NSEC or NSEC3 chains.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.3"></a>Converting from insecure to secure</h3></div></div></div></div>
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User<p>Changing a zone from insecure to secure can be done in two
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews ways: using a dynamic DNS update, or the
ecbc7ebb243a1f8a5dc6f28185ffe9e61d3b2102Mark Andrews <span class="command"><strong>auto-dnssec</strong></span> zone option.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>For either method, you need to configure
6eb9141841e6ed9cbbdbbf41ab0e1c9592c5d078Mark Andrews <span class="command"><strong>named</strong></span> so that it can see the
6eb9141841e6ed9cbbdbbf41ab0e1c9592c5d078Mark Andrews <code class="filename">K*</code> files which contain the public and private
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews parts of the keys that will be used to sign the zone. These files
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will have been generated by
6eb9141841e6ed9cbbdbbf41ab0e1c9592c5d078Mark Andrews <span class="command"><strong>dnssec-keygen</strong></span>. You can do this by placing them
6eb9141841e6ed9cbbdbbf41ab0e1c9592c5d078Mark Andrews in the key-directory, as specified in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews type master;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews update-policy local;
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews<p>If one KSK and one ZSK DNSKEY key have been generated, this
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews configuration will cause all records in the zone to be signed
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews with the ZSK, and the DNSKEY RRset to be signed with the KSK as
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews well. An NSEC chain will be generated as part of the initial
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews signing process.</p>
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews<a name="id-1.5.10.8"></a>Dynamic DNS update method</h3></div></div></div></div>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews > ttl 3600
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews > update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews > update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
95c3a5e116c1da135f669c3f15398172fac6279dMark Andrews<p>While the update request will complete almost immediately,
95c3a5e116c1da135f669c3f15398172fac6279dMark Andrews the zone will not be completely signed until
95c3a5e116c1da135f669c3f15398172fac6279dMark Andrews <span class="command"><strong>named</strong></span> has had time to walk the zone and
95c3a5e116c1da135f669c3f15398172fac6279dMark Andrews generate the NSEC and RRSIG records. The NSEC record at the apex
95c3a5e116c1da135f669c3f15398172fac6279dMark Andrews will be added last, to signal that there is a complete NSEC
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>If you wish to sign using NSEC3 instead of NSEC, you should
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews add an NSEC3PARAM record to the initial update request. If you
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews wish the NSEC3 chain to have the OPTOUT bit set, set it in the
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User flags field of the NSEC3PARAM record.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews > ttl 3600
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews > update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User > update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt > update add example.net NSEC3PARAM 1 1 100 1234567890
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt<p>Again, this update request will complete almost
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt immediately; however, the record won't show up until
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt <span class="command"><strong>named</strong></span> has had a chance to build/remove the
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt relevant chain. A private type record will be created to record
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt the state of the operation (see below for more details), and will
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt be removed once the operation completes.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>While the initial signing and NSEC/NSEC3 chain generation
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is happening, other updates are possible as well.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.16"></a>Fully automatic zone signing</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>To enable automatic signing, add the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>auto-dnssec</strong></span> option to the zone statement in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>auto-dnssec</strong></span> has two possible arguments:
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User <span class="command"><strong>auto-dnssec allow</strong></span>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span> can search the key directory for keys
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews matching the zone, insert them into the zone, and use them to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews sign the zone. It will do so only when it receives an
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>rndc sign <zonename></strong></span>.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>auto-dnssec maintain</strong></span> includes the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews functionality, but will also automatically adjust the zone's
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews DNSKEY records on schedule according to the keys' timing metadata.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (See <a class="xref" href="man.dnssec-keygen.html" title="dnssec-keygen"><span class="refentrytitle"><span class="application">dnssec-keygen</span></span>(8)</a> and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <a class="xref" href="man.dnssec-settime.html" title="dnssec-settime"><span class="refentrytitle"><span class="application">dnssec-settime</span></span>(8)</a> for more information.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span> will periodically search the key directory
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews for keys matching the zone, and if the keys' metadata indicates
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that any change should be made the zone, such as adding, removing,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews or revoking a key, then that action will be carried out. By default,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the key directory is checked for changes every 60 minutes; this period
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews can be adjusted with the <code class="option">dnssec-loadkeys-interval</code>, up
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to a maximum of 24 hours. The <span class="command"><strong>rndc loadkeys</strong></span> forces
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span> to check for key updates immediately.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If keys are present in the key directory the first time the zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is loaded, the zone will be signed immediately, without waiting for an
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>rndc sign</strong></span> or <span class="command"><strong>rndc loadkeys</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews command. (Those commands can still be used when there are unscheduled
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews key changes, however.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When new keys are added to a zone, the TTL is set to match that
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews of any existing DNSKEY RRset. If there is no existing DNSKEY RRset,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews then the TTL will be set to the TTL specified when the key was
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews created (using the <span class="command"><strong>dnssec-keygen -L</strong></span> option), if
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User any, or to the SOA TTL.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If you wish the zone to be signed using NSEC3 instead of NSEC,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews submit an NSEC3PARAM record via dynamic update prior to the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews scheduled publication and activation of the keys. If you wish the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews NSEC3 chain to have the OPTOUT bit set, set it in the flags field
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews of the NSEC3PARAM record. The NSEC3PARAM record will not appear in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the zone immediately, but it will be stored for later reference. When
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the zone is signed and the NSEC3 chain is completed, the NSEC3PARAM
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews record will appear in the zone.
8ac5ddf659a81ed668579818981fc1a5f28405d1Tinderbox User <span class="command"><strong>auto-dnssec</strong></span> option requires the zone to be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews configured to allow dynamic updates, by adding an
2b7254075b883d70852a2757210793603085a0f1Tinderbox User <span class="command"><strong>allow-update</strong></span> or
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>update-policy</strong></span> statement to the zone
b6561016dc8a813bfd91cef5b876b3dfc3f08ffaTinderbox User configuration. If this has not been done, the configuration will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.25"></a>Private-type records</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>The state of the signing process is signaled by
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User private-type records (with a default type value of 65534). When
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews signing is complete, these records will have a nonzero value for
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the final octet (for those records which have a nonzero initial
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>The private type record format: If the first octet is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews non-zero then the record indicates that the zone needs to be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews signed with the key matching the record, or that all signatures
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that match the record should be removed.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��algorithm�(octet�1)<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��key�id�in�network�order�(octet�2�and�3)<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��removal�flag�(octet�4)<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��complete�flag�(octet�5)<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>Only records flagged as "complete" can be removed via
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dynamic update. Attempts to remove other private type records
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will be silently ignored.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>If the first octet is zero (this is a reserved algorithm
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews number that should never appear in a DNSKEY record) then the
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User record indicates changes to the NSEC3 chains are in progress. The
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews rest of the record contains an NSEC3PARAM record. The flag field
ebe53509ca55a141131c104b6d722236b606e0efTinderbox User tells what operation to perform based on the flag bits.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��0x01�OPTOUT<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��0x80�CREATE<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��0x40�REMOVE<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews��0x20�NONSEC<br>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.32"></a>DNSKEY rollovers</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>As with insecure-to-secure conversions, rolling DNSSEC
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews keys can be done in two ways: using a dynamic DNS update, or the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>auto-dnssec</strong></span> zone option.</p>
e1a389f7478d094ffbe592df28328a10d484cb38Tinderbox User<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.34"></a>Dynamic DNS update method</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p> To perform key rollovers via dynamic update, you need to add
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the <code class="filename">K*</code> files for the new keys so that
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span> can find them. You can then add the new
2da2220fe7af2c45724b50b0187523b1fab0cf08Rob Austein DNSKEY RRs via dynamic update.
e1a389f7478d094ffbe592df28328a10d484cb38Tinderbox User <span class="command"><strong>named</strong></span> will then cause the zone to be signed
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews with the new keys. When the signing is complete the private type
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews records will be updated so that the last octet is non
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>If this is for a KSK you need to inform the parent and any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews trust anchor repositories of the new KSK.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>You should then wait for the maximum TTL in the zone before
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews removing the old DNSKEY. If it is a KSK that is being updated,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews you also need to wait for the DS RRset in the parent to be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews updated and its TTL to expire. This ensures that all clients will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews be able to verify at least one signature when you remove the old
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>The old DNSKEY can be removed via UPDATE. Take care to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews specify the correct key.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span> will clean out any signatures generated
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews by the old key after the update completes.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.39"></a>Automatic key rollovers</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>When a new key reaches its activation date (as set by
e1a389f7478d094ffbe592df28328a10d484cb38Tinderbox User <span class="command"><strong>dnssec-keygen</strong></span> or <span class="command"><strong>dnssec-settime</strong></span>),
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews if the <span class="command"><strong>auto-dnssec</strong></span> zone option is set to
e1a389f7478d094ffbe592df28328a10d484cb38Tinderbox User <code class="constant">maintain</code>, <span class="command"><strong>named</strong></span> will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews automatically carry out the key rollover. If the key's algorithm
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews has not previously been used to sign the zone, then the zone will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews be fully signed as quickly as possible. However, if the new key
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is replacing an existing key of the same algorithm, then the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone will be re-signed incrementally, with signatures from the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews old key being replaced with signatures from the new key as their
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews signature validity periods expire. By default, this rollover
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews completes in 30 days, after which it will be safe to remove the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews old key from the DNSKEY RRset.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.41"></a>NSEC3PARAM rollovers via UPDATE</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>Add the new NSEC3PARAM record via dynamic update. When the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews new NSEC3 chain has been generated, the NSEC3PARAM flag field
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will be zero. At this point you can remove the old NSEC3PARAM
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews record. The old chain will be removed after the update request
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews completes.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.43"></a>Converting from NSEC to NSEC3</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>To do this, you just need to add an NSEC3PARAM record. When
e1a389f7478d094ffbe592df28328a10d484cb38Tinderbox User the conversion is complete, the NSEC chain will have been removed
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and the NSEC3PARAM record will have a zero flag field. The NSEC3
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews chain will be generated before the NSEC chain is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews destroyed.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.45"></a>Converting from NSEC3 to NSEC</h3></div></div></div></div>
f48877f10cfccd0cdbb7aa5f832fbafcf60ce1daTinderbox User<p>To do this, use <span class="command"><strong>nsupdate</strong></span> to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews remove all NSEC3PARAM records with a zero flag
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews field. The NSEC chain will be generated before the NSEC3 chain is
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews removed.</p>
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
82b96702f09ed6bc5cd0f1aa5e54198c04cc192bTinderbox User<a name="id-1.5.10.47"></a>Converting from secure to insecure</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>To convert a signed zone to unsigned using dynamic DNS,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews delete all the DNSKEY records from the zone apex using
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>nsupdate</strong></span>. All signatures, NSEC or NSEC3 chains,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and associated NSEC3PARAM records will be removed automatically.
c42fe4bf07216f2d2d058190f59e74cecdfe0f5aTinderbox User This will take place after the update request completes.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p> This requires the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dnssec-secure-to-insecure</strong></span> option to be set to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <strong class="userinput"><code>yes</code></strong> in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>In addition, if the <span class="command"><strong>auto-dnssec maintain</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone statement is used, it should be removed or changed to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>allow</strong></span> instead (or it will re-sign).
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.10.51"></a>Periodic re-signing</h3></div></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>In any secure zone which supports dynamic updates, <span class="command"><strong>named</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will periodically re-sign RRsets which have not been re-signed as
549c517e2ecad52bb1d32f08920e29d4e8cda71eTinderbox User a result of some update action. The signature lifetimes will be
549c517e2ecad52bb1d32f08920e29d4e8cda71eTinderbox User adjusted so as to spread the re-sign load over time rather than
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User all at once.</p>
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews<div class="section"><div class="titlepage"><div><div><h3 class="title">
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews<a name="id-1.5.10.53"></a>NSEC3 and OPTOUT</h3></div></div></div></div>
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews <span class="command"><strong>named</strong></span> only supports creating new NSEC3 chains
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews where all the NSEC3 records in the zone have the same OPTOUT
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews <span class="command"><strong>named</strong></span> supports UPDATES to zones where the NSEC3
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews records in the chain have mixed OPTOUT state.
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews <span class="command"><strong>named</strong></span> does not support changing the OPTOUT
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews state of an individual NSEC3 record, the entire chain needs to be
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews changed if the OPTOUT state of an individual NSEC3 needs to be
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews changed.</p>
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews<a name="rfc5011.support"></a>Dynamic Trust Anchor Management</h2></div></div></div>
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews<p>BIND 9.7.0 introduces support for RFC 5011, dynamic trust
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews anchor management. Using this feature allows
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews <span class="command"><strong>named</strong></span> to keep track of changes to critical
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews DNSSEC keys without any need for the operator to make changes to
7204d08a319cf590ae4280b8cc20999320398574Mark Andrews configuration files.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.11.3"></a>Validating Resolver</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>To configure a validating resolver to use RFC 5011 to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews maintain a trust anchor, configure the trust anchor using a
052969f1f134d31c7f0fd0d55a89bfd53d538e77Tinderbox User <span class="command"><strong>managed-keys</strong></span> statement. Information about
81573f7b114a4c71c0bf47058c00fffd245323ceTinderbox User this can be found in
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews <a class="xref" href="Bv9ARM.ch06.html#managed-keys" title="managed-keys Statement Definition and Usage">the section called “<span class="command"><strong>managed-keys</strong></span> Statement Definition
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
ae454ec746d1d4db8d04e107d4d25ff13158c37fMark Andrews<a name="id-1.5.11.4"></a>Authoritative Server</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>To set up an authoritative zone for RFC 5011 trust anchor
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews maintenance, generate two (or more) key signing keys (KSKs) for
ae454ec746d1d4db8d04e107d4d25ff13158c37fMark Andrews the zone. Sign the zone with one of them; this is the "active"
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews KSK. All KSKs which do not sign the zone are "stand-by"
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>Any validating resolver which is configured to use the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews active KSK as an RFC 5011-managed trust anchor will take note
ae454ec746d1d4db8d04e107d4d25ff13158c37fMark Andrews of the stand-by KSKs in the zone's DNSKEY RRset, and store them
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews for future reference. The resolver will recheck the zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews periodically, and after 30 days, if the new key is still there,
ae454ec746d1d4db8d04e107d4d25ff13158c37fMark Andrews then the key will be accepted by the resolver as a valid trust
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews anchor for the zone. Any time after this 30-day acceptance
ae454ec746d1d4db8d04e107d4d25ff13158c37fMark Andrews timer has completed, the active KSK can be revoked, and the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone can be "rolled over" to the newly accepted key.</p>
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User<p>The easiest way to place a stand-by key in a zone is to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews use the "smart signing" features of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dnssec-keygen</strong></span> and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dnssec-signzone</strong></span>. If a key with a publication
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews date in the past, but an activation date which is unset or in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the future, "
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dnssec-signzone -S</strong></span>" will include the DNSKEY
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews record in the zone, but will not sign with it:</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>dnssec-keygen -K keys -f KSK -P now -A now+2y example.net</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>dnssec-signzone -S -K keys example.net</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>To revoke a key, the new command
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User <span class="command"><strong>dnssec-revoke</strong></span> has been added. This adds the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews REVOKED bit to the key flags and re-generates the
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews <code class="filename">K*.private</code> files.</p>
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews<p>After revoking the active key, the zone must be signed
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt with both the revoked KSK and the new active KSK. (Smart
f4f4b97a35429a21480a3858f96b8020f2a9f45dTinderbox User signing takes care of this automatically.)</p>
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews<p>Once a key has been revoked and used to sign the DNSKEY
1ef84760d1d9c2f4610c3f9c777267388971ae80Tinderbox User RRset in which it appears, that key will never again be
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews accepted as a valid trust anchor by the resolver. However,
9dde9ce5558696850b6b9850a8475ae518409518Tinderbox User validation can proceed using the new active key (which had been
903fcd6a60c6420f5dbd753ab068ba5ca2af8e62Tinderbox User accepted by the resolver when it was a stand-by key).</p>
903fcd6a60c6420f5dbd753ab068ba5ca2af8e62Tinderbox User<p>See RFC 5011 for more details on key rollover
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews scenarios.</p>
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews<p>When a key has been revoked, its key ID changes,
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews increasing by 128, and wrapping around at 65535. So, for
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews example, the key "<code class="filename">Kexample.com.+005+10000</code>" becomes
1ef84760d1d9c2f4610c3f9c777267388971ae80Tinderbox User "<code class="filename">Kexample.com.+005+10128</code>".</p>
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews<p>If two keys have IDs exactly 128 apart, and one is
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews revoked, then the two key IDs will collide, causing several
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews problems. To prevent this,
ac2e2800b4ac9cbe4cb756d967f4583c611eb75eMark Andrews <span class="command"><strong>dnssec-keygen</strong></span> will not generate a new key if
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews another key is present which may collide. This checking will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews only occur if the new keys are written to the same directory
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User which holds all other keys in use for that zone.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>Older versions of BIND 9 did not have this precaution.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Exercise caution if using key revocation on keys that were
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews generated by previous releases, or if using keys stored in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews multiple directories or on multiple machines.</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<p>It is expected that a future release of BIND 9 will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews address this problem in a different way, by storing revoked
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews keys with their original unrevoked key IDs.</p>
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User<div class="titlepage"><div><div><h2 class="title" style="clear: both">
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User<a name="pkcs11"></a>PKCS#11 (Cryptoki) support</h2></div></div></div>
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User PKCS#11 (Public Key Cryptography Standard #11) defines a
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User platform-independent API for the control of hardware security
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User modules (HSMs) and other cryptographic support devices.
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User BIND 9 is known to work with three HSMs: The AEP Keyper, which has
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User been tested with Debian Linux, Solaris x86 and Windows Server 2003;
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User the Thales nShield, tested with Debian Linux; and the Sun SCA 6000
c4a35623959c143db02800584b8116d5b9cd72adTinderbox User cryptographic acceleration board, tested with Solaris x86. In
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews addition, BIND can be used with all current versions of SoftHSM,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews a software-based HSM simulator library produced by the OpenDNSSEC
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews PKCS#11 makes use of a "provider library": a dynamically loadable
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews library which provides a low-level PKCS#11 interface to drive the HSM
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews hardware. The PKCS#11 provider library comes from the HSM vendor, and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews it is specific to the HSM to be controlled.
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User There are two available mechanisms for PKCS#11 support in BIND 9:
620745a4c70077221fdeecaafd3252e9d3f944f3Tinderbox User OpenSSL-based PKCS#11 and native PKCS#11. When using the first
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews mechanism, BIND uses a modified version of OpenSSL, which loads
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the provider library and operates the HSM indirectly; any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cryptographic operations not supported by the HSM can be carried
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews out by OpenSSL instead. The second mechanism enables BIND to bypass
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews OpenSSL completely; BIND loads the provider library itself, and uses
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the PKCS#11 API to drive the HSM directly.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.6"></a>Prerequisites</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews See the documentation provided by your HSM vendor for
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User information about installing, initializing, testing and
620745a4c70077221fdeecaafd3252e9d3f944f3Tinderbox User troubleshooting the HSM.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.7"></a>Native PKCS#11</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Native PKCS#11 mode will only work with an HSM capable of carrying
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews out <span class="emphasis"><em>every</em></span> cryptographic operation BIND 9 may
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews need. The HSM's provider library must have a complete implementation
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews of the PKCS#11 API, so that all these functions are accessible. As of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews this writing, only the Thales nShield HSM and SoftHSMv2 can be used
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews in this fashion. For other HSMs, including the AEP Keyper, Sun SCA
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 6000 and older versions of SoftHSM, use OpenSSL-based PKCS#11.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (Note: Eventually, when more HSMs become capable of supporting
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews native PKCS#11, it is expected that OpenSSL-based PKCS#11 will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews be deprecated.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To build BIND with native PKCS#11, configure as follows:
dcf17dea53e63f2787924e8e89783d931d8c8fecTinderbox User$ <strong class="userinput"><code>cd bind9</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>/configure --enable-native-pkcs11 \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --with-pkcs11=<em class="replaceable"><code>provider-library-path</code></em></code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This will cause all BIND tools, including <span class="command"><strong>named</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and the <span class="command"><strong>dnssec-*</strong></span> and <span class="command"><strong>pkcs11-*</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews tools, to use the PKCS#11 provider library specified in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <em class="replaceable"><code>provider-library-path</code></em> for cryptography.
dcf17dea53e63f2787924e8e89783d931d8c8fecTinderbox User (The provider library path can be overridden using the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="option">-E</code> in <span class="command"><strong>named</strong></span> and the
dcf17dea53e63f2787924e8e89783d931d8c8fecTinderbox User <span class="command"><strong>dnssec-*</strong></span> tools, or the <code class="option">-m</code> in
f09f1bf18e3ad40a0e8a6cc3dabf1c11f04992cbMark Andrews the <span class="command"><strong>pkcs11-*</strong></span> tools.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h4 class="title">
dcf17dea53e63f2787924e8e89783d931d8c8fecTinderbox User<a name="id-1.5.12.7.6"></a>Building SoftHSMv2</h4></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews SoftHSMv2, the latest development version of SoftHSM, is available
10702d681eb650391bcaa0e2704aa3cf2dbf0e98Mark Andrews <a class="link" href="https://github.com/opendnssec/SoftHSMv2" target="_top">
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User It is a software library developed by the OpenDNSSEC project
10702d681eb650391bcaa0e2704aa3cf2dbf0e98Mark Andrews (<a class="link" href="http://www.opendnssec.org" target="_top">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews which provides a PKCS#11 interface to a virtual HSM, implemented in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the form of a SQLite3 database on the local filesystem. It provides
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington less security than a true HSM, but it allows you to experiment with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews native PKCS#11 when an HSM is not available. SoftHSMv2 can be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews configured to use either OpenSSL or the Botan library to perform
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cryptographic functions, but when using it for native PKCS#11 in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews BIND, OpenSSL is required.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews By default, the SoftHSMv2 configuration file is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <em class="replaceable"><code>prefix</code></em>/etc/softhsm2.conf (where
93ca5ee4c4c77aca8d3bcffd70216f30ef398387Mark Andrews <em class="replaceable"><code>prefix</code></em> is configured at compile time).
93ca5ee4c4c77aca8d3bcffd70216f30ef398387Mark Andrews This location can be overridden by the SOFTHSM2_CONF environment
93ca5ee4c4c77aca8d3bcffd70216f30ef398387Mark Andrews variable. The SoftHSMv2 cryptographic store must be installed and
93ca5ee4c4c77aca8d3bcffd70216f30ef398387Mark Andrews initialized before using it with BIND.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code> cd SoftHSMv2 </code></strong>
1a63fb1d1448ed3f8fd7227ae57be67c2e71279eMark Andrews$ <strong class="userinput"><code> configure --with-crypto-backend=openssl --prefix=/opt/pkcs11/usr --enable-gost </code></strong>
1a63fb1d1448ed3f8fd7227ae57be67c2e71279eMark Andrews$ <strong class="userinput"><code> make </code></strong>
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews$ <strong class="userinput"><code> make install </code></strong>
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews$ <strong class="userinput"><code> /opt/pkcs11/usr/bin/softhsm-util --init-token 0 --slot 0 --label softhsmv2 </code></strong>
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews<div class="titlepage"><div><div><h3 class="title">
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews<a name="id-1.5.12.8"></a>OpenSSL-based PKCS#11</h3></div></div></div>
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews OpenSSL-based PKCS#11 mode uses a modified version of the
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews OpenSSL library; stock OpenSSL does not fully support PKCS#11.
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews ISC provides a patch to OpenSSL to correct this. This patch is
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews based on work originally done by the OpenSolaris project; it has been
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews modified by ISC to provide new features such as PIN management and
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews key-by-reference.
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews There are two "flavors" of PKCS#11 support provided by
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews the patched OpenSSL, one of which must be chosen at
8e5fce1f9ceba17dd7e3ff0eb287e1e999c14249Mark Andrews configuration time. The correct choice depends on the HSM
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Use 'crypto-accelerator' with HSMs that have hardware
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cryptographic acceleration features, such as the SCA 6000
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews board. This causes OpenSSL to run all supported
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cryptographic operations in the HSM.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Use 'sign-only' with HSMs that are designed to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews function primarily as secure key storage devices, but lack
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews hardware acceleration. These devices are highly secure, but
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews are not necessarily any faster at cryptography than the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews system CPU — often, they are slower. It is therefore
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews most efficient to use them only for those cryptographic
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews functions that require access to the secured private key,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews such as zone signing, and to use the system CPU for all
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews other computationally-intensive operations. The AEP Keyper
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is an example of such a device.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington The modified OpenSSL code is included in the BIND 9 release,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews in the form of a context diff against the latest versions of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews OpenSSL. OpenSSL 0.9.8, 1.0.0, 1.0.1 and 1.0.2 are supported;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews there are separate diffs for each version. In the examples to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews follow, we use OpenSSL 0.9.8, but the same methods work with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews OpenSSL 1.0.0 through 1.0.2.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews The OpenSSL patches as of this writing (January 2016)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews support versions 0.9.8zh, 1.0.0t, 1.0.1q and 1.0.2f.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews ISC will provide updated patches as new versions of OpenSSL
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews are released. The version number in the following examples
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is expected to change.
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User Before building BIND 9 with PKCS#11 support, it will be
415d630b6309922caee8469384a6fab75cf05032Mark Andrews necessary to build OpenSSL with the patch in place, and configure
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews it with the path to your HSM's PKCS#11 provider library.
81573f7b114a4c71c0bf47058c00fffd245323ceTinderbox User<div class="titlepage"><div><div><h4 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.8.8"></a>Patching OpenSSL</h4></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>wget <a class="link" href="" target="_top">http://www.openssl.org/source/openssl-0.9.8zc.tar.gz</a></code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>tar zxf openssl-0.9.8zc.tar.gz</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>patch -p1 -d openssl-0.9.8zc \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews < bind9/bin/pkcs11/openssl-0.9.8zc-patch</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The patch file may not be compatible with the
81573f7b114a4c71c0bf47058c00fffd245323ceTinderbox User "patch" utility on all operating systems. You may need to
81573f7b114a4c71c0bf47058c00fffd245323ceTinderbox User install GNU patch.
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User When building OpenSSL, place it in a non-standard
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User location so that it does not interfere with OpenSSL libraries
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User elsewhere on the system. In the following examples, we choose
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User to install into "/opt/pkcs11/usr". We will use this location
e1ebc476b08b4a498fcf3477e42c986eb1991360Tinderbox User when we configure BIND 9.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User Later, when building BIND 9, the location of the custom-built
e135e3c4b1f4f986f00997f5ad5866effb203139Tinderbox User OpenSSL library will need to be specified via configure.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h4 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.8.9"></a>Building OpenSSL for the AEP Keyper on Linux</h4></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The AEP Keyper is a highly secure key storage device,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews but does not provide hardware cryptographic acceleration. It
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews can carry out cryptographic operations, but it is probably
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User slower than your system's CPU. Therefore, we choose the
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews 'sign-only' flavor when building OpenSSL.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews The Keyper-specific PKCS#11 provider library is
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews delivered with the Keyper software. In this example, we place
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews$ <strong class="userinput"><code>cp pkcs11.GCC4.0.2.so.4.05 /opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews The Keyper library requires threads, so we
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews must specify -pthread.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews$ <strong class="userinput"><code>cd openssl-0.9.8zc</code></strong>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews$ <strong class="userinput"><code>/Configure linux-x86_64 -pthread \
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews --pk11-libname=/opt/pkcs11/usr/lib/libpkcs11.so \
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews --pk11-flavor=sign-only \
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews After configuring, run "<span class="command"><strong>make</strong></span>"
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews and "<span class="command"><strong>make test</strong></span>". If "<span class="command"><strong>make
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews test</strong></span>" fails with "pthread_atfork() not found", you forgot to
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews add the -pthread above.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews<div class="titlepage"><div><div><h4 class="title">
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews<a name="id-1.5.12.8.10"></a>Building OpenSSL for the SCA 6000 on Solaris</h4></div></div></div>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews The SCA-6000 PKCS#11 provider is installed as a system
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews library, libpkcs11. It is a true crypto accelerator, up to 4
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt times faster than any CPU, so the flavor shall be
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt 'crypto-accelerator'.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews In this example, we are building on Solaris x86 on an
7614afdab2abb26b34531409d2f28dcc56c52c6eEvan Hunt AMD64 system.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews$ <strong class="userinput"><code>cd openssl-0.9.8zc</code></strong>
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews$ <strong class="userinput"><code>/Configure solaris64-x86_64-cc \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --pk11-flavor=crypto-accelerator \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (For a 32-bit build, use "solaris-x86-cc" and /usr/lib/libpkcs11.so.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews After configuring, run
c849f7acb025c73f56a8e28902a473f2aeaba39fTinderbox User <span class="command"><strong>make</strong></span> and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>make test</strong></span>.
c849f7acb025c73f56a8e28902a473f2aeaba39fTinderbox User<div class="titlepage"><div><div><h4 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.8.11"></a>Building OpenSSL for SoftHSM</h4></div></div></div>
c849f7acb025c73f56a8e28902a473f2aeaba39fTinderbox User SoftHSM (version 1) is a software library developed by the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews OpenDNSSEC project
c849f7acb025c73f56a8e28902a473f2aeaba39fTinderbox User (<a class="link" href="http://www.opendnssec.org" target="_top">
fdd0516065be2316409d0cc7dfb4e4f54eadc5afMark Andrews which provides a
c849f7acb025c73f56a8e28902a473f2aeaba39fTinderbox User PKCS#11 interface to a virtual HSM, implemented in the form of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews a SQLite3 database on the local filesystem. SoftHSM uses
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the Botan library to perform cryptographic functions. Though
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews less secure than a true HSM, it can allow you to experiment
fdd0516065be2316409d0cc7dfb4e4f54eadc5afMark Andrews with PKCS#11 when an HSM is not available.
c849f7acb025c73f56a8e28902a473f2aeaba39fTinderbox User The SoftHSM cryptographic store must be installed and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews initialized before using it with OpenSSL, and the SOFTHSM_CONF
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews environment variable must always point to the SoftHSM configuration
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington$ <strong class="userinput"><code> cd softhsm-1.3.7 </code></strong>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington$ <strong class="userinput"><code> configure --prefix=/opt/pkcs11/usr </code></strong>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington$ <strong class="userinput"><code> make </code></strong>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington$ <strong class="userinput"><code> make install </code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code> export SOFTHSM_CONF=/opt/pkcs11/softhsm.conf </code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code> echo "0:/opt/pkcs11/softhsm.db" > $SOFTHSM_CONF </code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code> /opt/pkcs11/usr/bin/softhsm --init-token 0 --slot 0 --label softhsm </code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews SoftHSM can perform all cryptographic operations, but
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews since it only uses your system CPU, there is no advantage to using
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews it for anything but signing. Therefore, we choose the 'sign-only'
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews flavor when building OpenSSL.
74d98566ed6a2280ea84d146e7c81275f1c5649dMark Andrews$ <strong class="userinput"><code>cd openssl-0.9.8zc</code></strong>
127d2b350ec0e5759e9fdc675ae63502208009bfTinderbox User$ <strong class="userinput"><code>/Configure linux-x86_64 -pthread \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --pk11-libname=/opt/pkcs11/usr/lib/libsofthsm.so \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --pk11-flavor=sign-only \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews After configuring, run "<span class="command"><strong>make</strong></span>"
4c3d55cb2d2db8a4c52c99b0a76109fb3fe32151Mark Andrews and "<span class="command"><strong>make test</strong></span>".
e062b72f783cdb436a1a57a630bdff471dbb3038Mark Andrews Once you have built OpenSSL, run
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "<span class="command"><strong>apps/openssl engine pkcs11</strong></span>" to confirm
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that PKCS#11 support was compiled in correctly. The output
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews should be one of the following lines, depending on the flavor
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (pkcs11) PKCS #11 engine support (sign only)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (pkcs11) PKCS #11 engine support (crypto accelerator)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "<span class="command"><strong>apps/openssl engine pkcs11 -t</strong></span>". This will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews attempt to initialize the PKCS#11 engine. If it is able to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews do so successfully, it will report
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User <span class="quote">“<span class="quote"><code class="literal">[ available ]</code></span>”</span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If the output is correct, run
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "<span class="command"><strong>make install</strong></span>" which will install the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews modified OpenSSL suite to <code class="filename">/opt/pkcs11/usr</code>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h4 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.8.18"></a>Configuring BIND 9 for Linux with the AEP Keyper</h4></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To link with the PKCS#11 provider, threads must be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews enabled in the BIND 9 build.
c2becd6ae3f45f67f353abac830f8a04ba2de9ecTinderbox User$ <strong class="userinput"><code>cd /bind9</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>/configure --enable-threads \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --with-pkcs11=/opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt<div class="titlepage"><div><div><h4 class="title">
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User<a name="id-1.5.12.8.19"></a>Configuring BIND 9 for Solaris with the SCA 6000</h4></div></div></div>
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User To link with the PKCS#11 provider, threads must be
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User enabled in the BIND 9 build.
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User$ <strong class="userinput"><code>cd /bind9</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>/configure CC="cc -xarch=amd64" --enable-threads \
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User --with-pkcs11=/usr/lib/64/libpkcs11.so</code></strong>
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User<p>(For a 32-bit build, omit CC="cc -xarch=amd64".)</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If configure complains about OpenSSL not working, you
d9f80ee2ba80cc16d60f20b6f0a11a2307412ab4Tinderbox User may have a 32/64-bit architecture mismatch. Or, you may have
384e37a497027518dd33d9c78575e58dd24a796dTinderbox User incorrectly specified the path to OpenSSL (it should be the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews same as the --prefix argument to the OpenSSL
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h4 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.8.20"></a>Configuring BIND 9 for SoftHSM</h4></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>cd /bind9</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>/configure --enable-threads \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --with-pkcs11=/opt/pkcs11/usr/lib/libsofthsm.so</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews After configuring, run
b577ce9ed2153db6539fb975b4a7aa16d9b3baeeTinderbox User "<span class="command"><strong>make</strong></span>",
e5b18a24c86b4e11e5e65a17c45111158048840eTinderbox User "<span class="command"><strong>make test</strong></span>" and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "<span class="command"><strong>make install</strong></span>".
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (Note: If "make test" fails in the "pkcs11" system test, you may
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt have forgotten to set the SOFTHSM_CONF environment variable.)
4b14dedee8b236fc66413d8589c4cb3d950092ceTinderbox User<div class="titlepage"><div><div><h3 class="title">
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User<a name="id-1.5.12.9"></a>PKCS#11 Tools</h3></div></div></div>
601c1908d06375f5dea00ab98671a6c934d8a840Automatic Updater BIND 9 includes a minimal set of tools to operate the
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews HSM, including
601c1908d06375f5dea00ab98671a6c934d8a840Automatic Updater <span class="command"><strong>pkcs11-keygen</strong></span> to generate a new key pair
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews within the HSM,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>pkcs11-list</strong></span> to list objects currently
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>pkcs11-destroy</strong></span> to remove objects, and
edfc6f05eaff086af661b2535a766373dc1e8345Tinderbox User <span class="command"><strong>pkcs11-tokens</strong></span> to list available tokens.
1e07acce903514fd98ee0474a664e4a01908c791Tinderbox User In UNIX/Linux builds, these tools are built only if BIND
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 9 is configured with the --with-pkcs11 option. (Note: If
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews --with-pkcs11 is set to "yes", rather than to the path of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews PKCS#11 provider, then the tools will be built but the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews provider will be left undefined. Use the -m option or the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews PKCS11_PROVIDER environment variable to specify the path to the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User<a name="id-1.5.12.10"></a>Using the HSM</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews For OpenSSL-based PKCS#11, we must first set up the runtime
d642d3857129678797a01adee14fbd70335b05a9Mark Andrews environment so the OpenSSL and PKCS#11 libraries can be loaded:
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt$ <strong class="userinput"><code>export LD_LIBRARY_PATH=/opt/pkcs11/usr/lib:${LD_LIBRARY_PATH}</code></strong>
2fee8782a6fd57d86a67949092ab9197111af390Evan Hunt This causes <span class="command"><strong>named</strong></span> and other binaries to load
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the OpenSSL library from <code class="filename">/opt/pkcs11/usr/lib</code>
fd8fb4df8499e292daeac765f599ac7c507d9ca3Mark Andrews rather than from the default location. This step is not necessary
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews when using native PKCS#11.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Some HSMs require other environment variables to be set.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews For example, when operating an AEP Keyper, it is necessary to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews specify the location of the "machine" file, which stores
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews information about the Keyper for use by the provider
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews library. If the machine file is in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">/opt/Keyper/PKCS11Provider/machine</code>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>export KEYPER_LIBRARY_PATH=/opt/Keyper/PKCS11Provider</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Such environment variables must be set whenever running
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User any tool that uses the HSM, including
7c8e44a2dc1121dbe3b615c9c934f37fb1741bb9Tinderbox User <span class="command"><strong>pkcs11-keygen</strong></span>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>pkcs11-list</strong></span>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>pkcs11-destroy</strong></span>,
bac4435d473c9a0281507524f084480c34aa942aTinderbox User <span class="command"><strong>dnssec-keyfromlabel</strong></span>,
bac4435d473c9a0281507524f084480c34aa942aTinderbox User <span class="command"><strong>dnssec-signzone</strong></span>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dnssec-keygen</strong></span>, and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews We can now create and use keys in the HSM. In this case,
bac4435d473c9a0281507524f084480c34aa942aTinderbox User we will create a 2048 bit key and give it the label
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "sample-ksk":
bac4435d473c9a0281507524f084480c34aa942aTinderbox User$ <strong class="userinput"><code>pkcs11-keygen -b 2048 -l sample-ksk</code></strong>
2128e98a141572c7cf701f3faee1a80c9c2a1a01Tinderbox User$ <strong class="userinput"><code>pkcs11-list</code></strong>
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrewsobject[0]: handle 2147483658 class 3 label[8] 'sample-ksk' id[0]
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrewsobject[1]: handle 2147483657 class 2 label[8] 'sample-ksk' id[0]
bf8c3776f1bf1a1270e5e0443ae5a8df022632a8Mark Andrews Before using this key to sign a zone, we must create a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews pair of BIND 9 key files. The "dnssec-keyfromlabel" utility
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews does this. In this case, we will be using the HSM key
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "sample-ksk" as the key-signing key for "example.net":
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User$ <strong class="userinput"><code>dnssec-keyfromlabel -l sample-ksk -f KSK example.net</code></strong>
f8eafaa4fa758a6aa19e2e858fe8f7088c21a9bdTinderbox User The resulting K*.key and K*.private files can now be used
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to sign the zone. Unlike normal K* files, which contain both
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews public and private key data, these files will contain only the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews public key data, plus an identifier for the private key which
f8eafaa4fa758a6aa19e2e858fe8f7088c21a9bdTinderbox User remains stored within the HSM. Signing with the private key takes
7c112f7d8f632412901d9f3c4445eb0db6db95feTinderbox User place inside the HSM.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If you wish to generate a second key in the HSM for use
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews as a zone-signing key, follow the same procedure above, using a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews different keylabel, a smaller key size, and omitting "-f KSK"
f8eafaa4fa758a6aa19e2e858fe8f7088c21a9bdTinderbox User from the dnssec-keyfromlabel arguments:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (Note: When using OpenSSL-based PKCS#11 the label is an arbitrary
4898d4ae6072702caa8a39a702f810212bca0473Tinderbox User string which identifies the key. With native PKCS#11, the label is
4898d4ae6072702caa8a39a702f810212bca0473Tinderbox User a PKCS#11 URI string which may include other details about the key
4898d4ae6072702caa8a39a702f810212bca0473Tinderbox User and the HSM, including its PIN. See
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <a class="xref" href="man.dnssec-keyfromlabel.html" title="dnssec-keyfromlabel"><span class="refentrytitle"><span class="application">dnssec-keyfromlabel</span></span>(8)</a> for details.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>pkcs11-keygen -b 1024 -l sample-zsk</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>dnssec-keyfromlabel -l sample-zsk example.net</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Alternatively, you may prefer to generate a conventional
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews on-disk key, using dnssec-keygen:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>dnssec-keygen example.net</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This provides less security than an HSM key, but since
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews HSMs can be slow or cumbersome to use for security reasons, it
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews may be more efficient to reserve HSM keys for use in the less
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews frequent key-signing operation. The zone-signing key can be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews rolled more frequently, if you wish, to compensate for a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews reduction in key security. (Note: When using native PKCS#11,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews there is no speed advantage to using on-disk keys, as cryptographic
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews operations will be done by the HSM regardless.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Now you can sign the zone. (Note: If not using the -S
16afb24a0006e01f1b9d9256b44be035b1bb2d32Tinderbox User option to <span class="command"><strong>dnssec-signzone</strong></span>, it will be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews necessary to add the contents of both <code class="filename">K*.key</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews files to the zone master file before signing it.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>dnssec-signzone -S example.net</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsVerifying the zone using the following algorithms:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsNSEC3RSASHA1.
16afb24a0006e01f1b9d9256b44be035b1bb2d32Tinderbox UserZone signing complete:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsAlgorithm: NSEC3RSASHA1: ZSKs: 1, KSKs: 1 active, 0 revoked, 0 stand-by
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.12.11"></a>Specifying the engine on the command line</h3></div></div></div>
6b9225c4be71da5d6c426072c231a611b86459a7Tinderbox User When using OpenSSL-based PKCS#11, the "engine" to be used by
1dbe80aade5bed39893d903cf9d7318a5265813aTinderbox User OpenSSL can be specified in <span class="command"><strong>named</strong></span> and all of
632a81d4535df620c89e29c3948d1c197944570eTinderbox User the BIND <span class="command"><strong>dnssec-*</strong></span> tools by using the "-E
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <engine>" command line option. If BIND 9 is built with
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the --with-pkcs11 option, this option defaults to "pkcs11".
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Specifying the engine will generally not be necessary unless
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews for some reason you wish to use a different OpenSSL
ae454ec746d1d4db8d04e107d4d25ff13158c37fMark Andrews If you wish to disable use of the "pkcs11" engine —
1dbe80aade5bed39893d903cf9d7318a5265813aTinderbox User for troubleshooting purposes, or because the HSM is unavailable
1dbe80aade5bed39893d903cf9d7318a5265813aTinderbox User — set the engine to the empty string. For example:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$ <strong class="userinput"><code>dnssec-signzone -E '' -S example.net</code></strong>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dnssec-signzone</strong></span> to run as if it were compiled
9ff905d267731a305a37c85ca7feaf74a997f213Tinderbox User without the --with-pkcs11 option.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When built with native PKCS#11 mode, the "engine" option has a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews different meaning: it specifies the path to the PKCS#11 provider
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews library. This may be useful when testing a new provider library.
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User<div class="titlepage"><div><div><h3 class="title">
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User<a name="id-1.5.12.12"></a>Running named with automatic zone re-signing</h3></div></div></div>
3718b6ecfc40479988a9182701a4af5b3f8233f4Tinderbox User If you want <span class="command"><strong>named</strong></span> to dynamically re-sign zones
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews using HSM keys, and/or to to sign new records inserted via nsupdate,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews then <span class="command"><strong>named</strong></span> must have access to the HSM PIN. In OpenSSL-based PKCS#11,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews this is accomplished by placing the PIN into the openssl.cnf file
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (in the above examples,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">/opt/pkcs11/usr/ssl/openssl.cnf</code>).
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The location of the openssl.cnf file can be overridden by
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews setting the OPENSSL_CONF environment variable before running
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>named</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews openssl_conf = openssl_def
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews [ openssl_def ]
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews engines = engine_section
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews [ engine_section ]
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews pkcs11 = pkcs11_section
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews [ pkcs11_section ]
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews PIN = <em class="replaceable"><code><PLACE PIN HERE></code></em>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This will also allow the dnssec-* tools to access the HSM
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews without PIN entry. (The pkcs11-* tools access the HSM directly,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews not via OpenSSL, so a PIN will still be required to use
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In native PKCS#11 mode, the PIN can be provided in a file specified
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews as an attribute of the key's label. For example, if a key had the label
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <strong class="userinput"><code>pkcs11:object=local-zsk;pin-source=/etc/hsmpin</code></strong>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews then the PIN would be read from the file
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
eab4f224b546294db25e49b266cc68dd35898abdTinderbox User Placing the HSM's PIN in a text file in this manner may reduce the
d56349eff4a1ebb8f4370df5a8a507f1a8ecd0dfMark Andrews security advantage of using an HSM. Be sure this is what you want to
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews do before configuring the system in this way.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="dlz-info"></a>DLZ (Dynamically Loadable Zones)</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews DLZ (Dynamically Loadable Zones) is an extension to BIND 9 that allows
d56349eff4a1ebb8f4370df5a8a507f1a8ecd0dfMark Andrews zone data to be retrieved directly from an external database. There is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews no required format or schema. DLZ drivers exist for several different
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews database backends including PostgreSQL, MySQL, and LDAP and can be
f4e993861df6317cf0dea2ad72f315e3c96d942aMark Andrews written for any other.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Historically, DLZ drivers had to be statically linked with the <span class="command"><strong>named</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews binary and were turned on via a configure option at compile time (for
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews example, <strong class="userinput"><code>"configure --with-dlz-ldap"</code></strong>).
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Currently, the drivers provided in the BIND 9 tarball in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">contrib/dlz/drivers</code> are still linked this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In BIND 9.8 and higher, it is possible to link some DLZ modules
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dynamically at runtime, via the DLZ "dlopen" driver, which acts as a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews generic wrapper around a shared object implementing the DLZ API. The
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "dlopen" driver is linked into <span class="command"><strong>named</strong></span> by default, so configure options
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews are no longer necessary when using these dynamically linkable drivers,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews but are still needed for the older drivers in
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User <code class="filename">contrib/dlz/drivers</code>.
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User When the DLZ module provides data to <span class="command"><strong>named</strong></span>, it does so in text format.
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User The response is converted to DNS wire format by <span class="command"><strong>named</strong></span>. This
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User conversion, and the lack of any internal caching, places significant
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User limits on the query performance of DLZ modules. Consequently, DLZ is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews not recommended for use on high-volume servers. However, it can be
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User used in a hidden master configuration, with slaves retrieving zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews updates via AXFR. (Note, however, that DLZ has no built-in support for
0c9af52e8ff870126d837c52f1d30d8ad0608733Tinderbox User DNS notify; slaves are not automatically informed of changes to the
015f044f7f916eb18d053f2e5dcbee481425bc66Mark Andrews zones in the database.)
8f977d4d64b0ebe562607aaa044671ed34609978Tinderbox User<div class="titlepage"><div><div><h3 class="title">
98240f34c38524fd6d0db5a42b9d47cd95ec0fa1Tinderbox User<a name="id-1.5.13.6"></a>Configuring DLZ</h3></div></div></div>
b7f4a6fd8ac70ebf889179ee84c1dd35647bfc73Evan Hunt A DLZ database is configured with a <span class="command"><strong>dlz</strong></span>
b7f4a6fd8ac70ebf889179ee84c1dd35647bfc73Evan Hunt statement in <code class="filename">named.conf</code>:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dlz example {
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews database "dlopen driver.so <code class="option">args</code>";
b7f4a6fd8ac70ebf889179ee84c1dd35647bfc73Evan Hunt This specifies a DLZ module to search when answering queries; the
b7f4a6fd8ac70ebf889179ee84c1dd35647bfc73Evan Hunt module is implemented in <code class="filename">driver.so</code> and is
b7f4a6fd8ac70ebf889179ee84c1dd35647bfc73Evan Hunt loaded at runtime by the dlopen DLZ driver. Multiple
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>dlz</strong></span> statements can be specified; when
b7f4a6fd8ac70ebf889179ee84c1dd35647bfc73Evan Hunt answering a query, all DLZ modules with <code class="option">search</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews set to <code class="literal">yes</code> will be queried to find out if
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews they contain an answer for the query name; the best available
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews answer will be returned to the client.
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews The <code class="option">search</code> option in the above example can be
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews omitted, because <code class="literal">yes</code> is the default value.
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews If <code class="option">search</code> is set to <code class="literal">no</code>, then
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews this DLZ module is <span class="emphasis"><em>not</em></span> searched for the best
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews match when a query is received. Instead, zones in this DLZ must be
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews separately specified in a zone statement. This allows you to
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews configure a zone normally using standard zone option semantics,
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews but specify a different database back-end for storage of the
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews zone's data. For example, to implement NXDOMAIN redirection using
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews a DLZ module for back-end storage of redirection rules:
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews database "dlopen driver.so <code class="option">args</code>";
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews type redirect;
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User<div class="titlepage"><div><div><h3 class="title">
3a988722ad9e209ba4064604d482dc4efe0e19ebTinderbox User<a name="id-1.5.13.7"></a>Sample DLZ Driver</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews For guidance in implementation of DLZ modules, the directory
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">contrib/dlz/example</code> contains a basic
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dynamically-linkable DLZ module--i.e., one which can be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews loaded at runtime by the "dlopen" DLZ driver.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The example sets up a single zone, whose name is passed
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to the module as an argument in the <span class="command"><strong>dlz</strong></span>
351eca011cf38fd3272b325029afce144a9a1ebaMark Andrews In the above example, the module is configured to create a zone
351eca011cf38fd3272b325029afce144a9a1ebaMark Andrews "example.nil", which can answer queries and AXFR requests, and
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews accept DDNS updates. At runtime, prior to any updates, the zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews contains an SOA, NS, and a single A record at the apex:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews example.nil. 3600 IN SOA example.nil. hostmaster.example.nil. (
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 123 900 600 86400 3600
000b9bc9dc696babb3908802e9145562b797c1b0Tinderbox User example.nil. 1800 IN A 10.53.0.1
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt The sample driver is capable of retrieving information about the
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt querying client, and altering its response on the basis of this
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt information. To demonstrate this feature, the example driver
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt responds to queries for "source-addr.<code class="option">zonename</code>>/TXT"
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt with the source address of the query. Note, however, that this
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt record will *not* be included in AXFR or ANY responses. Normally,
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt this feature would be used to alter responses in some other fashion,
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt e.g., by providing different address records for a particular name
8a718a0c547e256edabd2c91f77ed668d1dfc7f8Evan Hunt depending on the network from which the query arrived.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Documentation of the DLZ module API can be found in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">contrib/dlz/example/README</code>. This directory also
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews contains the header file <code class="filename">dlz_minimal.h</code>, which
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews defines the API and should be included by any dynamically-linkable
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="dyndb-info"></a>DynDB (Dynamic Database)</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews DynDB is an extension to BIND 9 which, like DLZ
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User (see <a class="xref" href="Bv9ARM.ch04.html#dlz-info" title="DLZ (Dynamically Loadable Zones)">the section called “DLZ (Dynamically Loadable Zones)”</a>), allows zone data to be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews retrieved from an external database. Unlike DLZ, a DynDB module
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews provides a full-featured BIND zone database interface. Where
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews DLZ translates DNS queries into real-time database lookups,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews resulting in relatively poor query performance, and is unable
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to handle DNSSEC-signed data due to its limited API, a DynDB
08b7d0694645b474e8a57b663662c8162e7d8b8eTinderbox User module can pre-load an in-memory database from the external
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews data source, providing the same performance and functionality
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews as zones served natively by BIND.
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User A DynDB module supporting LDAP has been created by Red Hat
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and is available from
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <a class="link" href="https://fedorahosted.org/bind-dyndb-ldap/" target="_top">https://fedorahosted.org/bind-dyndb-ldap/</a>.
efdfbc256c997060cfa0c2306c4fdd9dbc31342cTinderbox User A sample DynDB module for testing and developer guidance
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is included with the BIND source code, in the directory
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">bin/tests/system/dyndb/driver</code>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.14.5"></a>Configuring DynDB</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews A DynDB database is configured with a <span class="command"><strong>dyndb</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews statement in <code class="filename">named.conf</code>:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dyndb example "driver.so" {
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <em class="replaceable"><code>parameters</code></em>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The file <code class="filename">driver.so</code> is a DynDB module which
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews implements the full DNS database API. Multiple
a5636b773fa05a272b6876afd99309c0b3090e2fMark Andrews <span class="command"><strong>dyndb</strong></span> statements can be specified, to load
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews different drivers or multiple instances of the same driver.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Zones provided by a DynDB module are added to the view's zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews table, and are treated as normal authoritative zones when BIND
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews is responding to queries. Zone configuration is handled internally
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews by the DynDB module.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <em class="replaceable"><code>parameters</code></em> are passed as an opaque
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews string to the DynDB module's initialization routine. Configuration
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews syntax will differ depending on the driver.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.14.6"></a>Sample DynDB Module</h3></div></div></div>
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User For guidance in implementation of DynDB modules, the directory
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="filename">bin/tests/system/dyndb/driver</code>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews contains a basic DynDB module.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The example sets up two zones, whose names are passed
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to the module as arguments in the <span class="command"><strong>dyndb</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews dyndb sample "sample.so" { example.nil. arpa. };
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In the above example, the module is configured to create a zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "example.nil", which can answer queries and AXFR requests, and
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User accept DDNS updates. At runtime, prior to any updates, the zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews contains an SOA, NS, and a single A record at the apex:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews example.nil. 86400 IN SOA example.nil. example.nil. (
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews 0 28800 7200 604800 86400
8fabea916f73d0b7c7371998dd041b41d1ad5296Tinderbox User example.nil. 86400 IN A 127.0.0.1
70d987def5a58ebeb8243017c0ec2e9b2c326cf4Evan Hunt When the zone is updated dynamically, the DynDB module will determine
70d987def5a58ebeb8243017c0ec2e9b2c326cf4Evan Hunt whether the updated RR is an address (i.e., type A or AAAA) and if
70d987def5a58ebeb8243017c0ec2e9b2c326cf4Evan Hunt so, it will automatically update the corresponding PTR record in a
2706fce75f04398595d9648122c6b67164e94fccTinderbox User reverse zone. (Updates are not stored permanently; all updates are
2706fce75f04398595d9648122c6b67164e94fccTinderbox User lost when the server is restarted.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="catz-info"></a>Catalog Zones</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews A "catalog zone" is a special DNS zone that contains a list of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews other zones to be served, along with their configuration parameters.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Zones listed in a catalog zone are called "member zones".
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User When a catalog zone is loaded or transferred to a slave server
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews which supports this functionality, the slave server will create
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the member zones automatically. When the catalog zone is updated
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington (for example, to add or delete member zones, or change
a5636b773fa05a272b6876afd99309c0b3090e2fMark Andrews their configuration parameters) those changes are immediately put
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews into effect. Because the catalog zone is a normal DNS zone, these
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews configuration changes can be propagated using the standard AXFR/IXFR
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone transfer mechanism.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Catalog zones' format and behavior are specified as an internet draft
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User for interoperability among DNS implementations. As of this release, the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews latest revision of the DNS catalog zones draft can be found here:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews https://datatracker.ietf.org/doc/draft-muks-dnsop-dns-catalog-zones/
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.15.4"></a>Principle of Operation</h3></div></div></div>
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User Normally, if a zone is to be served by a slave server, the
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews <code class="filename">named.conf</code> file on the server must list the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone, or the zone must be added using <span class="command"><strong>rndc addzone</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In environments with a large number of slave servers and/or where
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the zones being served are changing frequently, the overhead involved
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews in maintaining consistent zone configuration on all the slave
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews servers can be significant.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews A catalog zone is a way to ease this administrative burden. It is a
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews DNS zone that lists member zones that should be served by slave servers.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews When a slave server receives an update to the catalog zone, it adds,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews removes, or reconfigures member zones based on the data received.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To use a catalog zone, it must first be set up as a normal zone on
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the master and the on slave servers that will be configured to use
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User it. It must also be added to a <code class="option">catalog-zones</code> list
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User in the <code class="option">options</code> or <code class="option">view</code> statement
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews in <code class="filename">named.conf</code>. (This is comparable to the way
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews a policy zone is configured as a normal zone and also listed in
f7a71eef29bcbf892270460269c79664f600cffdAutomatic Updater a <code class="option">response-policy</code> statement.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews To use the catalog zone feature to serve a new member zone:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
5e145d312503505bed49bcd72d1062b82989cadaTinderbox User Set up the the member zone to be served on the master as normal.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This could be done by editing <code class="filename">named.conf</code>,
dcd42a39d311b44877161ffd1e27fa62700c0171Mark Andrews or by running <span class="command"><strong>rndc addzone</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Add an entry to the catalog zone for the new member zone.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This could be done by editing the catalog zone's master file
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and running <span class="command"><strong>rndc reload</strong></span>, or by updating
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the zone using <span class="command"><strong>nsupdate</strong></span>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The change to the catalog zone will be propagated from the master to all
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews slaves using the normal AXFR/IXFR mechanism. When the slave receives the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews update to the catalog zone, it will detect the entry for the new member
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone, create an instance of of that zone on the slave server, and point
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews that instance to the <code class="option">masters</code> specified in the catalog
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone data. The newly created member zone is a normal slave zone, so
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User BIND will immediately initiate a transfer of zone contents from the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews master. Once complete, the slave will start serving the member zone.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington Removing a member zone from a slave server requires nothing more than
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington deleting the member zone's entry in the catalog zone. The change to the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington catalog cone is propagated to the slave server using the normal AXFR/IXFR
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington transfer mechanism. The slave server, on processing the update, will
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews notice that the member zone has been removed. It will stop serving the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone and remove it from its list of configured zones. (Removing the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews member zone from the master server has to be done in the normal way,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews by editing the configuration file or running
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="command"><strong>rndc delzone</strong></span>.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h3 class="title">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="id-1.5.15.5"></a>Configuring Catalog Zones</h3></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Catalog zones are configured with a <span class="command"><strong>catalog-zones</strong></span>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews statement in the <code class="literal">options</code> or <code class="literal">view</code>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews section of <code class="filename">named.conf</code>. For example,
dda78c0f84895c174ef7206dca6082939c030792Tinderbox Usercatalog-zones {
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews default-masters { 10.53.0.1; }
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews in-memory no
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone-directory "catzones"
b625bdae12277225b076a002dd4af80902529181Tinderbox User min-update-interval 10;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This statement specifies that the zone
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="literal">catalog.example</code> is a catalog zone. This zone must be
b6561016dc8a813bfd91cef5b876b3dfc3f08ffaTinderbox User properly configured in the same view. In most configurations, it would
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews be a slave zone.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The options following the zone name are not required, and may be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews specified in any order:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <code class="option">default-masters</code> option defines the default masters
b6561016dc8a813bfd91cef5b876b3dfc3f08ffaTinderbox User for member zones listed in a catalog zone. This can be overridden by
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews options within a catalog zone. If no such options are included, then
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews member zones will transfer their contents from the servers listed in
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews this option.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <code class="option">in-memory</code> option, if set to <code class="literal">yes</code>,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews causes member zones to be stored only in memory. This is functionally
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User equivalent to configuring a slave zone without a <code class="option">file</code>.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews option. The default is <code class="literal">no</code>; member zones' content
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews will be stored locally in a file whose name is automatically generated
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews from the view name, catalog zone name, and member zone name.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <code class="option">zone-directory</code> option causes local copies of
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews member zones' master files (if <code class="option">in-memory</code> is not set
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews to <code class="literal">yes</code>) to be stored in the specified directory.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The default is to store zone files in the server's working directory.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews A non-absolute pathname in <code class="option">zone-directory</code> is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews assumed to be relative to the working directory.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The <code class="option">min-update-interval</code> option sets the minimum
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews interval between processing of updates to catalog zones, in seconds.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews If an update to a catalog zone (for example, via IXFR) happens less
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews than <code class="option">min-update-interval</code> seconds after the most
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews recent update, then the changes will not be carried out until this
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User interval has elapsed. The default is <code class="literal">5</code> seconds.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews Catalog zones are defined on a per-view basis. Configuring a non-empty
415d630b6309922caee8469384a6fab75cf05032Mark Andrews <code class="option">catalog-zones</code> statement in a view will automatically
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User turn on <code class="option">allow-new-zones</code> for that view. (Note: this
415d630b6309922caee8469384a6fab75cf05032Mark Andrews means <span class="command"><strong>rndc addzone</strong></span> and <span class="command"><strong>rndc delzone</strong></span>
620745a4c70077221fdeecaafd3252e9d3f944f3Tinderbox User will also work in any view that supports catalog zones.)
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<div class="titlepage"><div><div><h3 class="title">
620745a4c70077221fdeecaafd3252e9d3f944f3Tinderbox User<a name="id-1.5.15.6"></a>Catalog Zone format</h3></div></div></div>
415d630b6309922caee8469384a6fab75cf05032Mark Andrews A catalog zone is a regular DNS zone; therefore, it has to have a
415d630b6309922caee8469384a6fab75cf05032Mark Andrews single <code class="literal">SOA</code> and at least one <code class="literal">NS</code>
415d630b6309922caee8469384a6fab75cf05032Mark Andrews A record stating the version of the catalog zone format is
415d630b6309922caee8469384a6fab75cf05032Mark Andrews also required. If the version number listed is not supported by
415d630b6309922caee8469384a6fab75cf05032Mark Andrews the server, then a catalog zone may not be used by that server.
415d630b6309922caee8469384a6fab75cf05032Mark Andrewscatalog.example. IN SOA . . 2016022901 900 600 86400 1
415d630b6309922caee8469384a6fab75cf05032Mark Andrewscatalog.example. IN NS nsexample.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Note that this record must have the domain name
415d630b6309922caee8469384a6fab75cf05032Mark Andrews version.<em class="replaceable"><code>catalog-zone-name</code></em>. This illustrates
415d630b6309922caee8469384a6fab75cf05032Mark Andrews how the meaning of data stored in a catalog zone is indicated by the
415d630b6309922caee8469384a6fab75cf05032Mark Andrews the domain name label immediately before the catalog zone domain.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Catalog zone options can be set either globally for the whole catalog
415d630b6309922caee8469384a6fab75cf05032Mark Andrews zone or for a single member zone. Global options override the settings
415d630b6309922caee8469384a6fab75cf05032Mark Andrews in the configuration file and member zone options override global
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User Global options are set at the apex of the catalog zone, e.g.:
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater masters.catalog.example. IN AAAA 2001:db8::1
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater<p>BIND currently supports the following options:</p>
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
7f514657e26e5eb066c2be710fd64ec6bfee1475Mark Andrews<p>A simple <code class="option">masters</code> definition:</p>
5382b244c33da2a91116127313d6e8ad47175b41Tinderbox User This option defines a master server for the member zones - it
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews can be either an A or AAAA record. If multiple masters are set the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews order in which they are used is random.
7f514657e26e5eb066c2be710fd64ec6bfee1475Mark Andrews<p>A <code class="option">masters</code> with a TSIG key defined:</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews label.masters.catalog.example. IN TXT "tsig_key_name"
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This option defines a master server for the member zone with a TSIG
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews key set. The TSIG key must be configured in the configuration file.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="option">label</code> can be any valid DNS label.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <code class="option">allow-transfer</code> ACLs:</p>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews allow-query.catalog.example. IN APL 1:10.0.0.1/24
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews allow-transfer.catalog.example. IN APL !1:10.0.0.1/32 1:10.0.0.0/24
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews These options are the equivalents of <code class="option">allow-query</code>
dda78c0f84895c174ef7206dca6082939c030792Tinderbox User and <code class="option">allow-transfer</code> in a zone declaration in the
06ea55a43397bc38c34a6d7e5c6219fe483edbb2Tinderbox User <code class="filename">named.conf</code> configuration file. The ACL is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews processed in order - if there's no match to any rule the default
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews policy is to deny access. For the syntax of the APL RR see RFC
cdf1c3d486ec082ef6c92297d22d54a67cca0c90Tinderbox User A member zone is added by including a <code class="literal">PTR</code>
cdf1c3d486ec082ef6c92297d22d54a67cca0c90Tinderbox User resource record in the <code class="literal">zones</code> sub-domain of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews catalog zone. The record label is a <code class="literal">SHA-1</code> hash
f39894c0b1cafb24035c14c74868e48be25f04a5Mark Andrews of the member zone name in wire format. The target of the PTR
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews record is the member zone name. For example, to add the member
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone <code class="literal">domain.example</code>:
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews5960775ba382e7a4e09263fc06e7c00569b6a05c.zones.catalog.example. IN PTR domain.example.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews The hash is necessary to identify options for a specific member
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews zone. The member zone-specific options are defined the same way as
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews global options, but in the member zone subdomain:
dda78c0f84895c174ef7206dca6082939c030792Tinderbox Usermasters.5960775ba382e7a4e09263fc06e7c00569b6a05c.zones.catalog.example. IN A 192.0.2.2
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewslabel.masters.5960775ba382e7a4e09263fc06e7c00569b6a05c.zones.catalog.example. IN AAAA 2001:db8::2
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewslabel.masters.5960775ba382e7a4e09263fc06e7c00569b6a05c.zones.catalog.example. IN TXT "tsig_key"
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsallow-query.5960775ba382e7a4e09263fc06e7c00569b6a05c.zones.catalog.example. IN APL 1:10.0.0.0/24
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews As would be expected, options defined for a specific zone override
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews the global options defined in the catalog zone. These in turn override
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews the global options defined in the <code class="literal">catalog-zones</code>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User statement in the configuration file.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews (Note that none of the global records an option will be inherited if
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews any records are defined for that option for the specific zone. For
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews example, if the zone had a <code class="literal">masters</code> record of type
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews A but not AAAA, then it would <span class="emphasis"><em>not</em></span> inherit the
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews type AAAA record from the global option.)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<a name="ipv6"></a>IPv6 Support in <acronym class="acronym">BIND</acronym> 9</h2></div></div></div>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <acronym class="acronym">BIND</acronym> 9 fully supports all currently
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews defined forms of IPv6 name to address and address to name
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews lookups. It will also use IPv6 addresses to make queries when
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews running on an IPv6 capable system.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews For forward lookups, <acronym class="acronym">BIND</acronym> 9 supports
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews only AAAA records. RFC 3363 deprecated the use of A6 records,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews and client-side support for A6 records was accordingly removed
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews from <acronym class="acronym">BIND</acronym> 9.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews However, authoritative <acronym class="acronym">BIND</acronym> 9 name servers still
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews load zone files containing A6 records correctly, answer queries
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews for A6 records, and accept zone transfer for a zone containing A6
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews For IPv6 reverse lookups, <acronym class="acronym">BIND</acronym> 9 supports
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the traditional "nibble" format used in the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="emphasis"><em>ip6.arpa</em></span> domain, as well as the older, deprecated
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews <span class="emphasis"><em>ip6.int</em></span> domain.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Older versions of <acronym class="acronym">BIND</acronym> 9
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews supported the "binary label" (also known as "bitstring") format,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews but support of binary labels has been completely removed per
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews Many applications in <acronym class="acronym">BIND</acronym> 9 do not understand
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews the binary label format at all any more, and will return an
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews error if given.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews In particular, an authoritative <acronym class="acronym">BIND</acronym> 9
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews name server will not load a zone file containing binary labels.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews For an overview of the format and structure of IPv6 addresses,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews see <a class="xref" href="Bv9ARM.ch11.html#ipv6addresses" title="IPv6 addresses (AAAA)">the section called “IPv6 addresses (AAAA)”</a>.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<div class="titlepage"><div><div><h3 class="title">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a name="id-1.5.16.6"></a>Address Lookups Using AAAA Records</h3></div></div></div>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews The IPv6 AAAA record is a parallel to the IPv4 A record,
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User and, unlike the deprecated A6 record, specifies the entire
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews IPv6 address in a single record. For example,
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrewshost 3600 IN AAAA 2001:db8::1
415d630b6309922caee8469384a6fab75cf05032Mark Andrews Use of IPv4-in-IPv6 mapped addresses is not recommended.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews If a host has an IPv4 address, use an A record, not
415d630b6309922caee8469384a6fab75cf05032Mark Andrews a AAAA, with <code class="literal">::ffff:192.168.42.1</code> as
415d630b6309922caee8469384a6fab75cf05032Mark Andrews the address.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<div class="titlepage"><div><div><h3 class="title">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a name="id-1.5.16.7"></a>Address to Name Lookups Using Nibble Format</h3></div></div></div>
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User When looking up an address in nibble format, the address
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews components are simply reversed, just as in IPv4, and
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews <code class="literal">ip6.arpa.</code> is appended to the
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews resulting name.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews For example, the following would provide reverse name lookup for
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews a host with address
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews$ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 14400 IN PTR (
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User<table width="100%" summary="Navigation footer">
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews<a accesskey="p" href="Bv9ARM.ch03.html">Prev</a>�</td>
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews<td width="40%" align="right">�<a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<td width="40%" align="left" valign="top">Chapter�3.�Name Server Configuration�</td>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<td width="40%" align="right" valign="top">�Chapter�5.�The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</td>
3ccf87473f7cf6d9faac156df38a935a238f96fdTinderbox User<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.11.0a3</p>