Bv9ARM.ch04.html revision 5f0c46ca5f68c2148c735aa52d7541baac249c34
25cf1a301a396c38e8adf52c15f537b80d2483f7jl - Copyright (C) 2000-2015 Internet Systems Consortium, Inc. ("ISC")
25cf1a301a396c38e8adf52c15f537b80d2483f7jl - This Source Code Form is subject to the terms of the Mozilla Public
25cf1a301a396c38e8adf52c15f537b80d2483f7jl - License, v. 2.0. If a copy of the MPL was not distributed with this
25cf1a301a396c38e8adf52c15f537b80d2483f7jl - file, You can obtain one at http://mozilla.org/MPL/2.0/.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<link rel="home" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<link rel="prev" href="Bv9ARM.ch03.html" title="Chapter�3.�Name Server Configuration">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<link rel="next" href="Bv9ARM.ch05.html" title="Chapter�5.�The BIND 9 Lightweight Resolver">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<tr><th colspan="3" align="center">Chapter�4.�Advanced DNS Features</th></tr>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="Bv9ARM.ch04"></a>Chapter�4.�Advanced DNS Features</h1></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#notify">Notify</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dynamic_update">Dynamic Update</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dd><dl><dt><span class="section"><a href="Bv9ARM.ch04.html#journal">The journal file</a></span></dt></dl></dd>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#incremental_zone_transfers">Incremental Zone Transfers (IXFR)</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#split_dns">Split DNS</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dd><dl><dt><span class="section"><a href="Bv9ARM.ch04.html#split_dns_sample">Example split DNS setup</a></span></dt></dl></dd>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#tsig">TSIG</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.5">Generating a Shared Key</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.6">Loading A New Key</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.7">Instructing the Server to Use a Key</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.8">TSIG-Based Access Control</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.6.9">Errors</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#tkey">TKEY</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#sig0">SIG(0)</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#DNSSEC">DNSSEC</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec_keys">Generating Keys</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec_signing">Signing the Zone</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec_config">Configuring Servers</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dnssec.dynamic.zones">DNSSEC, Dynamic Zones, and Automatic Signing</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.3">Converting from insecure to secure</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.8">Dynamic DNS update method</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.16">Fully automatic zone signing</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.25">Private-type records</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.32">DNSKEY rollovers</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.34">Dynamic DNS update method</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.39">Automatic key rollovers</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.41">NSEC3PARAM rollovers via UPDATE</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.43">Converting from NSEC to NSEC3</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.45">Converting from NSEC3 to NSEC</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.47">Converting from secure to insecure</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.51">Periodic re-signing</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.10.53">NSEC3 and OPTOUT</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#rfc5011.support">Dynamic Trust Anchor Management</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.11.3">Validating Resolver</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.11.4">Authoritative Server</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#pkcs11">PKCS#11 (Cryptoki) support</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.6">Prerequisites</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.7">Native PKCS#11</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.8">OpenSSL-based PKCS#11</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.9">PKCS#11 Tools</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.10">Using the HSM</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.11">Specifying the engine on the command line</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.12.12">Running named with automatic zone re-signing</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dlz-info">DLZ (Dynamically Loadable Zones)</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.13.6">Configuring DLZ</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.13.7">Sample DLZ Driver</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#dyndb-info">DynDB (Dynamic Database)</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.14.5">Configuring DynDB</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.14.6">Sample DynDB Module</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#catz-info">Catalog Zones</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.15.4">Principle of Operation</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.15.5">Configuring Catalog Zones</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.15.6">Catalog Zone format</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#ipv6">IPv6 Support in <acronym class="acronym">BIND</acronym> 9</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.16.6">Address Lookups Using AAAA Records</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<dt><span class="section"><a href="Bv9ARM.ch04.html#id-1.5.16.7">Address to Name Lookups Using Nibble Format</a></span></dt>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <acronym class="acronym">DNS</acronym> NOTIFY is a mechanism that allows master
25cf1a301a396c38e8adf52c15f537b80d2483f7jl servers to notify their slave servers of changes to a zone's data. In
25cf1a301a396c38e8adf52c15f537b80d2483f7jl response to a <span class="command"><strong>NOTIFY</strong></span> from a master server, the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl slave will check to see that its version of the zone is the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl current version and, if not, initiate a zone transfer.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl For more information about <acronym class="acronym">DNS</acronym>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>NOTIFY</strong></span>, see the description of the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <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
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the description of the zone option <span class="command"><strong>also-notify</strong></span> in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <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>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl protocol is specified in RFC 1996.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl As a slave zone can also be a master to other slaves, <span class="command"><strong>named</strong></span>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl by default, sends <span class="command"><strong>NOTIFY</strong></span> messages for every zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl it loads. Specifying <span class="command"><strong>notify master-only;</strong></span> will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cause <span class="command"><strong>named</strong></span> to only send <span class="command"><strong>NOTIFY</strong></span> for master
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zones that it loads.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="dynamic_update"></a>Dynamic Update</h2></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Dynamic Update is a method for adding, replacing or deleting
25cf1a301a396c38e8adf52c15f537b80d2483f7jl records in a master server by sending it a special form of DNS
25cf1a301a396c38e8adf52c15f537b80d2483f7jl messages. The format and meaning of these messages is specified
25cf1a301a396c38e8adf52c15f537b80d2483f7jl in RFC 2136.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Dynamic update is enabled by including an
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>allow-update</strong></span> or an <span class="command"><strong>update-policy</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl clause in the <span class="command"><strong>zone</strong></span> statement.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If the zone's <span class="command"><strong>update-policy</strong></span> is set to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <strong class="userinput"><code>local</code></strong>, updates to the zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will be permitted for the key <code class="varname">local-ddns</code>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl which will be generated by <span class="command"><strong>named</strong></span> at startup.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 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.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Dynamic updates using Kerberos signed requests can be made
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>tkey-gssapi-keytab</strong></span> option, or alternatively
25cf1a301a396c38e8adf52c15f537b80d2483f7jl by setting both the <span class="command"><strong>tkey-gssapi-credential</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and <span class="command"><strong>tkey-domain</strong></span> options. Once enabled,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Kerberos signed requests will be matched against the update
25cf1a301a396c38e8adf52c15f537b80d2483f7jl policies for the zone, using the Kerberos principal as the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signer for the request.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Updating of secure zones (zones using DNSSEC) follows RFC
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 3007: RRSIG, NSEC and NSEC3 records affected by updates are
25cf1a301a396c38e8adf52c15f537b80d2483f7jl automatically regenerated by the server using an online
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone key. Update authorization is based on transaction
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signatures and an explicit server policy.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="journal"></a>The journal file</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl All changes made to a zone using dynamic update are stored
25cf1a301a396c38e8adf52c15f537b80d2483f7jl in the zone's journal file. This file is automatically created
25cf1a301a396c38e8adf52c15f537b80d2483f7jl by the server when the first dynamic update takes place.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The name of the journal file is formed by appending the extension
25cf1a301a396c38e8adf52c15f537b80d2483f7jl corresponding zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl file unless specifically overridden. The journal file is in a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl binary format and should not be edited manually.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The server will also occasionally write ("dump")
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the complete contents of the updated zone to its zone file.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This is not done immediately after
25cf1a301a396c38e8adf52c15f537b80d2483f7jl each dynamic update, because that would be too slow when a large
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone is updated frequently. Instead, the dump is delayed by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl up to 15 minutes, allowing additional updates to take place.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl During the dump process, transient files will be created
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the extensions <code class="filename">.jnw</code> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">.jbk</code>; under ordinary circumstances, these
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will be removed when the dump is complete, and can be safely
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When a server is restarted after a shutdown or crash, it will replay
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the journal file to incorporate into the zone any updates that
25cf1a301a396c38e8adf52c15f537b80d2483f7jl place after the last zone dump.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Changes that result from incoming incremental zone transfers are
25cf1a301a396c38e8adf52c15f537b80d2483f7jl journalled in a similar way.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The zone files of dynamic zones cannot normally be edited by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl hand because they are not guaranteed to contain the most recent
25cf1a301a396c38e8adf52c15f537b80d2483f7jl dynamic changes — those are only in the journal file.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The only way to ensure that the zone file of a dynamic zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is up to date is to run <span class="command"><strong>rndc stop</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If you have to make changes to a dynamic zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl manually, the following procedure will work:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Disable dynamic updates to the zone using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc freeze <em class="replaceable"><code>zone</code></em></strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This will update the zone's master file with the changes
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Edit the zone file. Run
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc thaw <em class="replaceable"><code>zone</code></em></strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to reload the changed zone and re-enable dynamic updates.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc sync <em class="replaceable"><code>zone</code></em></strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will update the zone file with changes from the journal file
25cf1a301a396c38e8adf52c15f537b80d2483f7jl without stopping dynamic updates; this may be useful for viewing
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the current zone state. To remove the <code class="filename">.jnl</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl file after updating the zone file, use
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc sync -clean</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="incremental_zone_transfers"></a>Incremental Zone Transfers (IXFR)</h2></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The incremental zone transfer (IXFR) protocol is a way for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl slave servers to transfer only changed data, instead of having to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl transfer the entire zone. The IXFR protocol is specified in RFC
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 1995. See <a class="xref" href="Bv9ARM.ch11.html#proposed_standards" title="Proposed Standards">Proposed Standards</a>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When acting as a master, <acronym class="acronym">BIND</acronym> 9
25cf1a301a396c38e8adf52c15f537b80d2483f7jl supports IXFR for those zones
25cf1a301a396c38e8adf52c15f537b80d2483f7jl where the necessary change history information is available. These
25cf1a301a396c38e8adf52c15f537b80d2483f7jl include master zones maintained by dynamic update and slave zones
25cf1a301a396c38e8adf52c15f537b80d2483f7jl whose data was obtained by IXFR. For manually maintained master
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zones, and for slave zones obtained by performing a full zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl transfer (AXFR), IXFR is supported only if the option
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>ixfr-from-differences</strong></span> is set
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When acting as a slave, <acronym class="acronym">BIND</acronym> 9 will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl attempt to use IXFR unless
25cf1a301a396c38e8adf52c15f537b80d2483f7jl it is explicitly disabled. For more information about disabling
25cf1a301a396c38e8adf52c15f537b80d2483f7jl IXFR, see the description of the <span class="command"><strong>request-ixfr</strong></span> clause
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of the <span class="command"><strong>server</strong></span> statement.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Setting up different views, or visibility, of the DNS space to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl internal and external resolvers is usually referred to as a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="emphasis"><em>Split DNS</em></span> setup. There are several
25cf1a301a396c38e8adf52c15f537b80d2483f7jl reasons an organization would want to set up its DNS this way.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl One common reason for setting up a DNS system this way is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to hide "internal" DNS information from "external" clients on the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Internet. There is some debate as to whether or not this is actually
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Internal DNS information leaks out in many ways (via email headers,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for example) and most savvy "attackers" can find the information
25cf1a301a396c38e8adf52c15f537b80d2483f7jl they need using other means.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl However, since listing addresses of internal servers that
25cf1a301a396c38e8adf52c15f537b80d2483f7jl external clients cannot possibly reach can result in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl connection delays and other annoyances, an organization may
25cf1a301a396c38e8adf52c15f537b80d2483f7jl choose to use a Split DNS to present a consistent view of itself
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to the outside world.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Another common reason for setting up a Split DNS system is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to allow internal networks that are behind filters or in RFC 1918
25cf1a301a396c38e8adf52c15f537b80d2483f7jl space (reserved IP space, as documented in RFC 1918) to resolve DNS
25cf1a301a396c38e8adf52c15f537b80d2483f7jl on the Internet. Split DNS can also be used to allow mail from outside
25cf1a301a396c38e8adf52c15f537b80d2483f7jl back in to the internal network.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="split_dns_sample"></a>Example split DNS setup</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Let's say a company named <span class="emphasis"><em>Example, Inc.</em></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl has several corporate sites that have an internal network with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Internet Protocol (IP) space and an external demilitarized zone (DMZ),
25cf1a301a396c38e8adf52c15f537b80d2483f7jl or "outside" section of a network, that is available to the public.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="emphasis"><em>Example, Inc.</em></span> wants its internal clients
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to be able to resolve external hostnames and to exchange mail with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl people on the outside. The company also wants its internal resolvers
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to have access to certain internal-only zones that are not available
25cf1a301a396c38e8adf52c15f537b80d2483f7jl at all outside of the internal network.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In order to accomplish this, the company will set up two sets
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of name servers. One set will be on the inside network (in the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl IP space) and the other set will be on bastion hosts, which are
25cf1a301a396c38e8adf52c15f537b80d2483f7jl hosts that can talk to both sides of its network, in the DMZ.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The internal servers will be configured to forward all queries,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl except queries for <code class="filename">site1.internal</code>, <code class="filename">site2.internal</code>, <code class="filename">site1.example.com</code>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and <code class="filename">site2.example.com</code>, to the servers
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DMZ. These internal servers will have complete sets of information
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for <code class="filename">site1.example.com</code>, <code class="filename">site2.example.com</code>, <code class="filename">site1.internal</code>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To protect the <code class="filename">site1.internal</code> and <code class="filename">site2.internal</code> domains,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the internal name servers must be configured to disallow all queries
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to these domains from any external hosts, including the bastion
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The external servers, which are on the bastion hosts, will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be configured to serve the "public" version of the <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This could include things such as the host records for public servers
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (<code class="filename">www.example.com</code> and <code class="filename">ftp.example.com</code>),
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and mail exchange (MX) records (<code class="filename">a.mx.example.com</code> and <code class="filename">b.mx.example.com</code>).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In addition, the public <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones
25cf1a301a396c38e8adf52c15f537b80d2483f7jl should have special MX records that contain wildcard (`*') records
25cf1a301a396c38e8adf52c15f537b80d2483f7jl pointing to the bastion hosts. This is needed because external mail
25cf1a301a396c38e8adf52c15f537b80d2483f7jl servers do not have any other way of looking up how to deliver mail
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to those internal hosts. With the wildcard records, the mail will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be delivered to the bastion host, which can then forward it on to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl internal hosts.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Here's an example of a wildcard MX record:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<pre class="programlisting">* IN MX 10 external1.example.com.</pre>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Now that they accept mail on behalf of anything in the internal
25cf1a301a396c38e8adf52c15f537b80d2483f7jl network, the bastion hosts will need to know how to deliver mail
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to internal hosts. In order for this to work properly, the resolvers
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the bastion hosts will need to be configured to point to the internal
25cf1a301a396c38e8adf52c15f537b80d2483f7jl name servers for DNS resolution.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Queries for internal hostnames will be answered by the internal
25cf1a301a396c38e8adf52c15f537b80d2483f7jl servers, and queries for external hostnames will be forwarded back
25cf1a301a396c38e8adf52c15f537b80d2483f7jl out to the DNS servers on the bastion hosts.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In order for all this to work properly, internal clients will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl need to be configured to query <span class="emphasis"><em>only</em></span> the internal
25cf1a301a396c38e8adf52c15f537b80d2483f7jl name servers for DNS queries. This could also be enforced via
25cf1a301a396c38e8adf52c15f537b80d2483f7jl filtering on the network.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If everything has been set properly, <span class="emphasis"><em>Example, Inc.</em></span>'s
25cf1a301a396c38e8adf52c15f537b80d2483f7jl internal clients will now be able to:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Look up any hostnames in the <code class="literal">site1</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Look up any hostnames in the <code class="literal">site1.internal</code> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<li class="listitem">Look up any hostnames on the Internet.</li>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<li class="listitem">Exchange mail with both internal and external people.</li>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Hosts on the Internet will be able to:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Look up any hostnames in the <code class="literal">site1</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Exchange mail with anyone in the <code class="literal">site1</code> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Here is an example configuration for the setup we just
25cf1a301a396c38e8adf52c15f537b80d2483f7jl described above. Note that this is only configuration information;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 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>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Internal DNS server config:
25cf1a301a396c38e8adf52c15f537b80d2483f7jlacl externals { <code class="varname">bastion-ips-go-here</code>; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forward only;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // forward to external servers
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forwarders {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // sample allow-transfer (no one)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { none; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // restrict query access
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query { internals; externals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // restrict recursion
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-recursion { internals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl// sample master zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type master;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // do normal iterative resolution (do not forward)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forwarders { };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query { internals; externals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { internals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl// sample slave zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type slave;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl masters { 172.16.72.3; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forwarders { };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query { internals; externals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { internals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type master;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forwarders { };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query { internals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { internals; }
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type slave;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl masters { 172.16.72.3; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forwarders { };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query { internals };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { internals; }
25cf1a301a396c38e8adf52c15f537b80d2483f7jl External (bastion host) DNS server config:
25cf1a301a396c38e8adf52c15f537b80d2483f7jlacl externals { bastion-ips-go-here; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // sample allow-transfer (no one)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { none; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // default query access
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query { any; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // restrict cache access
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-query-cache { internals; externals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // restrict recursion
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-recursion { internals; externals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl// sample slave zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type master;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { internals; externals; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type slave;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl masters { another_bastion_host_maybe; };
25cf1a301a396c38e8adf52c15f537b80d2483f7jl allow-transfer { internals; externals; }
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In the <code class="filename">resolv.conf</code> (or equivalent) on
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the bastion host(s):
25cf1a301a396c38e8adf52c15f537b80d2483f7jlnameserver 172.16.72.2
25cf1a301a396c38e8adf52c15f537b80d2483f7jlnameserver 172.16.72.3
25cf1a301a396c38e8adf52c15f537b80d2483f7jlnameserver 172.16.72.4
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TSIG (Transaction SIGnatures) is a mechanism for authenticating DNS
25cf1a301a396c38e8adf52c15f537b80d2483f7jl messages, originally specified in RFC 2845. It allows DNS messages
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to be cryptographically signed using a shared secret. TSIG can
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be used in any DNS transaction, as a way to restrict access to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl certain server functions (e.g., recursive queries) to authorized
25cf1a301a396c38e8adf52c15f537b80d2483f7jl clients when IP-based access control is insufficient or needs to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be overridden, or as a way to ensure message authenticity when it
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is critical to the integrity of the server, such as with dynamic
25cf1a301a396c38e8adf52c15f537b80d2483f7jl UPDATE messages or zone transfers from a master to a slave server.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This is a guide to setting up TSIG in <acronym class="acronym">BIND</acronym>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl It describes the configuration syntax and the process of creating
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TSIG keys.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> supports TSIG for server-to-server
25cf1a301a396c38e8adf52c15f537b80d2483f7jl communication, and some of the tools included with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <acronym class="acronym">BIND</acronym> support it for sending messages to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a class="xref" href="man.nsupdate.html" title="nsupdate"><span class="refentrytitle"><span class="application">nsupdate</span></span>(1)</a> supports TSIG via the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="option">-k</code>, <code class="option">-l</code> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="option">-y</code> command line options, or via
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the <span class="command"><strong>key</strong></span> command when running
25cf1a301a396c38e8adf52c15f537b80d2483f7jl interactively.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a class="xref" href="man.dig.html" title="dig"><span class="refentrytitle">dig</span>(1)</a> supports TSIG via the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="option">-k</code> and <code class="option">-y</code> command
25cf1a301a396c38e8adf52c15f537b80d2483f7jl line options.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.6.5"></a>Generating a Shared Key</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TSIG keys can be generated using the <span class="command"><strong>tsig-keygen</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl command; the output of the command is a <span class="command"><strong>key</strong></span> directive
25cf1a301a396c38e8adf52c15f537b80d2483f7jl suitable for inclusion in <code class="filename">named.conf</code>. The
25cf1a301a396c38e8adf52c15f537b80d2483f7jl key name, algorithm and size can be specified by command line parameters;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the defaults are "tsig-key", HMAC-SHA256, and 256 bits, respectively.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Any string which is a valid DNS name can be used as a key name.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl For example, a key to be shared between servers called
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host2</em></span> could
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be called "host1-host2.", and this key could be generated using:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl $ tsig-keygen host1-host2. > host1-host2.key
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This key may then be copied to both hosts. The key name and secret
25cf1a301a396c38e8adf52c15f537b80d2483f7jl must be identical on both hosts.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (Note: copying a shared secret from one server to another is beyond
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the scope of the DNS. A secure transport mechanism should be used:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl secure FTP, SSL, ssh, telephone, encrypted email, etc.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>tsig-keygen</strong></span> can also be run as
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>ddns-confgen</strong></span>, in which case its output includes
25cf1a301a396c38e8adf52c15f537b80d2483f7jl additional configuration text for setting up dynamic DNS in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <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>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for details.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.6.6"></a>Loading A New Key</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl For a key shared between servers called
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host2</em></span>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the following could be added to each server's
25cf1a301a396c38e8adf52c15f537b80d2483f7jlkey "host1-host2." {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl algorithm hmac-sha256;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl secret "DAopyf1mhCbFVZw7pgmNPBoLUq8wEUT7UuPoLENP2HY=";
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (This is the same key generated above using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>tsig-keygen</strong></span>.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Since this text contains a secret, it
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is recommended that either <code class="filename">named.conf</code> not be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl world-readable, or that the <span class="command"><strong>key</strong></span> directive
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be stored in a file which is not world-readable, and which is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl included in <code class="filename">named.conf</code> via the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>include</strong></span> directive.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Once a key has been added to <code class="filename">named.conf</code> and the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl server has been restarted or reconfigured, the server can recognize
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the key. If the server receives a message signed by the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl key, it will be able to verify the signature. If the signature
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is valid, the response will be signed using the same key.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TSIG keys that are known to a server can be listed using the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl command <span class="command"><strong>rndc tsig-list</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.6.7"></a>Instructing the Server to Use a Key</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl A server sending a request to another server must be told whether
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to use a key, and if so, which key to use.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl For example, a key may be specified for each server in the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>masters</strong></span> statement in the definition of a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl slave zone; in this case, all SOA QUERY messages, NOTIFY
25cf1a301a396c38e8adf52c15f537b80d2483f7jl messages, and zone transfer requests (AXFR or IXFR) will be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signed using the specified key. Keys may also be specified
25cf1a301a396c38e8adf52c15f537b80d2483f7jl in the <span class="command"><strong>also-notify</strong></span> statement of a master
25cf1a301a396c38e8adf52c15f537b80d2483f7jl or slave zone, causing NOTIFY messages to be signed using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the specified key.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Keys can also be specified in a <span class="command"><strong>server</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl directive. Adding the following on <span class="emphasis"><em>host1</em></span>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if the IP address of <span class="emphasis"><em>host2</em></span> is 10.1.2.3, would
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cause <span class="emphasis"><em>all</em></span> requests from <span class="emphasis"><em>host1</em></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to <span class="emphasis"><em>host2</em></span>, including normal DNS queries, to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signed using the <span class="command"><strong>host1-host2.</strong></span> key:
25cf1a301a396c38e8adf52c15f537b80d2483f7jlserver 10.1.2.3 {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl keys { host1-host2. ;};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Multiple keys may be present in the <span class="command"><strong>keys</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl statement, but only the first one is used. As this directive does
25cf1a301a396c38e8adf52c15f537b80d2483f7jl not contain secrets, it can be used in a world-readable file.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Requests sent by <span class="emphasis"><em>host2</em></span> to <span class="emphasis"><em>host1</em></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl would <span class="emphasis"><em>not</em></span> be signed, unless a similar
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>server</strong></span> directive were in <span class="emphasis"><em>host2</em></span>'s
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configuration file.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Whenever any server sends a TSIG-signed DNS request, it will expect
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the response to be signed with the same key. If a response is not
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signed, or if the signature is not valid, the response will be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.6.8"></a>TSIG-Based Access Control</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TSIG keys may be specified in ACL definitions and ACL directives
25cf1a301a396c38e8adf52c15f537b80d2483f7jl such as <span class="command"><strong>allow-query</strong></span>, <span class="command"><strong>allow-transfer</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and <span class="command"><strong>allow-update</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The above key would be denoted in an ACL element as
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>key host1-host2.</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl An example of an <span class="command"><strong>allow-update</strong></span> directive using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a TSIG key:
25cf1a301a396c38e8adf52c15f537b80d2483f7jlallow-update { !{ !localnets; any; }; key host1-host2. ;};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This allows dynamic updates to succeed only if the UPDATE
25cf1a301a396c38e8adf52c15f537b80d2483f7jl request comes from an address in <span class="command"><strong>localnets</strong></span>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="emphasis"><em>and</em></span> if it is signed using the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>host1-host2.</strong></span> key.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 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
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the more flexible <span class="command"><strong>update-policy</strong></span> statement.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Processing of TSIG-signed messages can result in several errors:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If a TSIG-aware server receives a message signed by an
25cf1a301a396c38e8adf52c15f537b80d2483f7jl unknown key, the response will be unsigned, with the TSIG
25cf1a301a396c38e8adf52c15f537b80d2483f7jl extended error code set to BADKEY.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If a TSIG-aware server receives a message from a known key
25cf1a301a396c38e8adf52c15f537b80d2483f7jl but with an invalid signature, the response will be unsigned,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the TSIG extended error code set to BADSIG.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If a TSIG-aware server receives a message with a time
25cf1a301a396c38e8adf52c15f537b80d2483f7jl outside of the allowed range, the response will be signed, with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the TSIG extended error code set to BADTIME, and the time values
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will be adjusted so that the response can be successfully
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In all of the above cases, the server will return a response code
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of NOTAUTH (not authenticated).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TKEY (Transaction KEY) is a mechanism for automatically negotiating
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a shared secret between two hosts, originally specified in RFC 2930.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl There are several TKEY "modes" that specify how a key is to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl generated or assigned. <acronym class="acronym">BIND</acronym> 9 implements only
25cf1a301a396c38e8adf52c15f537b80d2483f7jl one of these modes: Diffie-Hellman key exchange. Both hosts are
25cf1a301a396c38e8adf52c15f537b80d2483f7jl required to have a KEY record with algorithm DH (though this
25cf1a301a396c38e8adf52c15f537b80d2483f7jl record is not required to be present in a zone).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The TKEY process is initiated by a client or server by sending
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a query of type TKEY to a TKEY-aware server. The query must include
25cf1a301a396c38e8adf52c15f537b80d2483f7jl an appropriate KEY record in the additional section, and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl must be signed using either TSIG or SIG(0) with a previously
25cf1a301a396c38e8adf52c15f537b80d2483f7jl established key. The server's response, if successful, will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl contain a TKEY record in its answer section. After this transaction,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl both participants will have enough information to calculate a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl shared secret using Diffie-Hellman key exchange. The shared secret
25cf1a301a396c38e8adf52c15f537b80d2483f7jl can then be used by to sign subsequent transactions between the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl two servers.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TSIG keys known by the server, including TKEY-negotiated keys, can
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be listed using <span class="command"><strong>rndc tsig-list</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TKEY-negotiated keys can be deleted from a server using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc tsig-delete</strong></span>. This can also be done via
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the TKEY protocol itself, by sending an authenticated TKEY query
25cf1a301a396c38e8adf52c15f537b80d2483f7jl specifying the "key deletion" mode.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <acronym class="acronym">BIND</acronym> partially supports DNSSEC SIG(0)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl transaction signatures as specified in RFC 2535 and RFC 2931.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SIG(0) uses public/private keys to authenticate messages. Access control
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is performed in the same manner as TSIG keys; privileges can be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl granted or denied in ACL directives based on the key name.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When a SIG(0) signed message is received, it will only be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl verified if the key is known and trusted by the server. The
25cf1a301a396c38e8adf52c15f537b80d2483f7jl server will not attempt to recursively fetch or validate the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SIG(0) signing of multiple-message TCP streams is not supported.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The only tool shipped with <acronym class="acronym">BIND</acronym> 9 that
25cf1a301a396c38e8adf52c15f537b80d2483f7jl generates SIG(0) signed messages is <span class="command"><strong>nsupdate</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Cryptographic authentication of DNS information is possible
25cf1a301a396c38e8adf52c15f537b80d2483f7jl through the DNS Security (<span class="emphasis"><em>DNSSEC-bis</em></span>) extensions,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl defined in RFC 4033, RFC 4034, and RFC 4035.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This section describes the creation and use of DNSSEC signed zones.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In order to set up a DNSSEC secure zone, there are a series
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of steps which must be followed. <acronym class="acronym">BIND</acronym>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with several tools
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that are used in this process, which are explained in more detail
25cf1a301a396c38e8adf52c15f537b80d2483f7jl below. In all cases, the <code class="option">-h</code> option prints a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl full list of parameters. Note that the DNSSEC tools require the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl keyset files to be in the working directory or the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl directory specified by the <code class="option">-d</code> option, and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that the tools shipped with BIND 9.2.x and earlier are not compatible
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the current ones.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl There must also be communication with the administrators of
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the parent and/or child zone to transmit keys. A zone's security
25cf1a301a396c38e8adf52c15f537b80d2483f7jl status must be indicated by the parent zone for a DNSSEC capable
25cf1a301a396c38e8adf52c15f537b80d2483f7jl resolver to trust its data. This is done through the presence
25cf1a301a396c38e8adf52c15f537b80d2483f7jl or absence of a <code class="literal">DS</code> record at the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl delegation
25cf1a301a396c38e8adf52c15f537b80d2483f7jl For other servers to trust data in this zone, they must
25cf1a301a396c38e8adf52c15f537b80d2483f7jl either be statically configured with this zone's zone key or the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone key of another zone above this one in the DNS tree.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="dnssec_keys"></a>Generating Keys</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The <span class="command"><strong>dnssec-keygen</strong></span> program is used to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl generate keys.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl A secure zone must contain one or more zone keys. The
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone keys will sign all other records in the zone, as well as
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the zone keys of any secure delegated zones. Zone keys must
25cf1a301a396c38e8adf52c15f537b80d2483f7jl have the same name as the zone, a name type of
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>ZONE</strong></span>, and must be usable for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl authentication.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl It is recommended that zone keys use a cryptographic algorithm
25cf1a301a396c38e8adf52c15f537b80d2483f7jl designated as "mandatory to implement" by the IETF; currently
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the only one is RSASHA1.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The following command will generate a 768-bit RSASHA1 key for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <strong class="userinput"><code>dnssec-keygen -a RSASHA1 -b 768 -n ZONE child.example.</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Two output files will be produced:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">Kchild.example.+005+12345.key</code> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">Kchild.example.+005+12345.private</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 12345 is an example of a key tag). The key filenames contain
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the key name (<code class="filename">child.example.</code>),
25cf1a301a396c38e8adf52c15f537b80d2483f7jl algorithm (3
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is DSA, 1 is RSAMD5, 5 is RSASHA1, etc.), and the key tag (12345 in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl this case).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The private key (in the <code class="filename">.private</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl used to generate signatures, and the public key (in the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">.key</code> file) is used for signature
25cf1a301a396c38e8adf52c15f537b80d2483f7jl verification.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To generate another key with the same properties (but with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a different key tag), repeat the above command.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The <span class="command"><strong>dnssec-keyfromlabel</strong></span> program is used
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to get a key pair from a crypto hardware and build the key
25cf1a301a396c38e8adf52c15f537b80d2483f7jl files. Its usage is similar to <span class="command"><strong>dnssec-keygen</strong></span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The public keys should be inserted into the zone file by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl including the <code class="filename">.key</code> files using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>$INCLUDE</strong></span> statements.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="dnssec_signing"></a>Signing the Zone</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The <span class="command"><strong>dnssec-signzone</strong></span> program is used
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to sign a zone.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Any <code class="filename">keyset</code> files corresponding to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl secure subzones should be present. The zone signer will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl generate <code class="literal">NSEC</code>, <code class="literal">NSEC3</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and <code class="literal">RRSIG</code> records for the zone, as
25cf1a301a396c38e8adf52c15f537b80d2483f7jl well as <code class="literal">DS</code> for the child zones if
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="literal">'-g'</code> is specified. If <code class="literal">'-g'</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is not specified, then DS RRsets for the secure child
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zones need to be added manually.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The following command signs the zone, assuming it is in a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl file called <code class="filename">zone.child.example</code>. By
25cf1a301a396c38e8adf52c15f537b80d2483f7jl default, all zone keys which have an available private key are
25cf1a301a396c38e8adf52c15f537b80d2483f7jl used to generate signatures.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <strong class="userinput"><code>dnssec-signzone -o child.example zone.child.example</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl One output file is produced:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">zone.child.example.signed</code>. This
25cf1a301a396c38e8adf52c15f537b80d2483f7jl should be referenced by <code class="filename">named.conf</code>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl input file for the zone.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p><span class="command"><strong>dnssec-signzone</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will also produce a keyset and dsset files and optionally a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl dlvset file. These are used to provide the parent zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl administrators with the <code class="literal">DNSKEYs</code> (or their
25cf1a301a396c38e8adf52c15f537b80d2483f7jl corresponding <code class="literal">DS</code> records) that are the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl secure entry point to the zone.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="dnssec_config"></a>Configuring Servers</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To enable <span class="command"><strong>named</strong></span> to respond appropriately
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to DNS requests from DNSSEC aware clients,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-enable</strong></span> must be set to yes.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (This is the default setting.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To enable <span class="command"><strong>named</strong></span> to validate answers from
25cf1a301a396c38e8adf52c15f537b80d2483f7jl other servers, the <span class="command"><strong>dnssec-enable</strong></span> option
25cf1a301a396c38e8adf52c15f537b80d2483f7jl must be set to <strong class="userinput"><code>yes</code></strong>, and the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-validation</strong></span> options must be set to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <strong class="userinput"><code>yes</code></strong> or <strong class="userinput"><code>auto</code></strong>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If <span class="command"><strong>dnssec-validation</strong></span> is set to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <strong class="userinput"><code>auto</code></strong>, then a default
25cf1a301a396c38e8adf52c15f537b80d2483f7jl trust anchor for the DNS root zone will be used.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If it is set to <strong class="userinput"><code>yes</code></strong>, however,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl then at least one trust anchor must be configured
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with a <span class="command"><strong>trusted-keys</strong></span> or
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>managed-keys</strong></span> statement in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">named.conf</code>, or DNSSEC validation
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will not occur. The default setting is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>trusted-keys</strong></span> are copies of DNSKEY RRs
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for zones that are used to form the first link in the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cryptographic chain of trust. All keys listed in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>trusted-keys</strong></span> (and corresponding zones)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl are deemed to exist and only the listed keys will be used
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to validated the DNSKEY RRset that they are from.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>managed-keys</strong></span> are trusted keys which are
25cf1a301a396c38e8adf52c15f537b80d2483f7jl automatically kept up to date via RFC 5011 trust anchor
25cf1a301a396c38e8adf52c15f537b80d2483f7jl maintenance.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>trusted-keys</strong></span> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>managed-keys</strong></span> are described in more detail
25cf1a301a396c38e8adf52c15f537b80d2483f7jl later in this document.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Unlike <acronym class="acronym">BIND</acronym> 8, <acronym class="acronym">BIND</acronym>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 9 does not verify signatures on load, so zone keys for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl authoritative zones do not need to be specified in the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configuration file.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl After DNSSEC gets established, a typical DNSSEC configuration
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will look something like the following. It has one or
25cf1a301a396c38e8adf52c15f537b80d2483f7jl more public keys for the root. This allows answers from
25cf1a301a396c38e8adf52c15f537b80d2483f7jl outside the organization to be validated. It will also
25cf1a301a396c38e8adf52c15f537b80d2483f7jl have several keys for parts of the namespace the organization
25cf1a301a396c38e8adf52c15f537b80d2483f7jl controls. These are here to ensure that <span class="command"><strong>named</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is immune to compromises in the DNSSEC components of the security
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of parent zones.
25cf1a301a396c38e8adf52c15f537b80d2483f7jlmanaged-keys {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl /* Root Key */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "." initial-key 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwS
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 66gKodQj+MiA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ
25cf1a301a396c38e8adf52c15f537b80d2483f7jl dgxbcDTClU0CRBdiieyLMNzXG3";
25cf1a301a396c38e8adf52c15f537b80d2483f7jltrusted-keys {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl /* Key for our organization's forward zone */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM6
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 5KbhTjrW1ZaARmPhEZZe3Y9ifgEuq7vZ/z
25cf1a301a396c38e8adf52c15f537b80d2483f7jl GZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 4JKUbbOTcM8pwXlj0EiX3oDFVmjHO444gL
25cf1a301a396c38e8adf52c15f537b80d2483f7jl g4ywzO9WglMk7jbfW33gUKvirTHr25GL7S
25cf1a301a396c38e8adf52c15f537b80d2483f7jl TQUzBb5Usxt8lgnyTUHs1t3JwCY5hKZ6Cq
25cf1a301a396c38e8adf52c15f537b80d2483f7jl F4qJCyduieHukuY3H4XMAcR+xia2nIUPvm
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 1OTQ09A0=";
25cf1a301a396c38e8adf52c15f537b80d2483f7jl /* Key for our reverse zone. */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl xOdNax071L18QqZnQQQAVVr+i
25cf1a301a396c38e8adf52c15f537b80d2483f7jl LhGTnNGp3HoWQLUIzKrJVZ3zg
25cf1a301a396c38e8adf52c15f537b80d2483f7jl gy3WwNT6kZo6c0tszYqbtvchm
25cf1a301a396c38e8adf52c15f537b80d2483f7jl siaOdS0yOI6BgPsw+YZdzlYMa
25cf1a301a396c38e8adf52c15f537b80d2483f7jl IJGf4M4dyoKIhzdZyQ2bYQrjy
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Q4LB0lC7aOnsMyYKHHYeRvPxj
25cf1a301a396c38e8adf52c15f537b80d2483f7jl IQXmdqgOJGq+vsevG06zW+1xg
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 59VvjSPsZJHeDCUyWYrvPZesZ
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DIRvhDD52SKvbheeTJUm6Ehkz
25cf1a301a396c38e8adf52c15f537b80d2483f7jl dnssec-enable yes;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl dnssec-validation yes;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl None of the keys listed in this example are valid. In particular,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the root key is not valid.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When DNSSEC validation is enabled and properly configured,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the resolver will reject any answers from signed, secure zones
25cf1a301a396c38e8adf52c15f537b80d2483f7jl which fail to validate, and will return SERVFAIL to the client.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Responses may fail to validate for any of several reasons,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl including missing, expired, or invalid signatures, a key which
25cf1a301a396c38e8adf52c15f537b80d2483f7jl does not match the DS RRset in the parent zone, or an insecure
25cf1a301a396c38e8adf52c15f537b80d2483f7jl response from a zone which, according to its parent, should have
25cf1a301a396c38e8adf52c15f537b80d2483f7jl been secure.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When the validator receives a response from an unsigned zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that has a signed parent, it must confirm with the parent
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that the zone was intentionally left unsigned. It does
25cf1a301a396c38e8adf52c15f537b80d2483f7jl this by verifying, via signed and validated NSEC/NSEC3 records,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that the parent zone contains no DS records for the child.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If the validator <span class="emphasis"><em>can</em></span> prove that the zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is insecure, then the response is accepted. However, if it
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cannot, then it must assume an insecure response to be a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl forgery; it rejects the response and logs an error.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The logged error reads "insecurity proof failed" and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "got insecure response; parent indicates it should be secure".
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (Prior to BIND 9.7, the logged error was "not insecure".
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This referred to the zone, not the response.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="dnssec.dynamic.zones"></a>DNSSEC, Dynamic Zones, and Automatic Signing</h2></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>As of BIND 9.7.0 it is possible to change a dynamic zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl from insecure to signed and back again. A secure zone can use
25cf1a301a396c38e8adf52c15f537b80d2483f7jl either NSEC or NSEC3 chains.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.3"></a>Converting from insecure to secure</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Changing a zone from insecure to secure can be done in two
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ways: using a dynamic DNS update, or the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec</strong></span> zone option.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>For either method, you need to configure
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> so that it can see the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="filename">K*</code> files which contain the public and private
25cf1a301a396c38e8adf52c15f537b80d2483f7jl parts of the keys that will be used to sign the zone. These files
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will have been generated by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-keygen</strong></span>. You can do this by placing them
25cf1a301a396c38e8adf52c15f537b80d2483f7jl in the key-directory, as specified in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl type master;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl update-policy local;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>If one KSK and one ZSK DNSKEY key have been generated, this
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configuration will cause all records in the zone to be signed
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the ZSK, and the DNSKEY RRset to be signed with the KSK as
25cf1a301a396c38e8adf52c15f537b80d2483f7jl well. An NSEC chain will be generated as part of the initial
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signing process.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.8"></a>Dynamic DNS update method</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl % nsupdate
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > ttl 3600
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>While the update request will complete almost immediately,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the zone will not be completely signed until
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> has had time to walk the zone and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl generate the NSEC and RRSIG records. The NSEC record at the apex
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will be added last, to signal that there is a complete NSEC
25cf1a301a396c38e8adf52c15f537b80d2483f7jl chain.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>If you wish to sign using NSEC3 instead of NSEC, you should
25cf1a301a396c38e8adf52c15f537b80d2483f7jl add an NSEC3PARAM record to the initial update request. If you
25cf1a301a396c38e8adf52c15f537b80d2483f7jl wish the NSEC3 chain to have the OPTOUT bit set, set it in the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl flags field of the NSEC3PARAM record.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl % nsupdate
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > ttl 3600
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
25cf1a301a396c38e8adf52c15f537b80d2483f7jl > update add example.net NSEC3PARAM 1 1 100 1234567890
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Again, this update request will complete almost
25cf1a301a396c38e8adf52c15f537b80d2483f7jl immediately; however, the record won't show up until
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> has had a chance to build/remove the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl relevant chain. A private type record will be created to record
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the state of the operation (see below for more details), and will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be removed once the operation completes.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>While the initial signing and NSEC/NSEC3 chain generation
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is happening, other updates are possible as well.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.16"></a>Fully automatic zone signing</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To enable automatic signing, add the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec</strong></span> option to the zone statement in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec</strong></span> has two possible arguments:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec allow</strong></span>,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> can search the key directory for keys
25cf1a301a396c38e8adf52c15f537b80d2483f7jl matching the zone, insert them into the zone, and use them to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl sign the zone. It will do so only when it receives an
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc sign <zonename></strong></span>.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec maintain</strong></span> includes the above
25cf1a301a396c38e8adf52c15f537b80d2483f7jl functionality, but will also automatically adjust the zone's
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DNSKEY records on schedule according to the keys' timing metadata.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (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
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <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.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> will periodically search the key directory
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for keys matching the zone, and if the keys' metadata indicates
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that any change should be made the zone, such as adding, removing,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl or revoking a key, then that action will be carried out. By default,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the key directory is checked for changes every 60 minutes; this period
25cf1a301a396c38e8adf52c15f537b80d2483f7jl can be adjusted with the <code class="option">dnssec-loadkeys-interval</code>, up
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to a maximum of 24 hours. The <span class="command"><strong>rndc loadkeys</strong></span> forces
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> to check for key updates immediately.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If keys are present in the key directory the first time the zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is loaded, the zone will be signed immediately, without waiting for an
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>rndc sign</strong></span> or <span class="command"><strong>rndc loadkeys</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl command. (Those commands can still be used when there are unscheduled
25cf1a301a396c38e8adf52c15f537b80d2483f7jl key changes, however.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When new keys are added to a zone, the TTL is set to match that
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of any existing DNSKEY RRset. If there is no existing DNSKEY RRset,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl then the TTL will be set to the TTL specified when the key was
25cf1a301a396c38e8adf52c15f537b80d2483f7jl created (using the <span class="command"><strong>dnssec-keygen -L</strong></span> option), if
25cf1a301a396c38e8adf52c15f537b80d2483f7jl any, or to the SOA TTL.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If you wish the zone to be signed using NSEC3 instead of NSEC,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl submit an NSEC3PARAM record via dynamic update prior to the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl scheduled publication and activation of the keys. If you wish the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl NSEC3 chain to have the OPTOUT bit set, set it in the flags field
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of the NSEC3PARAM record. The NSEC3PARAM record will not appear in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the zone immediately, but it will be stored for later reference. When
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the zone is signed and the NSEC3 chain is completed, the NSEC3PARAM
25cf1a301a396c38e8adf52c15f537b80d2483f7jl record will appear in the zone.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Using the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec</strong></span> option requires the zone to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configured to allow dynamic updates, by adding an
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>allow-update</strong></span> or
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>update-policy</strong></span> statement to the zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configuration. If this has not been done, the configuration will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.25"></a>Private-type records</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>The state of the signing process is signaled by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl private-type records (with a default type value of 65534). When
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signing is complete, these records will have a nonzero value for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the final octet (for those records which have a nonzero initial
25cf1a301a396c38e8adf52c15f537b80d2483f7jl octet).</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>The private type record format: If the first octet is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl non-zero then the record indicates that the zone needs to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signed with the key matching the record, or that all signatures
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that match the record should be removed.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��algorithm�(octet�1)<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��key�id�in�network�order�(octet�2�and�3)<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��removal�flag�(octet�4)<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��complete�flag�(octet�5)<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Only records flagged as "complete" can be removed via
25cf1a301a396c38e8adf52c15f537b80d2483f7jl dynamic update. Attempts to remove other private type records
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will be silently ignored.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>If the first octet is zero (this is a reserved algorithm
25cf1a301a396c38e8adf52c15f537b80d2483f7jl number that should never appear in a DNSKEY record) then the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl record indicates changes to the NSEC3 chains are in progress. The
25cf1a301a396c38e8adf52c15f537b80d2483f7jl rest of the record contains an NSEC3PARAM record. The flag field
25cf1a301a396c38e8adf52c15f537b80d2483f7jl tells what operation to perform based on the flag bits.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��0x01�OPTOUT<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��0x80�CREATE<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��0x40�REMOVE<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl��0x20�NONSEC<br>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.32"></a>DNSKEY rollovers</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>As with insecure-to-secure conversions, rolling DNSSEC
25cf1a301a396c38e8adf52c15f537b80d2483f7jl keys can be done in two ways: using a dynamic DNS update, or the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>auto-dnssec</strong></span> zone option.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.34"></a>Dynamic DNS update method</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p> To perform key rollovers via dynamic update, you need to add
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the <code class="filename">K*</code> files for the new keys so that
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> can find them. You can then add the new
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DNSKEY RRs via dynamic update.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> will then cause the zone to be signed
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the new keys. When the signing is complete the private type
25cf1a301a396c38e8adf52c15f537b80d2483f7jl records will be updated so that the last octet is non
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>If this is for a KSK you need to inform the parent and any
25cf1a301a396c38e8adf52c15f537b80d2483f7jl trust anchor repositories of the new KSK.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>You should then wait for the maximum TTL in the zone before
25cf1a301a396c38e8adf52c15f537b80d2483f7jl removing the old DNSKEY. If it is a KSK that is being updated,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl you also need to wait for the DS RRset in the parent to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl updated and its TTL to expire. This ensures that all clients will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be able to verify at least one signature when you remove the old
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DNSKEY.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>The old DNSKEY can be removed via UPDATE. Take care to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl specify the correct key.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> will clean out any signatures generated
25cf1a301a396c38e8adf52c15f537b80d2483f7jl by the old key after the update completes.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.39"></a>Automatic key rollovers</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>When a new key reaches its activation date (as set by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-keygen</strong></span> or <span class="command"><strong>dnssec-settime</strong></span>),
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if the <span class="command"><strong>auto-dnssec</strong></span> zone option is set to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="constant">maintain</code>, <span class="command"><strong>named</strong></span> will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl automatically carry out the key rollover. If the key's algorithm
25cf1a301a396c38e8adf52c15f537b80d2483f7jl has not previously been used to sign the zone, then the zone will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be fully signed as quickly as possible. However, if the new key
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is replacing an existing key of the same algorithm, then the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone will be re-signed incrementally, with signatures from the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl old key being replaced with signatures from the new key as their
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signature validity periods expire. By default, this rollover
25cf1a301a396c38e8adf52c15f537b80d2483f7jl completes in 30 days, after which it will be safe to remove the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl old key from the DNSKEY RRset.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.41"></a>NSEC3PARAM rollovers via UPDATE</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Add the new NSEC3PARAM record via dynamic update. When the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl new NSEC3 chain has been generated, the NSEC3PARAM flag field
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will be zero. At this point you can remove the old NSEC3PARAM
25cf1a301a396c38e8adf52c15f537b80d2483f7jl record. The old chain will be removed after the update request
25cf1a301a396c38e8adf52c15f537b80d2483f7jl completes.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.43"></a>Converting from NSEC to NSEC3</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To do this, you just need to add an NSEC3PARAM record. When
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the conversion is complete, the NSEC chain will have been removed
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and the NSEC3PARAM record will have a zero flag field. The NSEC3
25cf1a301a396c38e8adf52c15f537b80d2483f7jl chain will be generated before the NSEC chain is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl destroyed.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.45"></a>Converting from NSEC3 to NSEC</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To do this, use <span class="command"><strong>nsupdate</strong></span> to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl remove all NSEC3PARAM records with a zero flag
25cf1a301a396c38e8adf52c15f537b80d2483f7jl field. The NSEC chain will be generated before the NSEC3 chain is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl removed.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.47"></a>Converting from secure to insecure</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To convert a signed zone to unsigned using dynamic DNS,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl delete all the DNSKEY records from the zone apex using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>nsupdate</strong></span>. All signatures, NSEC or NSEC3 chains,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and associated NSEC3PARAM records will be removed automatically.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This will take place after the update request completes.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p> This requires the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-secure-to-insecure</strong></span> option to be set to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>In addition, if the <span class="command"><strong>auto-dnssec maintain</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone statement is used, it should be removed or changed to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>allow</strong></span> instead (or it will re-sign).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.51"></a>Periodic re-signing</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>In any secure zone which supports dynamic updates, <span class="command"><strong>named</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl will periodically re-sign RRsets which have not been re-signed as
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a result of some update action. The signature lifetimes will be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl adjusted so as to spread the re-sign load over time rather than
25cf1a301a396c38e8adf52c15f537b80d2483f7jl all at once.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="section"><div class="titlepage"><div><div><h3 class="title">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.10.53"></a>NSEC3 and OPTOUT</h3></div></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> only supports creating new NSEC3 chains
25cf1a301a396c38e8adf52c15f537b80d2483f7jl where all the NSEC3 records in the zone have the same OPTOUT
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> supports UPDATES to zones where the NSEC3
25cf1a301a396c38e8adf52c15f537b80d2483f7jl records in the chain have mixed OPTOUT state.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> does not support changing the OPTOUT
25cf1a301a396c38e8adf52c15f537b80d2483f7jl state of an individual NSEC3 record, the entire chain needs to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl changed if the OPTOUT state of an individual NSEC3 needs to be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl changed.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="rfc5011.support"></a>Dynamic Trust Anchor Management</h2></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>BIND 9.7.0 introduces support for RFC 5011, dynamic trust
25cf1a301a396c38e8adf52c15f537b80d2483f7jl anchor management. Using this feature allows
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>named</strong></span> to keep track of changes to critical
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DNSSEC keys without any need for the operator to make changes to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configuration files.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.11.3"></a>Validating Resolver</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To configure a validating resolver to use RFC 5011 to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl maintain a trust anchor, configure the trust anchor using a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>managed-keys</strong></span> statement. Information about
25cf1a301a396c38e8adf52c15f537b80d2483f7jl this can be found in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <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
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.11.4"></a>Authoritative Server</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To set up an authoritative zone for RFC 5011 trust anchor
25cf1a301a396c38e8adf52c15f537b80d2483f7jl maintenance, generate two (or more) key signing keys (KSKs) for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the zone. Sign the zone with one of them; this is the "active"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl KSK. All KSKs which do not sign the zone are "stand-by"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Any validating resolver which is configured to use the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl active KSK as an RFC 5011-managed trust anchor will take note
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of the stand-by KSKs in the zone's DNSKEY RRset, and store them
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for future reference. The resolver will recheck the zone
25cf1a301a396c38e8adf52c15f537b80d2483f7jl periodically, and after 30 days, if the new key is still there,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl then the key will be accepted by the resolver as a valid trust
25cf1a301a396c38e8adf52c15f537b80d2483f7jl anchor for the zone. Any time after this 30-day acceptance
25cf1a301a396c38e8adf52c15f537b80d2483f7jl timer has completed, the active KSK can be revoked, and the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl zone can be "rolled over" to the newly accepted key.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>The easiest way to place a stand-by key in a zone is to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl use the "smart signing" features of
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-keygen</strong></span> and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-signzone</strong></span>. If a key with a publication
25cf1a301a396c38e8adf52c15f537b80d2483f7jl date in the past, but an activation date which is unset or in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the future, "
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-signzone -S</strong></span>" will include the DNSKEY
25cf1a301a396c38e8adf52c15f537b80d2483f7jl record in the zone, but will not sign with it:</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>dnssec-keygen -K keys -f KSK -P now -A now+2y example.net</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>dnssec-signzone -S -K keys example.net</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>To revoke a key, the new command
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-revoke</strong></span> has been added. This adds the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl REVOKED bit to the key flags and re-generates the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>After revoking the active key, the zone must be signed
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with both the revoked KSK and the new active KSK. (Smart
25cf1a301a396c38e8adf52c15f537b80d2483f7jl signing takes care of this automatically.)</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Once a key has been revoked and used to sign the DNSKEY
25cf1a301a396c38e8adf52c15f537b80d2483f7jl RRset in which it appears, that key will never again be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl accepted as a valid trust anchor by the resolver. However,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl validation can proceed using the new active key (which had been
25cf1a301a396c38e8adf52c15f537b80d2483f7jl accepted by the resolver when it was a stand-by key).</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>See RFC 5011 for more details on key rollover
25cf1a301a396c38e8adf52c15f537b80d2483f7jl scenarios.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>When a key has been revoked, its key ID changes,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl increasing by 128, and wrapping around at 65535. So, for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl example, the key "<code class="filename">Kexample.com.+005+10000</code>" becomes
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "<code class="filename">Kexample.com.+005+10128</code>".</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>If two keys have IDs exactly 128 apart, and one is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl revoked, then the two key IDs will collide, causing several
25cf1a301a396c38e8adf52c15f537b80d2483f7jl problems. To prevent this,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-keygen</strong></span> will not generate a new key if
25cf1a301a396c38e8adf52c15f537b80d2483f7jl another key is present which may collide. This checking will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl only occur if the new keys are written to the same directory
25cf1a301a396c38e8adf52c15f537b80d2483f7jl which holds all other keys in use for that zone.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>Older versions of BIND 9 did not have this precaution.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Exercise caution if using key revocation on keys that were
25cf1a301a396c38e8adf52c15f537b80d2483f7jl generated by previous releases, or if using keys stored in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl multiple directories or on multiple machines.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<p>It is expected that a future release of BIND 9 will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl address this problem in a different way, by storing revoked
25cf1a301a396c38e8adf52c15f537b80d2483f7jl keys with their original unrevoked key IDs.</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="titlepage"><div><div><h2 class="title" style="clear: both">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="pkcs11"></a>PKCS#11 (Cryptoki) support</h2></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl PKCS#11 (Public Key Cryptography Standard #11) defines a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl platform-independent API for the control of hardware security
25cf1a301a396c38e8adf52c15f537b80d2483f7jl modules (HSMs) and other cryptographic support devices.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl BIND 9 is known to work with three HSMs: The AEP Keyper, which has
25cf1a301a396c38e8adf52c15f537b80d2483f7jl been tested with Debian Linux, Solaris x86 and Windows Server 2003;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the Thales nShield, tested with Debian Linux; and the Sun SCA 6000
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cryptographic acceleration board, tested with Solaris x86. In
25cf1a301a396c38e8adf52c15f537b80d2483f7jl addition, BIND can be used with all current versions of SoftHSM,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a software-based HSM simulator library produced by the OpenDNSSEC
25cf1a301a396c38e8adf52c15f537b80d2483f7jl PKCS#11 makes use of a "provider library": a dynamically loadable
25cf1a301a396c38e8adf52c15f537b80d2483f7jl library which provides a low-level PKCS#11 interface to drive the HSM
25cf1a301a396c38e8adf52c15f537b80d2483f7jl hardware. The PKCS#11 provider library comes from the HSM vendor, and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl it is specific to the HSM to be controlled.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl There are two available mechanisms for PKCS#11 support in BIND 9:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL-based PKCS#11 and native PKCS#11. When using the first
25cf1a301a396c38e8adf52c15f537b80d2483f7jl mechanism, BIND uses a modified version of OpenSSL, which loads
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the provider library and operates the HSM indirectly; any
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cryptographic operations not supported by the HSM can be carried
25cf1a301a396c38e8adf52c15f537b80d2483f7jl out by OpenSSL instead. The second mechanism enables BIND to bypass
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL completely; BIND loads the provider library itself, and uses
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the PKCS#11 API to drive the HSM directly.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.6"></a>Prerequisites</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl See the documentation provided by your HSM vendor for
25cf1a301a396c38e8adf52c15f537b80d2483f7jl information about installing, initializing, testing and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl troubleshooting the HSM.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.7"></a>Native PKCS#11</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Native PKCS#11 mode will only work with an HSM capable of carrying
25cf1a301a396c38e8adf52c15f537b80d2483f7jl out <span class="emphasis"><em>every</em></span> cryptographic operation BIND 9 may
25cf1a301a396c38e8adf52c15f537b80d2483f7jl need. The HSM's provider library must have a complete implementation
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of the PKCS#11 API, so that all these functions are accessible. As of
25cf1a301a396c38e8adf52c15f537b80d2483f7jl this writing, only the Thales nShield HSM and SoftHSMv2 can be used
25cf1a301a396c38e8adf52c15f537b80d2483f7jl in this fashion. For other HSMs, including the AEP Keyper, Sun SCA
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 6000 and older versions of SoftHSM, use OpenSSL-based PKCS#11.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (Note: Eventually, when more HSMs become capable of supporting
25cf1a301a396c38e8adf52c15f537b80d2483f7jl native PKCS#11, it is expected that OpenSSL-based PKCS#11 will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl be deprecated.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To build BIND with native PKCS#11, configure as follows:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cd bind9</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>/configure --enable-native-pkcs11 \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl --with-pkcs11=<em class="replaceable"><code>provider-library-path</code></em></code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This will cause all BIND tools, including <span class="command"><strong>named</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and the <span class="command"><strong>dnssec-*</strong></span> and <span class="command"><strong>pkcs11-*</strong></span>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl tools, to use the PKCS#11 provider library specified in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <em class="replaceable"><code>provider-library-path</code></em> for cryptography.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (The provider library path can be overridden using the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <code class="option">-E</code> in <span class="command"><strong>named</strong></span> and the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="command"><strong>dnssec-*</strong></span> tools, or the <code class="option">-m</code> in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the <span class="command"><strong>pkcs11-*</strong></span> tools.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.7.6"></a>Building SoftHSMv2</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SoftHSMv2, the latest development version of SoftHSM, is available
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <a class="link" href="https://github.com/opendnssec/SoftHSMv2" target="_top">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl It is a software library developed by the OpenDNSSEC project
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (<a class="link" href="http://www.opendnssec.org" target="_top">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl which provides a PKCS#11 interface to a virtual HSM, implemented in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the form of a SQLite3 database on the local filesystem. It provides
25cf1a301a396c38e8adf52c15f537b80d2483f7jl less security than a true HSM, but it allows you to experiment with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl native PKCS#11 when an HSM is not available. SoftHSMv2 can be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configured to use either OpenSSL or the Botan library to perform
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cryptographic functions, but when using it for native PKCS#11 in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl BIND, OpenSSL is required.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl By default, the SoftHSMv2 configuration file is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <em class="replaceable"><code>prefix</code></em>/etc/softhsm2.conf (where
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <em class="replaceable"><code>prefix</code></em> is configured at compile time).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This location can be overridden by the SOFTHSM2_CONF environment
25cf1a301a396c38e8adf52c15f537b80d2483f7jl variable. The SoftHSMv2 cryptographic store must be installed and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl initialized before using it with BIND.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> cd SoftHSMv2 </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> configure --with-crypto-backend=openssl --prefix=/opt/pkcs11/usr --enable-gost </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> make install </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> /opt/pkcs11/usr/bin/softhsm-util --init-token 0 --slot 0 --label softhsmv2 </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8"></a>OpenSSL-based PKCS#11</h3></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL-based PKCS#11 mode uses a modified version of the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL library; stock OpenSSL does not fully support PKCS#11.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ISC provides a patch to OpenSSL to correct this. This patch is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl based on work originally done by the OpenSolaris project; it has been
25cf1a301a396c38e8adf52c15f537b80d2483f7jl modified by ISC to provide new features such as PIN management and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl key-by-reference.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl There are two "flavors" of PKCS#11 support provided by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the patched OpenSSL, one of which must be chosen at
25cf1a301a396c38e8adf52c15f537b80d2483f7jl configuration time. The correct choice depends on the HSM
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Use 'crypto-accelerator' with HSMs that have hardware
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cryptographic acceleration features, such as the SCA 6000
25cf1a301a396c38e8adf52c15f537b80d2483f7jl board. This causes OpenSSL to run all supported
25cf1a301a396c38e8adf52c15f537b80d2483f7jl cryptographic operations in the HSM.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Use 'sign-only' with HSMs that are designed to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl function primarily as secure key storage devices, but lack
25cf1a301a396c38e8adf52c15f537b80d2483f7jl hardware acceleration. These devices are highly secure, but
25cf1a301a396c38e8adf52c15f537b80d2483f7jl are not necessarily any faster at cryptography than the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl system CPU — often, they are slower. It is therefore
25cf1a301a396c38e8adf52c15f537b80d2483f7jl most efficient to use them only for those cryptographic
25cf1a301a396c38e8adf52c15f537b80d2483f7jl functions that require access to the secured private key,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl such as zone signing, and to use the system CPU for all
25cf1a301a396c38e8adf52c15f537b80d2483f7jl other computationally-intensive operations. The AEP Keyper
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is an example of such a device.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The modified OpenSSL code is included in the BIND 9 release,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl in the form of a context diff against the latest versions of
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL. OpenSSL 0.9.8, 1.0.0, 1.0.1 and 1.0.2 are supported;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl there are separate diffs for each version. In the examples to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl follow, we use OpenSSL 0.9.8, but the same methods work with
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL 1.0.0 through 1.0.2.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The OpenSSL patches as of this writing (January 2016)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl support versions 0.9.8zh, 1.0.0t, 1.0.1q and 1.0.2f.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ISC will provide updated patches as new versions of OpenSSL
25cf1a301a396c38e8adf52c15f537b80d2483f7jl are released. The version number in the following examples
25cf1a301a396c38e8adf52c15f537b80d2483f7jl is expected to change.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Before building BIND 9 with PKCS#11 support, it will be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl necessary to build OpenSSL with the patch in place, and configure
25cf1a301a396c38e8adf52c15f537b80d2483f7jl it with the path to your HSM's PKCS#11 provider library.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.8"></a>Patching OpenSSL</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <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>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>tar zxf openssl-0.9.8zc.tar.gz</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>patch -p1 -d openssl-0.9.8zc \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl < bind9/bin/pkcs11/openssl-0.9.8zc-patch</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The patch file may not be compatible with the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "patch" utility on all operating systems. You may need to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl install GNU patch.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When building OpenSSL, place it in a non-standard
25cf1a301a396c38e8adf52c15f537b80d2483f7jl location so that it does not interfere with OpenSSL libraries
25cf1a301a396c38e8adf52c15f537b80d2483f7jl elsewhere on the system. In the following examples, we choose
25cf1a301a396c38e8adf52c15f537b80d2483f7jl to install into "/opt/pkcs11/usr". We will use this location
25cf1a301a396c38e8adf52c15f537b80d2483f7jl when we configure BIND 9.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Later, when building BIND 9, the location of the custom-built
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenSSL library will need to be specified via configure.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.9"></a>Building OpenSSL for the AEP Keyper on Linux</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The AEP Keyper is a highly secure key storage device,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl but does not provide hardware cryptographic acceleration. It
25cf1a301a396c38e8adf52c15f537b80d2483f7jl can carry out cryptographic operations, but it is probably
25cf1a301a396c38e8adf52c15f537b80d2483f7jl slower than your system's CPU. Therefore, we choose the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 'sign-only' flavor when building OpenSSL.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The Keyper-specific PKCS#11 provider library is
25cf1a301a396c38e8adf52c15f537b80d2483f7jl delivered with the Keyper software. In this example, we place
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cp pkcs11.GCC4.0.2.so.4.05 /opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The Keyper library requires threads, so we
25cf1a301a396c38e8adf52c15f537b80d2483f7jl must specify -pthread.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cd openssl-0.9.8zc</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>/Configure linux-x86_64 -pthread \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl --pk11-flavor=sign-only \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl After configuring, run "<span class="command"><strong>make</strong></span>"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and "<span class="command"><strong>make test</strong></span>". If "<span class="command"><strong>make
25cf1a301a396c38e8adf52c15f537b80d2483f7jl test</strong></span>" fails with "pthread_atfork() not found", you forgot to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl add the -pthread above.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.10"></a>Building OpenSSL for the SCA 6000 on Solaris</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The SCA-6000 PKCS#11 provider is installed as a system
25cf1a301a396c38e8adf52c15f537b80d2483f7jl library, libpkcs11. It is a true crypto accelerator, up to 4
25cf1a301a396c38e8adf52c15f537b80d2483f7jl times faster than any CPU, so the flavor shall be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 'crypto-accelerator'.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl In this example, we are building on Solaris x86 on an
25cf1a301a396c38e8adf52c15f537b80d2483f7jl AMD64 system.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cd openssl-0.9.8zc</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>/Configure solaris64-x86_64-cc \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl --pk11-flavor=crypto-accelerator \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (For a 32-bit build, use "solaris-x86-cc" and /usr/lib/libpkcs11.so.)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl After configuring, run
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.11"></a>Building OpenSSL for SoftHSM</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SoftHSM (version 1) is a software library developed by the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl OpenDNSSEC project
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (<a class="link" href="http://www.opendnssec.org" target="_top">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl which provides a
25cf1a301a396c38e8adf52c15f537b80d2483f7jl PKCS#11 interface to a virtual HSM, implemented in the form of
25cf1a301a396c38e8adf52c15f537b80d2483f7jl a SQLite3 database on the local filesystem. SoftHSM uses
25cf1a301a396c38e8adf52c15f537b80d2483f7jl the Botan library to perform cryptographic functions. Though
25cf1a301a396c38e8adf52c15f537b80d2483f7jl less secure than a true HSM, it can allow you to experiment
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with PKCS#11 when an HSM is not available.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The SoftHSM cryptographic store must be installed and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl initialized before using it with OpenSSL, and the SOFTHSM_CONF
25cf1a301a396c38e8adf52c15f537b80d2483f7jl environment variable must always point to the SoftHSM configuration
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> cd softhsm-1.3.7 </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> configure --prefix=/opt/pkcs11/usr </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> make install </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> export SOFTHSM_CONF=/opt/pkcs11/softhsm.conf </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> echo "0:/opt/pkcs11/softhsm.db" > $SOFTHSM_CONF </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code> /opt/pkcs11/usr/bin/softhsm --init-token 0 --slot 0 --label softhsm </code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SoftHSM can perform all cryptographic operations, but
25cf1a301a396c38e8adf52c15f537b80d2483f7jl since it only uses your system CPU, there is no advantage to using
25cf1a301a396c38e8adf52c15f537b80d2483f7jl it for anything but signing. Therefore, we choose the 'sign-only'
25cf1a301a396c38e8adf52c15f537b80d2483f7jl flavor when building OpenSSL.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cd openssl-0.9.8zc</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>/Configure linux-x86_64 -pthread \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl --pk11-flavor=sign-only \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl After configuring, run "<span class="command"><strong>make</strong></span>"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl and "<span class="command"><strong>make test</strong></span>".
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Once you have built OpenSSL, run
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "<span class="command"><strong>apps/openssl engine pkcs11</strong></span>" to confirm
25cf1a301a396c38e8adf52c15f537b80d2483f7jl that PKCS#11 support was compiled in correctly. The output
25cf1a301a396c38e8adf52c15f537b80d2483f7jl should be one of the following lines, depending on the flavor
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (pkcs11) PKCS #11 engine support (sign only)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (pkcs11) PKCS #11 engine support (crypto accelerator)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "<span class="command"><strong>apps/openssl engine pkcs11 -t</strong></span>". This will
25cf1a301a396c38e8adf52c15f537b80d2483f7jl attempt to initialize the PKCS#11 engine. If it is able to
25cf1a301a396c38e8adf52c15f537b80d2483f7jl do so successfully, it will report
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <span class="quote">“<span class="quote"><code class="literal">[ available ]</code></span>”</span>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If the output is correct, run
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "<span class="command"><strong>make install</strong></span>" which will install the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl modified OpenSSL suite to <code class="filename">/opt/pkcs11/usr</code>.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.18"></a>Configuring BIND 9 for Linux with the AEP Keyper</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To link with the PKCS#11 provider, threads must be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl enabled in the BIND 9 build.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cd /bind9</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>/configure --enable-threads \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl --with-pkcs11=/opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.19"></a>Configuring BIND 9 for Solaris with the SCA 6000</h4></div></div></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl To link with the PKCS#11 provider, threads must be
25cf1a301a396c38e8adf52c15f537b80d2483f7jl enabled in the BIND 9 build.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>cd /bind9</code></strong>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl$ <strong class="userinput"><code>/configure CC="cc -xarch=amd64" --enable-threads \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If configure complains about OpenSSL not working, you
25cf1a301a396c38e8adf52c15f537b80d2483f7jl may have a 32/64-bit architecture mismatch. Or, you may have
25cf1a301a396c38e8adf52c15f537b80d2483f7jl incorrectly specified the path to OpenSSL (it should be the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl same as the --prefix argument to the OpenSSL
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Configure).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<a name="id-1.5.12.8.20"></a>Configuring BIND 9 for SoftHSM</h4></div></div></div>
$ <strong class="userinput"><code>export LD_LIBRARY_PATH=/opt/pkcs11/usr/lib:${LD_LIBRARY_PATH}</code></strong>
$ <strong class="userinput"><code>export KEYPER_LIBRARY_PATH=/opt/Keyper/PKCS11Provider</code></strong>
"sample-ksk" as the key-signing key for "example.net":
$ <strong class="userinput"><code>dnssec-keyfromlabel -l sample-ksk -f KSK example.net</code></strong>
<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.)
then <span class="command"><strong>named</strong></span> must have access to the HSM PIN. In OpenSSL-based PKCS#11,
this is accomplished by placing the PIN into the openssl.cnf file
The location of the openssl.cnf file can be overridden by
Historically, DLZ drivers had to be statically linked with the <span class="command"><strong>named</strong></span>
"dlopen" driver is linked into <span class="command"><strong>named</strong></span> by default, so configure options
When the DLZ module provides data to <span class="command"><strong>named</strong></span>, it does so in text format.
The response is converted to DNS wire format by <span class="command"><strong>named</strong></span>. This
dynamically-linkable DLZ module--i.e., one which can be
"example.nil", which can answer queries and AXFR requests, and
example.nil. 1800 IN A 10.53.0.1
e.g., by providing different address records for a particular name
(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
<a class="link" href="https://fedorahosted.org/bind-dyndb-ldap/" target="_top">https://fedorahosted.org/bind-dyndb-ldap/</a>.
dyndb example "driver.so" {
"example.nil", which can answer queries and AXFR requests, and
example.nil. 86400 IN A 127.0.0.1
whether the updated RR is an address (i.e., type A or AAAA) and if
zone "catalog.example"
means <span class="command"><strong>rndc addzone</strong></span> and <span class="command"><strong>rndc delzone</strong></span>
catalog.example. IN SOA . . 2016022901 900 600 86400 1
catalog.example. IN NS nsexample.
version.catalog.example. IN TXT "1"
Global options are set at the apex of the catalog zone, e.g.:
masters.catalog.example. IN AAAA 2001:db8::1
masters.catalog.example. IN A 192.0.2.1
label.masters.catalog.example. IN A 192.0.2.2
label.masters.catalog.example. IN TXT "tsig_key_name"
label.masters.5960775ba382e7a4e09263fc06e7c00569b6a05c.zones.catalog.example. IN AAAA 2001:db8::2
see <a class="xref" href="Bv9ARM.ch11.html#ipv6addresses" title="IPv6 addresses (AAAA)">the section called “IPv6 addresses (AAAA)”</a>.
$ORIGIN example.com.