Bv9ARM.ch04.html revision 3a32ac2a720653083c7a22cb654b86c398f6d4c8
1d14622beee568462689b2bbc6a9e0e9b6a40583striker<!--
c30ef289fe64ac7fedc44cfcc6b439f0f8458b4cgregames - Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
c30ef289fe64ac7fedc44cfcc6b439f0f8458b4cgregames - Copyright (C) 2000-2003 Internet Software Consortium.
82d2a5debc5a6ed2118ac5916d9ba36ad0b5d78btrawick -
d66ac514cc15e99228d72c56c6c3daf25da8d360niq - Permission to use, copy, modify, and/or distribute this software for any
d66ac514cc15e99228d72c56c6c3daf25da8d360niq - purpose with or without fee is hereby granted, provided that the above
d66ac514cc15e99228d72c56c6c3daf25da8d360niq - copyright notice and this permission notice appear in all copies.
d66ac514cc15e99228d72c56c6c3daf25da8d360niq -
e23b77006a8b079c0ad52e42ba2029e759455b8fjorton - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
e23b77006a8b079c0ad52e42ba2029e759455b8fjorton - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
e23b77006a8b079c0ad52e42ba2029e759455b8fjorton - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
e23b77006a8b079c0ad52e42ba2029e759455b8fjorton - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
b597281295360dba8ac57b7606c5f5c1ef2b69b0trawick - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
b597281295360dba8ac57b7606c5f5c1ef2b69b0trawick - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
b597281295360dba8ac57b7606c5f5c1ef2b69b0trawick - PERFORMANCE OF THIS SOFTWARE.
82d2a5debc5a6ed2118ac5916d9ba36ad0b5d78btrawick-->
82d2a5debc5a6ed2118ac5916d9ba36ad0b5d78btrawick<!-- $Id$ -->
22c347c08cd77d5e2c32536b467b389fd33d631fpquerna<html>
22c347c08cd77d5e2c32536b467b389fd33d631fpquerna<head>
8c46f9f81ae6357dc97560d6d85154f19cf251aejim<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
b6e2b36d6972a0e243368eb567e91d511fb40b1bbnicholes<title>Chapter�4.�Advanced DNS Features</title>
b6e2b36d6972a0e243368eb567e91d511fb40b1bbnicholes<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
b6e2b36d6972a0e243368eb567e91d511fb40b1bbnicholes<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
b6e2b36d6972a0e243368eb567e91d511fb40b1bbnicholes<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
b6e2b36d6972a0e243368eb567e91d511fb40b1bbnicholes<link rel="prev" href="Bv9ARM.ch03.html" title="Chapter�3.�Name Server Configuration">
ad4a5834dfdf9488af4ac3238ea4d8b18dce49acpquerna<link rel="next" href="Bv9ARM.ch05.html" title="Chapter�5.�The BIND 9 Lightweight Resolver">
e5882a36d7756850cc829f5f2286120b877458b1pquerna</head>
e5882a36d7756850cc829f5f2286120b877458b1pquerna<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
8b7594c66e764f5cd3506b6f2459497ab65a8b03pquerna<div class="navheader">
8b7594c66e764f5cd3506b6f2459497ab65a8b03pquerna<table width="100%" summary="Navigation header">
8b7594c66e764f5cd3506b6f2459497ab65a8b03pquerna<tr><th colspan="3" align="center">Chapter�4.�Advanced DNS Features</th></tr>
21ef0eb0ade285466e6e5afd62bc59f5ad058c34gregames<tr>
21ef0eb0ade285466e6e5afd62bc59f5ad058c34gregames<td width="20%" align="left">
21ef0eb0ade285466e6e5afd62bc59f5ad058c34gregames<a accesskey="p" href="Bv9ARM.ch03.html">Prev</a>�</td>
8c46f9f81ae6357dc97560d6d85154f19cf251aejim<th width="60%" align="center">�</th>
8c46f9f81ae6357dc97560d6d85154f19cf251aejim<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
20f1b1a67eef5ab0f3295608c89964a7dca4fdd1pquerna</td>
20f1b1a67eef5ab0f3295608c89964a7dca4fdd1pquerna</tr>
20f1b1a67eef5ab0f3295608c89964a7dca4fdd1pquerna</table>
20f1b1a67eef5ab0f3295608c89964a7dca4fdd1pquerna<hr>
599c5abcc7fec60611956f56b732eca033c287d2pquerna</div>
599c5abcc7fec60611956f56b732eca033c287d2pquerna<div class="chapter" lang="en">
599c5abcc7fec60611956f56b732eca033c287d2pquerna<div class="titlepage"><div><div><h2 class="title">
e76fdcdfb8994ad70776526f50fa013b3e9a6033bnicholes<a name="Bv9ARM.ch04"></a>Chapter�4.�Advanced DNS Features</h2></div></div></div>
e76fdcdfb8994ad70776526f50fa013b3e9a6033bnicholes<div class="toc">
e76fdcdfb8994ad70776526f50fa013b3e9a6033bnicholes<p><b>Table of Contents</b></p>
eb9b491d7b262dad572ec2f1f75eea592283f81apquerna<dl>
eb9b491d7b262dad572ec2f1f75eea592283f81apquerna<dt><span class="sect1"><a href="Bv9ARM.ch04.html#notify">Notify</a></span></dt>
eb9b491d7b262dad572ec2f1f75eea592283f81apquerna<dt><span class="sect1"><a href="Bv9ARM.ch04.html#dynamic_update">Dynamic Update</a></span></dt>
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton<dd><dl><dt><span class="sect2"><a href="Bv9ARM.ch04.html#journal">The journal file</a></span></dt></dl></dd>
67ee70ecd7a887131866f94765aae1a8cec57231gregames<dt><span class="sect1"><a href="Bv9ARM.ch04.html#incremental_zone_transfers">Incremental Zone Transfers (IXFR)</a></span></dt>
67ee70ecd7a887131866f94765aae1a8cec57231gregames<dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2571285">Split DNS</a></span></dt>
67ee70ecd7a887131866f94765aae1a8cec57231gregames<dd><dl><dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571303">Example split DNS setup</a></span></dt></dl></dd>
67ee70ecd7a887131866f94765aae1a8cec57231gregames<dt><span class="sect1"><a href="Bv9ARM.ch04.html#tsig">TSIG</a></span></dt>
67ee70ecd7a887131866f94765aae1a8cec57231gregames<dd><dl>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571873">Generate Shared Keys for Each Pair of Hosts</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2563959">Copying the Shared Secret to Both Machines</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2563970">Informing the Servers of the Key's Existence</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2564006">Instructing the Server to Use the Key</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2564064">TSIG Key Based Access Control</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2564113">Errors</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive</dl></dd>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2564126">TKEY</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2572368">SIG(0)</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect1"><a href="Bv9ARM.ch04.html#DNSSEC">DNSSEC</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dd><dl>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572504">Generating Keys</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572651">Signing the Zone</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572801">Configuring Servers</a></span></dt>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive</dl></dd>
6d00a5e2c08ddbff9614ecc17a1c085462811f89slive<dt><span class="sect1"><a href="Bv9ARM.ch04.html#dnssec.dynamic.zones">DNSSEC, Dynamic Zones, and Automatic Signing</a></span></dt>
4f6e78091b3f45a5782389ae25b62516a7a0c842bnicholes<dd><dl>
4f6e78091b3f45a5782389ae25b62516a7a0c842bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2610941">Converting from insecure to secure</a></span></dt>
4f6e78091b3f45a5782389ae25b62516a7a0c842bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2610979">Dynamic DNS update method</a></span></dt>
4f6e78091b3f45a5782389ae25b62516a7a0c842bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2563501">Fully automatic zone signing</a></span></dt>
4f6e78091b3f45a5782389ae25b62516a7a0c842bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2563605">Private-type records</a></span></dt>
7d15331eeb5429d7148d13d6fd914a641bf1c000pquerna<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2563779">DNSKEY rollovers</a></span></dt>
7d15331eeb5429d7148d13d6fd914a641bf1c000pquerna<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2563792">Dynamic DNS update method</a></span></dt>
7d15331eeb5429d7148d13d6fd914a641bf1c000pquerna<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571948">Automatic key rollovers</a></span></dt>
e9be3aacfd6c0a1208e6c91a133be92ed0f94fe1bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571975">NSEC3PARAM rollovers via UPDATE</a></span></dt>
e9be3aacfd6c0a1208e6c91a133be92ed0f94fe1bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571985">Converting from NSEC to NSEC3</a></span></dt>
e9be3aacfd6c0a1208e6c91a133be92ed0f94fe1bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2571994">Converting from NSEC3 to NSEC</a></span></dt>
e9be3aacfd6c0a1208e6c91a133be92ed0f94fe1bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572007">Converting from secure to insecure</a></span></dt>
1d14622beee568462689b2bbc6a9e0e9b6a40583striker<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572044">Periodic re-signing</a></span></dt>
1d14622beee568462689b2bbc6a9e0e9b6a40583striker<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572054">NSEC3 and OPTOUT</a></span></dt>
6e5f5644328bf50c3aa295d0ab20903369010829gregames</dl></dd>
6e5f5644328bf50c3aa295d0ab20903369010829gregames<dt><span class="sect1"><a href="Bv9ARM.ch04.html#rfc5011.support">Dynamic Trust Anchor Management</a></span></dt>
6e5f5644328bf50c3aa295d0ab20903369010829gregames<dd><dl>
e978097e0bf2ae161b6f9dde40eaf089bf046c89ake<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572087">Validating Resolver</a></span></dt>
e978097e0bf2ae161b6f9dde40eaf089bf046c89ake<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572109">Authoritative Server</a></span></dt>
e978097e0bf2ae161b6f9dde40eaf089bf046c89ake</dl></dd>
275419d6395e6f072962fb701b89accaff1f3690jerenkrantz<dt><span class="sect1"><a href="Bv9ARM.ch04.html#pkcs11">PKCS #11 (Cryptoki) support</a></span></dt>
275419d6395e6f072962fb701b89accaff1f3690jerenkrantz<dd><dl>
275419d6395e6f072962fb701b89accaff1f3690jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2613378">Prerequisites</a></span></dt>
e777da9fa7ff3138fead7860b53ef00e67a40e26jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2638115">Building BIND 9 with PKCS#11</a></span></dt>
e777da9fa7ff3138fead7860b53ef00e67a40e26jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2638240">PKCS #11 Tools</a></span></dt>
e777da9fa7ff3138fead7860b53ef00e67a40e26jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2638270">Using the HSM</a></span></dt>
e777da9fa7ff3138fead7860b53ef00e67a40e26jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2638469">Specifying the engine on the command line</a></span></dt>
8bdea88407c848c1c2693655e2f8b23abde12307bnicholes<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2638515">Running named with automatic zone re-signing</a></span></dt>
8bdea88407c848c1c2693655e2f8b23abde12307bnicholes</dl></dd>
8bdea88407c848c1c2693655e2f8b23abde12307bnicholes<dt><span class="sect1"><a href="Bv9ARM.ch04.html#dlz-info">DLZ (Dynamically Loadable Zones)</a></span></dt>
275419d6395e6f072962fb701b89accaff1f3690jerenkrantz<dd><dl>
8e7fb6968047a527d1ccde25ad2aed20da5150ddjerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2572205">Configuring DLZ</a></span></dt>
8e7fb6968047a527d1ccde25ad2aed20da5150ddjerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2610643">Sample DLZ Driver</a></span></dt>
8e7fb6968047a527d1ccde25ad2aed20da5150ddjerenkrantz</dl></dd>
5a9fa4d75086e942f6e850e1a2e96c4c27a845d0jerenkrantz<dt><span class="sect1"><a href="Bv9ARM.ch04.html#id2572956">IPv6 Support in <acronym class="acronym">BIND</acronym> 9</a></span></dt>
5a9fa4d75086e942f6e850e1a2e96c4c27a845d0jerenkrantz<dd><dl>
5a9fa4d75086e942f6e850e1a2e96c4c27a845d0jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2573086">Address Lookups Using AAAA Records</a></span></dt>
5a9fa4d75086e942f6e850e1a2e96c4c27a845d0jerenkrantz<dt><span class="sect2"><a href="Bv9ARM.ch04.html#id2573176">Address to Name Lookups Using Nibble Format</a></span></dt>
5a9fa4d75086e942f6e850e1a2e96c4c27a845d0jerenkrantz</dl></dd>
5a9fa4d75086e942f6e850e1a2e96c4c27a845d0jerenkrantz</dl>
36c8049de63c446926139936c3d195330a0539cetrawick</div>
36c8049de63c446926139936c3d195330a0539cetrawick<div class="sect1" lang="en">
36c8049de63c446926139936c3d195330a0539cetrawick<div class="titlepage"><div><div><h2 class="title" style="clear: both">
36c8049de63c446926139936c3d195330a0539cetrawick<a name="notify"></a>Notify</h2></div></div></div>
36c8049de63c446926139936c3d195330a0539cetrawick<p>
36c8049de63c446926139936c3d195330a0539cetrawick <acronym class="acronym">DNS</acronym> NOTIFY is a mechanism that allows master
0206c121a68a63559b2e843288e81bcf16093e46jerenkrantz servers to notify their slave servers of changes to a zone's data. In
0206c121a68a63559b2e843288e81bcf16093e46jerenkrantz response to a <span><strong class="command">NOTIFY</strong></span> from a master server, the
0206c121a68a63559b2e843288e81bcf16093e46jerenkrantz slave will check to see that its version of the zone is the
8ff094bdec6a2e1c355c1e6e95e9952d4fae7766jerenkrantz current version and, if not, initiate a zone transfer.
8ff094bdec6a2e1c355c1e6e95e9952d4fae7766jerenkrantz </p>
628cf3411e8a6d09e27b3666312e43832dda93f3jorton<p>
628cf3411e8a6d09e27b3666312e43832dda93f3jorton For more information about <acronym class="acronym">DNS</acronym>
628cf3411e8a6d09e27b3666312e43832dda93f3jorton <span><strong class="command">NOTIFY</strong></span>, see the description of the
f0d89a5a23222e031db8113478645f28688fa748jorton <span><strong class="command">notify</strong></span> option in <a href="Bv9ARM.ch06.html#boolean_options" title="Boolean Options">the section called &#8220;Boolean Options&#8221;</a> and
f0d89a5a23222e031db8113478645f28688fa748jorton the description of the zone option <span><strong class="command">also-notify</strong></span> in
f0d89a5a23222e031db8113478645f28688fa748jorton <a href="Bv9ARM.ch06.html#zone_transfers" title="Zone Transfers">the section called &#8220;Zone Transfers&#8221;</a>. The <span><strong class="command">NOTIFY</strong></span>
f0d89a5a23222e031db8113478645f28688fa748jorton protocol is specified in RFC 1996.
f0d89a5a23222e031db8113478645f28688fa748jorton </p>
f0d89a5a23222e031db8113478645f28688fa748jorton<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
f0d89a5a23222e031db8113478645f28688fa748jorton<h3 class="title">Note</h3>
f0d89a5a23222e031db8113478645f28688fa748jorton As a slave zone can also be a master to other slaves, <span><strong class="command">named</strong></span>,
f0d89a5a23222e031db8113478645f28688fa748jorton by default, sends <span><strong class="command">NOTIFY</strong></span> messages for every zone
f0d89a5a23222e031db8113478645f28688fa748jorton it loads. Specifying <span><strong class="command">notify master-only;</strong></span> will
65d743d7fbb53143636ee2dec8fe8d8a1a581a6bjerenkrantz cause <span><strong class="command">named</strong></span> to only send <span><strong class="command">NOTIFY</strong></span> for master
65d743d7fbb53143636ee2dec8fe8d8a1a581a6bjerenkrantz zones that it loads.
65d743d7fbb53143636ee2dec8fe8d8a1a581a6bjerenkrantz </div>
afc08f35f5f387896bc625cdee21b88c7fe7699djerenkrantz</div>
a0fd132e01ab69f1c48e3d6a6791447cb6d65e51jerenkrantz<div class="sect1" lang="en">
a0fd132e01ab69f1c48e3d6a6791447cb6d65e51jerenkrantz<div class="titlepage"><div><div><h2 class="title" style="clear: both">
a6bb6f2fb734e488a9b6335fabea3431f9dcf253jerenkrantz<a name="dynamic_update"></a>Dynamic Update</h2></div></div></div>
a6bb6f2fb734e488a9b6335fabea3431f9dcf253jerenkrantz<p>
a6bb6f2fb734e488a9b6335fabea3431f9dcf253jerenkrantz Dynamic Update is a method for adding, replacing or deleting
3ca80e703a960eca0760c23636b7fe502a8f0342bnicholes records in a master server by sending it a special form of DNS
3ca80e703a960eca0760c23636b7fe502a8f0342bnicholes messages. The format and meaning of these messages is specified
3ca80e703a960eca0760c23636b7fe502a8f0342bnicholes in RFC 2136.
3ca80e703a960eca0760c23636b7fe502a8f0342bnicholes </p>
3ca80e703a960eca0760c23636b7fe502a8f0342bnicholes<p>
5300d4a4fabe3b594da950e4b9ab0f90e076546ejerenkrantz Dynamic update is enabled by including an
5300d4a4fabe3b594da950e4b9ab0f90e076546ejerenkrantz <span><strong class="command">allow-update</strong></span> or an <span><strong class="command">update-policy</strong></span>
5300d4a4fabe3b594da950e4b9ab0f90e076546ejerenkrantz clause in the <span><strong class="command">zone</strong></span> statement.
b1306729566b49fb30aed5c46adaf07a637115afjerenkrantz </p>
b1306729566b49fb30aed5c46adaf07a637115afjerenkrantz<p>
b1306729566b49fb30aed5c46adaf07a637115afjerenkrantz If the zone's <span><strong class="command">update-policy</strong></span> is set to
d5c1ba1aa5682c9a171114b76d5e21117e19ed6ctrawick <strong class="userinput"><code>local</code></strong>, updates to the zone
d5c1ba1aa5682c9a171114b76d5e21117e19ed6ctrawick will be permitted for the key <code class="varname">local-ddns</code>,
d5c1ba1aa5682c9a171114b76d5e21117e19ed6ctrawick which will be generated by <span><strong class="command">named</strong></span> at startup.
d5c1ba1aa5682c9a171114b76d5e21117e19ed6ctrawick See <a href="Bv9ARM.ch06.html#dynamic_update_policies" title="Dynamic Update Policies">the section called &#8220;Dynamic Update Policies&#8221;</a> for more details.
d5c1ba1aa5682c9a171114b76d5e21117e19ed6ctrawick </p>
418ee053321d0ee451bb482a9becdfcd3344201fjim<p>
418ee053321d0ee451bb482a9becdfcd3344201fjim Dynamic updates using Kerberos signed requests can be made
418ee053321d0ee451bb482a9becdfcd3344201fjim using the TKEY/GSS protocol by setting either the
5c6cb72bfeee541644cea8177aefce1157571d3bjerenkrantz <span><strong class="command">tkey-gssapi-keytab</strong></span> option, or alternatively
5c6cb72bfeee541644cea8177aefce1157571d3bjerenkrantz by setting both the <span><strong class="command">tkey-gssapi-credential</strong></span>
5c6cb72bfeee541644cea8177aefce1157571d3bjerenkrantz and <span><strong class="command">tkey-domain</strong></span> options. Once enabled,
db8551deeb08fa799e7f27e8b748a9397f747bdcjorton Kerberos signed requests will be matched against the update
db8551deeb08fa799e7f27e8b748a9397f747bdcjorton policies for the zone, using the Kerberos principal as the
db8551deeb08fa799e7f27e8b748a9397f747bdcjorton signer for the request.
db8551deeb08fa799e7f27e8b748a9397f747bdcjorton </p>
9e3209bc06ddf32f23e4b254faa45914bc323cc9jim<p>
9e3209bc06ddf32f23e4b254faa45914bc323cc9jim Updating of secure zones (zones using DNSSEC) follows RFC
9e3209bc06ddf32f23e4b254faa45914bc323cc9jim 3007: RRSIG, NSEC and NSEC3 records affected by updates are
45ed846f4ed90f05c084f6a33d688e642be4e623jerenkrantz automatically regenerated by the server using an online
45ed846f4ed90f05c084f6a33d688e642be4e623jerenkrantz zone key. Update authorization is based on transaction
45ed846f4ed90f05c084f6a33d688e642be4e623jerenkrantz signatures and an explicit server policy.
54d22ed1c429b903b029bbd62621f11a9e286137minfrin </p>
54d22ed1c429b903b029bbd62621f11a9e286137minfrin<div class="sect2" lang="en">
54d22ed1c429b903b029bbd62621f11a9e286137minfrin<div class="titlepage"><div><div><h3 class="title">
54d22ed1c429b903b029bbd62621f11a9e286137minfrin<a name="journal"></a>The journal file</h3></div></div></div>
54d22ed1c429b903b029bbd62621f11a9e286137minfrin<p>
54d22ed1c429b903b029bbd62621f11a9e286137minfrin All changes made to a zone using dynamic update are stored
54d22ed1c429b903b029bbd62621f11a9e286137minfrin in the zone's journal file. This file is automatically created
54d22ed1c429b903b029bbd62621f11a9e286137minfrin by the server when the first dynamic update takes place.
92e8e44864d94866eefcbfde0a53fa3d12855149jerenkrantz The name of the journal file is formed by appending the extension
92e8e44864d94866eefcbfde0a53fa3d12855149jerenkrantz <code class="filename">.jnl</code> to the name of the
92e8e44864d94866eefcbfde0a53fa3d12855149jerenkrantz corresponding zone
06106b6b63b112a09de1b66fa29596035c0176ffthommay file unless specifically overridden. The journal file is in a
06106b6b63b112a09de1b66fa29596035c0176ffthommay binary format and should not be edited manually.
06106b6b63b112a09de1b66fa29596035c0176ffthommay </p>
e335319a08e12eb7daff9afa80e985dc53f652b8jorton<p>
e335319a08e12eb7daff9afa80e985dc53f652b8jorton The server will also occasionally write ("dump")
e335319a08e12eb7daff9afa80e985dc53f652b8jorton the complete contents of the updated zone to its zone file.
e335319a08e12eb7daff9afa80e985dc53f652b8jorton This is not done immediately after
e335319a08e12eb7daff9afa80e985dc53f652b8jorton each dynamic update, because that would be too slow when a large
c8794ec1e4c474ae101ce3835080f638136e7860erikabele zone is updated frequently. Instead, the dump is delayed by
c8794ec1e4c474ae101ce3835080f638136e7860erikabele up to 15 minutes, allowing additional updates to take place.
c8794ec1e4c474ae101ce3835080f638136e7860erikabele During the dump process, transient files will be created
c8794ec1e4c474ae101ce3835080f638136e7860erikabele with the extensions <code class="filename">.jnw</code> and
c8794ec1e4c474ae101ce3835080f638136e7860erikabele <code class="filename">.jbk</code>; under ordinary circumstances, these
bb07ee33bce1a448bcc60ca43720b1ab1c413f87minfrin will be removed when the dump is complete, and can be safely
bb07ee33bce1a448bcc60ca43720b1ab1c413f87minfrin ignored.
22dda44322067379eeba28d7ec7fc833cb04c0dfminfrin </p>
22dda44322067379eeba28d7ec7fc833cb04c0dfminfrin<p>
7b6ba9c468f26bdb3492d5e8cb79628a3b04e8c8wrowe When a server is restarted after a shutdown or crash, it will replay
7b6ba9c468f26bdb3492d5e8cb79628a3b04e8c8wrowe the journal file to incorporate into the zone any updates that
7b6ba9c468f26bdb3492d5e8cb79628a3b04e8c8wrowe took
7b6ba9c468f26bdb3492d5e8cb79628a3b04e8c8wrowe place after the last zone dump.
77edcaaccc089335938f3844b752e1044f7eb278trawick </p>
77edcaaccc089335938f3844b752e1044f7eb278trawick<p>
77edcaaccc089335938f3844b752e1044f7eb278trawick Changes that result from incoming incremental zone transfers are
77edcaaccc089335938f3844b752e1044f7eb278trawick also
59b1b6c3fd51c83c3bb9f02a8f08751335f9fb1dminfrin journalled in a similar way.
59b1b6c3fd51c83c3bb9f02a8f08751335f9fb1dminfrin </p>
59b1b6c3fd51c83c3bb9f02a8f08751335f9fb1dminfrin<p>
59b1b6c3fd51c83c3bb9f02a8f08751335f9fb1dminfrin The zone files of dynamic zones cannot normally be edited by
9f1a88897168c3f1e5009acb585daf01e38a0299jim hand because they are not guaranteed to contain the most recent
9f1a88897168c3f1e5009acb585daf01e38a0299jim dynamic changes &#8212; those are only in the journal file.
9f1a88897168c3f1e5009acb585daf01e38a0299jim The only way to ensure that the zone file of a dynamic zone
9f1a88897168c3f1e5009acb585daf01e38a0299jim is up to date is to run <span><strong class="command">rndc stop</strong></span>.
616a448c1fca1648622707df5a1aae7316bb3d5djim </p>
616a448c1fca1648622707df5a1aae7316bb3d5djim<p>
616a448c1fca1648622707df5a1aae7316bb3d5djim If you have to make changes to a dynamic zone
616a448c1fca1648622707df5a1aae7316bb3d5djim manually, the following procedure will work: Disable dynamic updates
36bfefb6940a90242290e5b5713a2d831275eef1jim to the zone using
5a8bb5948d2a258145174320587706de3219d8a3pquerna <span><strong class="command">rndc freeze <em class="replaceable"><code>zone</code></em></strong></span>.
5a8bb5948d2a258145174320587706de3219d8a3pquerna This will also remove the zone's <code class="filename">.jnl</code> file
5a8bb5948d2a258145174320587706de3219d8a3pquerna and update the master file. Edit the zone file. Run
5a8bb5948d2a258145174320587706de3219d8a3pquerna <span><strong class="command">rndc thaw <em class="replaceable"><code>zone</code></em></strong></span>
0cba3a63e59bfa77f67955cb4e034264ed6c5523jerenkrantz to reload the changed zone and re-enable dynamic updates.
0cba3a63e59bfa77f67955cb4e034264ed6c5523jerenkrantz </p>
e5abee85fe751fc27c5d4fc9a8ebe3b80f3d6603trawick</div>
e5abee85fe751fc27c5d4fc9a8ebe3b80f3d6603trawick</div>
e5abee85fe751fc27c5d4fc9a8ebe3b80f3d6603trawick<div class="sect1" lang="en">
ca3a25d12c5fe0926aa97550be39f0d88d0decb1pquerna<div class="titlepage"><div><div><h2 class="title" style="clear: both">
ca3a25d12c5fe0926aa97550be39f0d88d0decb1pquerna<a name="incremental_zone_transfers"></a>Incremental Zone Transfers (IXFR)</h2></div></div></div>
ca3a25d12c5fe0926aa97550be39f0d88d0decb1pquerna<p>
ca3a25d12c5fe0926aa97550be39f0d88d0decb1pquerna The incremental zone transfer (IXFR) protocol is a way for
74def8815c725f8128a4e76ab1f5704df80b024ajerenkrantz slave servers to transfer only changed data, instead of having to
74def8815c725f8128a4e76ab1f5704df80b024ajerenkrantz transfer the entire zone. The IXFR protocol is specified in RFC
4d553781254e46f1dfc8d86b79667a74fb8a3eb5brianp 1995. See <a href="Bv9ARM.ch09.html#proposed_standards">Proposed Standards</a>.
74def8815c725f8128a4e76ab1f5704df80b024ajerenkrantz </p>
8f868f15482c7406db01216b6e4778ddabb26898trawick<p>
8f868f15482c7406db01216b6e4778ddabb26898trawick When acting as a master, <acronym class="acronym">BIND</acronym> 9
8f868f15482c7406db01216b6e4778ddabb26898trawick supports IXFR for those zones
8f868f15482c7406db01216b6e4778ddabb26898trawick where the necessary change history information is available. These
f902601ea431a9b56106e0f5f641dd5fd7efbc30jorton include master zones maintained by dynamic update and slave zones
f902601ea431a9b56106e0f5f641dd5fd7efbc30jorton whose data was obtained by IXFR. For manually maintained master
f902601ea431a9b56106e0f5f641dd5fd7efbc30jorton zones, and for slave zones obtained by performing a full zone
f902601ea431a9b56106e0f5f641dd5fd7efbc30jorton transfer (AXFR), IXFR is supported only if the option
1e1e4f4f810b99732f06fc05141f42ca1965a9edpquerna <span><strong class="command">ixfr-from-differences</strong></span> is set
1e1e4f4f810b99732f06fc05141f42ca1965a9edpquerna to <strong class="userinput"><code>yes</code></strong>.
1e1e4f4f810b99732f06fc05141f42ca1965a9edpquerna </p>
1e1e4f4f810b99732f06fc05141f42ca1965a9edpquerna<p>
5f80956ca9d98d5482f38eef0c465df0923d7781jerenkrantz When acting as a slave, <acronym class="acronym">BIND</acronym> 9 will
5f80956ca9d98d5482f38eef0c465df0923d7781jerenkrantz attempt to use IXFR unless
78fcc425fc9fc58202a1693fe40dd0ce75c031ffjorton it is explicitly disabled. For more information about disabling
78fcc425fc9fc58202a1693fe40dd0ce75c031ffjorton IXFR, see the description of the <span><strong class="command">request-ixfr</strong></span> clause
78fcc425fc9fc58202a1693fe40dd0ce75c031ffjorton of the <span><strong class="command">server</strong></span> statement.
78fcc425fc9fc58202a1693fe40dd0ce75c031ffjorton </p>
d2ffb32434f79782ff7a364ffa31064698c5c645jorton</div>
d2ffb32434f79782ff7a364ffa31064698c5c645jorton<div class="sect1" lang="en">
d2ffb32434f79782ff7a364ffa31064698c5c645jorton<div class="titlepage"><div><div><h2 class="title" style="clear: both">
d2ffb32434f79782ff7a364ffa31064698c5c645jorton<a name="id2571285"></a>Split DNS</h2></div></div></div>
01847067cfc639c14e1aa77d3b3e98f239447a12jerenkrantz<p>
01847067cfc639c14e1aa77d3b3e98f239447a12jerenkrantz Setting up different views, or visibility, of the DNS space to
01847067cfc639c14e1aa77d3b3e98f239447a12jerenkrantz internal and external resolvers is usually referred to as a
01847067cfc639c14e1aa77d3b3e98f239447a12jerenkrantz <span class="emphasis"><em>Split DNS</em></span> setup. There are several
9fe74ffcdea85800f04a7222f716f78ae60cce51jerenkrantz reasons an organization would want to set up its DNS this way.
9fe74ffcdea85800f04a7222f716f78ae60cce51jerenkrantz </p>
9fe74ffcdea85800f04a7222f716f78ae60cce51jerenkrantz<p>
dae3cb64cc6681b5f6b0fd12e7f8f6296ffaa19abnicholes One common reason for setting up a DNS system this way is
dae3cb64cc6681b5f6b0fd12e7f8f6296ffaa19abnicholes to hide "internal" DNS information from "external" clients on the
d2ffb32434f79782ff7a364ffa31064698c5c645jorton Internet. There is some debate as to whether or not this is actually
9fe74ffcdea85800f04a7222f716f78ae60cce51jerenkrantz useful.
81540a0eb1da2c687e22de3367d8ded55e17e330pquerna Internal DNS information leaks out in many ways (via email headers,
d2ffb32434f79782ff7a364ffa31064698c5c645jorton for example) and most savvy "attackers" can find the information
81540a0eb1da2c687e22de3367d8ded55e17e330pquerna they need using other means.
ce66c67eba79a20118d8664b65b0c9eeec1bebdabnicholes However, since listing addresses of internal servers that
ce66c67eba79a20118d8664b65b0c9eeec1bebdabnicholes external clients cannot possibly reach can result in
ce66c67eba79a20118d8664b65b0c9eeec1bebdabnicholes connection delays and other annoyances, an organization may
ce66c67eba79a20118d8664b65b0c9eeec1bebdabnicholes choose to use a Split DNS to present a consistent view of itself
ce66c67eba79a20118d8664b65b0c9eeec1bebdabnicholes to the outside world.
ce66c67eba79a20118d8664b65b0c9eeec1bebdabnicholes </p>
6cfc2ed5a8e633c5a40fec65775868d53952d992trawick<p>
6cfc2ed5a8e633c5a40fec65775868d53952d992trawick Another common reason for setting up a Split DNS system is
6cfc2ed5a8e633c5a40fec65775868d53952d992trawick to allow internal networks that are behind filters or in RFC 1918
6cfc2ed5a8e633c5a40fec65775868d53952d992trawick space (reserved IP space, as documented in RFC 1918) to resolve DNS
6cfc2ed5a8e633c5a40fec65775868d53952d992trawick on the Internet. Split DNS can also be used to allow mail from outside
6cfc2ed5a8e633c5a40fec65775868d53952d992trawick back in to the internal network.
e34223f72e630187c4d8ac7c22da5096c833eb20trawick </p>
e34223f72e630187c4d8ac7c22da5096c833eb20trawick<div class="sect2" lang="en">
e34223f72e630187c4d8ac7c22da5096c833eb20trawick<div class="titlepage"><div><div><h3 class="title">
5159c40648868a58745aa11981f706948ff0f0d1pquerna<a name="id2571303"></a>Example split DNS setup</h3></div></div></div>
5159c40648868a58745aa11981f706948ff0f0d1pquerna<p>
5159c40648868a58745aa11981f706948ff0f0d1pquerna Let's say a company named <span class="emphasis"><em>Example, Inc.</em></span>
c178b761acd6bffa199c2fd28c4469492b989699nd (<code class="literal">example.com</code>)
c178b761acd6bffa199c2fd28c4469492b989699nd has several corporate sites that have an internal network with
c178b761acd6bffa199c2fd28c4469492b989699nd reserved
9c6bbd67082b5a47fb17cfa5b61b8a7e1fb01875pquerna Internet Protocol (IP) space and an external demilitarized zone (DMZ),
9c6bbd67082b5a47fb17cfa5b61b8a7e1fb01875pquerna or "outside" section of a network, that is available to the public.
9c6bbd67082b5a47fb17cfa5b61b8a7e1fb01875pquerna </p>
9c6bbd67082b5a47fb17cfa5b61b8a7e1fb01875pquerna<p>
572f5b8a84bb399e51b02a562776f4aec119aa95pquerna <span class="emphasis"><em>Example, Inc.</em></span> wants its internal clients
572f5b8a84bb399e51b02a562776f4aec119aa95pquerna to be able to resolve external hostnames and to exchange mail with
572f5b8a84bb399e51b02a562776f4aec119aa95pquerna people on the outside. The company also wants its internal resolvers
572f5b8a84bb399e51b02a562776f4aec119aa95pquerna to have access to certain internal-only zones that are not available
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz at all outside of the internal network.
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz </p>
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz<p>
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz In order to accomplish this, the company will set up two sets
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz of name servers. One set will be on the inside network (in the
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz reserved
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz IP space) and the other set will be on bastion hosts, which are
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz "proxy"
1b03ca18c41f51a25dcf1a623a8f558bd779e0a4jerenkrantz hosts that can talk to both sides of its network, in the DMZ.
db443e0132f14dac789ab97ec23ce124360d74c2nd </p>
db443e0132f14dac789ab97ec23ce124360d74c2nd<p>
db443e0132f14dac789ab97ec23ce124360d74c2nd The internal servers will be configured to forward all queries,
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes except queries for <code class="filename">site1.internal</code>, <code class="filename">site2.internal</code>, <code class="filename">site1.example.com</code>,
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes and <code class="filename">site2.example.com</code>, to the servers
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes in the
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes DMZ. These internal servers will have complete sets of information
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes for <code class="filename">site1.example.com</code>, <code class="filename">site2.example.com</code>, <code class="filename">site1.internal</code>,
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes and <code class="filename">site2.internal</code>.
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes </p>
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes<p>
4ac7a7c09ac5732b09f8bf28873f7e9efcab34d5bnicholes To protect the <code class="filename">site1.internal</code> and <code class="filename">site2.internal</code> domains,
ce8490f3812311582d1deee96b012c377311b317minfrin the internal name servers must be configured to disallow all queries
ce8490f3812311582d1deee96b012c377311b317minfrin to these domains from any external hosts, including the bastion
ce8490f3812311582d1deee96b012c377311b317minfrin hosts.
38f6ebaca968b7b23c25c0b30d0be1c7aad7412bjorton </p>
38f6ebaca968b7b23c25c0b30d0be1c7aad7412bjorton<p>
38f6ebaca968b7b23c25c0b30d0be1c7aad7412bjorton The external servers, which are on the bastion hosts, will
cc7d8b55b16eee88be925a090473ca94b0a6e770jorton be configured to serve the "public" version of the <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones.
cc7d8b55b16eee88be925a090473ca94b0a6e770jorton This could include things such as the host records for public servers
cc7d8b55b16eee88be925a090473ca94b0a6e770jorton (<code class="filename">www.example.com</code> and <code class="filename">ftp.example.com</code>),
f2b43354f9ac8496ab7003ae01211af739efba1atrawick and mail exchange (MX) records (<code class="filename">a.mx.example.com</code> and <code class="filename">b.mx.example.com</code>).
f2b43354f9ac8496ab7003ae01211af739efba1atrawick </p>
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe<p>
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe In addition, the public <code class="filename">site1</code> and <code class="filename">site2.example.com</code> zones
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe should have special MX records that contain wildcard (`*') records
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe pointing to the bastion hosts. This is needed because external mail
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe servers do not have any other way of looking up how to deliver mail
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe to those internal hosts. With the wildcard records, the mail will
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe be delivered to the bastion host, which can then forward it on to
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe internal hosts.
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe </p>
eb6e3a3e784021abc1e28247158db3a8b07186b9minfrin<p>
eb6e3a3e784021abc1e28247158db3a8b07186b9minfrin Here's an example of a wildcard MX record:
eb6e3a3e784021abc1e28247158db3a8b07186b9minfrin </p>
eb6e3a3e784021abc1e28247158db3a8b07186b9minfrin<pre class="programlisting">* IN MX 10 external1.example.com.</pre>
f5098e2eb6ed9dfd7052f25761bb5e97779b8460minfrin<p>
f5098e2eb6ed9dfd7052f25761bb5e97779b8460minfrin Now that they accept mail on behalf of anything in the internal
f5098e2eb6ed9dfd7052f25761bb5e97779b8460minfrin network, the bastion hosts will need to know how to deliver mail
d86551ca954d666d5b15ad38e9daf45680516c25jerenkrantz to internal hosts. In order for this to work properly, the resolvers
d86551ca954d666d5b15ad38e9daf45680516c25jerenkrantz on
c79b5caf7c5462ef707363c69cc63ea2606310abtrawick the bastion hosts will need to be configured to point to the internal
c79b5caf7c5462ef707363c69cc63ea2606310abtrawick name servers for DNS resolution.
c79b5caf7c5462ef707363c69cc63ea2606310abtrawick </p>
1551c2366551d7a361bedbf7ae54f1abd74ef822minfrin<p>
1551c2366551d7a361bedbf7ae54f1abd74ef822minfrin Queries for internal hostnames will be answered by the internal
1551c2366551d7a361bedbf7ae54f1abd74ef822minfrin servers, and queries for external hostnames will be forwarded back
f1826b4cf1fbeb049c569761cc95b04e3496efd6bnicholes out to the DNS servers on the bastion hosts.
f1826b4cf1fbeb049c569761cc95b04e3496efd6bnicholes </p>
f1826b4cf1fbeb049c569761cc95b04e3496efd6bnicholes<p>
f1826b4cf1fbeb049c569761cc95b04e3496efd6bnicholes In order for all this to work properly, internal clients will
103a93c625bcde1a6a7a5155b64dcda36f612180pquerna need to be configured to query <span class="emphasis"><em>only</em></span> the internal
103a93c625bcde1a6a7a5155b64dcda36f612180pquerna name servers for DNS queries. This could also be enforced via
103a93c625bcde1a6a7a5155b64dcda36f612180pquerna selective
103a93c625bcde1a6a7a5155b64dcda36f612180pquerna filtering on the network.
87a528a7622973988232079ba02763748c9c7071pquerna </p>
87a528a7622973988232079ba02763748c9c7071pquerna<p>
87a528a7622973988232079ba02763748c9c7071pquerna If everything has been set properly, <span class="emphasis"><em>Example, Inc.</em></span>'s
1a986bbad9314beb8739401cac822e87bb04bbfepquerna internal clients will now be able to:
1a986bbad9314beb8739401cac822e87bb04bbfepquerna </p>
1a986bbad9314beb8739401cac822e87bb04bbfepquerna<div class="itemizedlist"><ul type="disc">
1a986bbad9314beb8739401cac822e87bb04bbfepquerna<li>
1a986bbad9314beb8739401cac822e87bb04bbfepquerna Look up any hostnames in the <code class="literal">site1</code>
752ec04fdfa6e936047811b9e506cf829d7a69f7pquerna and
752ec04fdfa6e936047811b9e506cf829d7a69f7pquerna <code class="literal">site2.example.com</code> zones.
752ec04fdfa6e936047811b9e506cf829d7a69f7pquerna </li>
752ec04fdfa6e936047811b9e506cf829d7a69f7pquerna<li>
cf82d17373559b6163dbd6c844c1af82cab56883niq Look up any hostnames in the <code class="literal">site1.internal</code> and
cf82d17373559b6163dbd6c844c1af82cab56883niq <code class="literal">site2.internal</code> domains.
cf82d17373559b6163dbd6c844c1af82cab56883niq </li>
cf82d17373559b6163dbd6c844c1af82cab56883niq<li>Look up any hostnames on the Internet.</li>
c4e6f5320f87eff25838c21c107a24b688d539d0niq<li>Exchange mail with both internal and external people.</li>
c4e6f5320f87eff25838c21c107a24b688d539d0niq</ul></div>
c4e6f5320f87eff25838c21c107a24b688d539d0niq<p>
c4e6f5320f87eff25838c21c107a24b688d539d0niq Hosts on the Internet will be able to:
c4e6f5320f87eff25838c21c107a24b688d539d0niq </p>
c4e6f5320f87eff25838c21c107a24b688d539d0niq<div class="itemizedlist"><ul type="disc">
c4e6f5320f87eff25838c21c107a24b688d539d0niq<li>
174a8f105b1c11aa50a05993ea8ba2d117d3df6end Look up any hostnames in the <code class="literal">site1</code>
174a8f105b1c11aa50a05993ea8ba2d117d3df6end and
174a8f105b1c11aa50a05993ea8ba2d117d3df6end <code class="literal">site2.example.com</code> zones.
174a8f105b1c11aa50a05993ea8ba2d117d3df6end </li>
174a8f105b1c11aa50a05993ea8ba2d117d3df6end<li>
3ad0f071604de33c0b3733b649cd0445ba00f54dake Exchange mail with anyone in the <code class="literal">site1</code> and
3ad0f071604de33c0b3733b649cd0445ba00f54dake <code class="literal">site2.example.com</code> zones.
3ad0f071604de33c0b3733b649cd0445ba00f54dake </li>
c2549f0b237ac86f3623a601a766969d805dbc2and</ul></div>
c2549f0b237ac86f3623a601a766969d805dbc2and<p>
c2549f0b237ac86f3623a601a766969d805dbc2and Here is an example configuration for the setup we just
7efe7de73c89c26518714a504359244d03cfbbc5jorton described above. Note that this is only configuration information;
7efe7de73c89c26518714a504359244d03cfbbc5jorton for information on how to configure your zone files, see <a href="Bv9ARM.ch03.html#sample_configuration" title="Sample Configurations">the section called &#8220;Sample Configurations&#8221;</a>.
f84d3d83a741c21154d42e0ebdec9b9b37efeedcjorton </p>
f84d3d83a741c21154d42e0ebdec9b9b37efeedcjorton<p>
7efe7de73c89c26518714a504359244d03cfbbc5jorton Internal DNS server config:
d60027cde3289d3ef35bc9d815882975eb60e6abjorton </p>
d60027cde3289d3ef35bc9d815882975eb60e6abjorton<pre class="programlisting">
d60027cde3289d3ef35bc9d815882975eb60e6abjorton
d60027cde3289d3ef35bc9d815882975eb60e6abjortonacl internals { 172.16.72.0/24; 192.168.1.0/24; };
504498fd20729dcc29dfbfb78e64a8521c6a767ajerenkrantz
504498fd20729dcc29dfbfb78e64a8521c6a767ajerenkrantzacl externals { <code class="varname">bastion-ips-go-here</code>; };
504498fd20729dcc29dfbfb78e64a8521c6a767ajerenkrantz
d406be0d6a4f9e61bbdfa6c8cde2e09338dd650atrawickoptions {
d406be0d6a4f9e61bbdfa6c8cde2e09338dd650atrawick ...
d406be0d6a4f9e61bbdfa6c8cde2e09338dd650atrawick ...
269e0a31aa0f6aafe7292e932a182ccb535e55a9trawick forward only;
c1ba3b0ac00c4fee2f4b950dfdb167b39611b661nd // forward to external servers
c1ba3b0ac00c4fee2f4b950dfdb167b39611b661nd forwarders {
c1ba3b0ac00c4fee2f4b950dfdb167b39611b661nd <code class="varname">bastion-ips-go-here</code>;
b95a84193578c904426cef6dda84f7118a400a16jim };
b95a84193578c904426cef6dda84f7118a400a16jim // sample allow-transfer (no one)
b95a84193578c904426cef6dda84f7118a400a16jim allow-transfer { none; };
b95a84193578c904426cef6dda84f7118a400a16jim // restrict query access
03a3ed87983471816561562f957390ed935d7b3bnd allow-query { internals; externals; };
03a3ed87983471816561562f957390ed935d7b3bnd // restrict recursion
03a3ed87983471816561562f957390ed935d7b3bnd allow-recursion { internals; };
03a3ed87983471816561562f957390ed935d7b3bnd ...
c533ecac2227dc228070e686fb14dc6860f497f8nd ...
56cefde0af6b8db6fda0f1d95d8cdca54f397cd0nd};
56cefde0af6b8db6fda0f1d95d8cdca54f397cd0nd
56cefde0af6b8db6fda0f1d95d8cdca54f397cd0nd// sample master zone
41369ed0bc7f2db6272278c27025f6aabf97fe63ndzone "site1.example.com" {
41369ed0bc7f2db6272278c27025f6aabf97fe63nd type master;
41369ed0bc7f2db6272278c27025f6aabf97fe63nd file "m/site1.example.com";
496f8f3966319d43455675630a849bae019d2a32nd // do normal iterative resolution (do not forward)
496f8f3966319d43455675630a849bae019d2a32nd forwarders { };
9e8c2603790f490398a0fabf97866b6815748a54ianh allow-query { internals; externals; };
9e8c2603790f490398a0fabf97866b6815748a54ianh allow-transfer { internals; };
9e8c2603790f490398a0fabf97866b6815748a54ianh};
9e8c2603790f490398a0fabf97866b6815748a54ianh
a21b3b9d8ebb12fd51fa1d17e44d5644a35a9a5fnd// sample slave zone
a21b3b9d8ebb12fd51fa1d17e44d5644a35a9a5fndzone "site2.example.com" {
a21b3b9d8ebb12fd51fa1d17e44d5644a35a9a5fnd type slave;
1fbcf7a8e7b18be1b0e77b7bc38b7b71f8dfb052nd file "s/site2.example.com";
1fbcf7a8e7b18be1b0e77b7bc38b7b71f8dfb052nd masters { 172.16.72.3; };
1fbcf7a8e7b18be1b0e77b7bc38b7b71f8dfb052nd forwarders { };
f769c33501f474aed3e0f7c769477c8c4f478783geoff allow-query { internals; externals; };
f769c33501f474aed3e0f7c769477c8c4f478783geoff allow-transfer { internals; };
f769c33501f474aed3e0f7c769477c8c4f478783geoff};
f769c33501f474aed3e0f7c769477c8c4f478783geoff
d7c7669331357296719d67d1963d40d713ed455atrawickzone "site1.internal" {
d7c7669331357296719d67d1963d40d713ed455atrawick type master;
d7c7669331357296719d67d1963d40d713ed455atrawick file "m/site1.internal";
d7c7669331357296719d67d1963d40d713ed455atrawick forwarders { };
92d95be777d4365eb79444a7a558355a7a92081ajorton allow-query { internals; };
92d95be777d4365eb79444a7a558355a7a92081ajorton allow-transfer { internals; }
92d95be777d4365eb79444a7a558355a7a92081ajorton};
92d95be777d4365eb79444a7a558355a7a92081ajorton
af8dee354a287249dd9f3f77bbe850108e5afe43trawickzone "site2.internal" {
af8dee354a287249dd9f3f77bbe850108e5afe43trawick type slave;
af8dee354a287249dd9f3f77bbe850108e5afe43trawick file "s/site2.internal";
af8dee354a287249dd9f3f77bbe850108e5afe43trawick masters { 172.16.72.3; };
af8dee354a287249dd9f3f77bbe850108e5afe43trawick forwarders { };
14763a0db22322626dd8cd59dfbc3a4fcc655d99trawick allow-query { internals };
f78505c7d260473bf11002f5028186f27d0ed8a0geoff allow-transfer { internals; }
f78505c7d260473bf11002f5028186f27d0ed8a0geoff};
f78505c7d260473bf11002f5028186f27d0ed8a0geoff</pre>
f78505c7d260473bf11002f5028186f27d0ed8a0geoff<p>
f78505c7d260473bf11002f5028186f27d0ed8a0geoff External (bastion host) DNS server config:
f78505c7d260473bf11002f5028186f27d0ed8a0geoff </p>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd<pre class="programlisting">
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9ndacl internals { 172.16.72.0/24; 192.168.1.0/24; };
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9ndacl externals { bastion-ips-go-here; };
d57b793ddd42a997c2cb3bd389bbcf1161226fd8trawick
d57b793ddd42a997c2cb3bd389bbcf1161226fd8trawickoptions {
d57b793ddd42a997c2cb3bd389bbcf1161226fd8trawick ...
d11bf78168abbb07d8ed9f54d7ea0953d46aad83nd ...
d11bf78168abbb07d8ed9f54d7ea0953d46aad83nd // sample allow-transfer (no one)
d11bf78168abbb07d8ed9f54d7ea0953d46aad83nd allow-transfer { none; };
d11bf78168abbb07d8ed9f54d7ea0953d46aad83nd // default query access
bf28a00d8218aa76a56eddabca308e8d0e691626nd allow-query { any; };
bf28a00d8218aa76a56eddabca308e8d0e691626nd // restrict cache access
bf28a00d8218aa76a56eddabca308e8d0e691626nd allow-query-cache { internals; externals; };
bf28a00d8218aa76a56eddabca308e8d0e691626nd // restrict recursion
bf28a00d8218aa76a56eddabca308e8d0e691626nd allow-recursion { internals; externals; };
70f665a8945f3bdfe8bbeaa063de2aa722fc9b29nd ...
70f665a8945f3bdfe8bbeaa063de2aa722fc9b29nd ...
70f665a8945f3bdfe8bbeaa063de2aa722fc9b29nd};
c08f5a0cf2b8903255186ba998a4481dfac9c796nd
c08f5a0cf2b8903255186ba998a4481dfac9c796nd// sample slave zone
c08f5a0cf2b8903255186ba998a4481dfac9c796ndzone "site1.example.com" {
c08f5a0cf2b8903255186ba998a4481dfac9c796nd type master;
5bcdf2cd27ab0c91a3c7eaffbff4cb8505389dc1nd file "m/site1.foo.com";
5bcdf2cd27ab0c91a3c7eaffbff4cb8505389dc1nd allow-transfer { internals; externals; };
5bcdf2cd27ab0c91a3c7eaffbff4cb8505389dc1nd};
02b0660d7f44ff8106bd5095653e9c19e39ec37dnd
02b0660d7f44ff8106bd5095653e9c19e39ec37dndzone "site2.example.com" {
02b0660d7f44ff8106bd5095653e9c19e39ec37dnd type slave;
5b8e35ad88268c0210d93288dad57c2f1d3e8811nd file "s/site2.foo.com";
5b8e35ad88268c0210d93288dad57c2f1d3e8811nd masters { another_bastion_host_maybe; };
5b8e35ad88268c0210d93288dad57c2f1d3e8811nd allow-transfer { internals; externals; }
a9ee8e9bd3dffd23ca49be8d0bdf0e33cd0bcce2jorton};
a9ee8e9bd3dffd23ca49be8d0bdf0e33cd0bcce2jorton</pre>
a9ee8e9bd3dffd23ca49be8d0bdf0e33cd0bcce2jorton<p>
3b86be5b30d5cbacc1f942b05dff8a9365449d30jorton In the <code class="filename">resolv.conf</code> (or equivalent) on
8d9494af6ddb7a9c998b1b622e0bcd8d17cac50ejorton the bastion host(s):
3b86be5b30d5cbacc1f942b05dff8a9365449d30jorton </p>
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd<pre class="programlisting">
9026fcf39ea5fbacee72b6c4f68e6c778dbad478ndsearch ...
8aad5258d3ecde3751559bc685a3185e63cbde9aianhnameserver 172.16.72.2
8aad5258d3ecde3751559bc685a3185e63cbde9aianhnameserver 172.16.72.3
71f3601de4983bc2a6aaffcf37dc1d35c8674a34coarnameserver 172.16.72.4
71f3601de4983bc2a6aaffcf37dc1d35c8674a34coar</pre>
71f3601de4983bc2a6aaffcf37dc1d35c8674a34coar</div>
71f3601de4983bc2a6aaffcf37dc1d35c8674a34coar</div>
49a82db11388cff9b29ff861b4241bbce69c76fdtrawick<div class="sect1" lang="en">
49a82db11388cff9b29ff861b4241bbce69c76fdtrawick<div class="titlepage"><div><div><h2 class="title" style="clear: both">
49a82db11388cff9b29ff861b4241bbce69c76fdtrawick<a name="tsig"></a>TSIG</h2></div></div></div>
49a82db11388cff9b29ff861b4241bbce69c76fdtrawick<p>
f23c50b3628a8571da2ff3277ae58ef1d675554ftrawick This is a short guide to setting up Transaction SIGnatures
f23c50b3628a8571da2ff3277ae58ef1d675554ftrawick (TSIG) based transaction security in <acronym class="acronym">BIND</acronym>. It describes changes
f23c50b3628a8571da2ff3277ae58ef1d675554ftrawick to the configuration file as well as what changes are required for
f23c50b3628a8571da2ff3277ae58ef1d675554ftrawick different features, including the process of creating transaction
8dc154408549195c828b823e9dc7396f107f2512jorton keys and using transaction signatures with <acronym class="acronym">BIND</acronym>.
8dc154408549195c828b823e9dc7396f107f2512jorton </p>
8dc154408549195c828b823e9dc7396f107f2512jorton<p>
ca2504b59d48a926af23f6b18af550c1e892d8a6jorton <acronym class="acronym">BIND</acronym> primarily supports TSIG for server
ca2504b59d48a926af23f6b18af550c1e892d8a6jorton to server communication.
ca2504b59d48a926af23f6b18af550c1e892d8a6jorton This includes zone transfer, notify, and recursive query messages.
6126fad8adeca94e9813812c691747afeca164dftrawick Resolvers based on newer versions of <acronym class="acronym">BIND</acronym> 8 have limited support
6126fad8adeca94e9813812c691747afeca164dftrawick for TSIG.
6126fad8adeca94e9813812c691747afeca164dftrawick </p>
7ed5992392d5babab20be4ce4029ad17ae062b5aianh<p>
7ed5992392d5babab20be4ce4029ad17ae062b5aianh TSIG can also be useful for dynamic update. A primary
7ed5992392d5babab20be4ce4029ad17ae062b5aianh server for a dynamic zone should control access to the dynamic
b7973a1e572a3ff7cdedb48ed1f9481ece700bf9trawick update service, but IP-based access control is insufficient.
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe The cryptographic access control provided by TSIG
b7973a1e572a3ff7cdedb48ed1f9481ece700bf9trawick is far superior. The <span><strong class="command">nsupdate</strong></span>
5c4e29c5f77fbc967d78886ab378b9500267b0fbtrawick program supports TSIG via the <code class="option">-k</code> and
5c4e29c5f77fbc967d78886ab378b9500267b0fbtrawick <code class="option">-y</code> command line options or inline by use
5c4e29c5f77fbc967d78886ab378b9500267b0fbtrawick of the <span><strong class="command">key</strong></span>.
1fbf6ba0f5207e6637b49f9a9dfcc779bbe952a9trawick </p>
1fbf6ba0f5207e6637b49f9a9dfcc779bbe952a9trawick<div class="sect2" lang="en">
6c4c113ce85934b11c9e78399e1bb8ec7a568af9nd<div class="titlepage"><div><div><h3 class="title">
6c4c113ce85934b11c9e78399e1bb8ec7a568af9nd<a name="id2571873"></a>Generate Shared Keys for Each Pair of Hosts</h3></div></div></div>
679cafe33462d8c6bd0a74cc4359e561d19a0aafnd<p>
679cafe33462d8c6bd0a74cc4359e561d19a0aafnd A shared secret is generated to be shared between <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host2</em></span>.
6c4c113ce85934b11c9e78399e1bb8ec7a568af9nd An arbitrary key name is chosen: "host1-host2.". The key name must
81ef3d132c8f335006465f297c42319f8734825dnd be the same on both hosts.
81ef3d132c8f335006465f297c42319f8734825dnd </p>
81ef3d132c8f335006465f297c42319f8734825dnd<div class="sect3" lang="en">
73291de2e17c97d3549f2f8aa085ca43d27e108and<div class="titlepage"><div><div><h4 class="title">
73291de2e17c97d3549f2f8aa085ca43d27e108and<a name="id2571890"></a>Automatic Generation</h4></div></div></div>
73291de2e17c97d3549f2f8aa085ca43d27e108and<p>
73291de2e17c97d3549f2f8aa085ca43d27e108and The following command will generate a 128-bit (16 byte) HMAC-SHA256
3caed8f01e7d67f3ad5d47cb28bb4e43131652fdjerenkrantz key as described above. Longer keys are better, but shorter keys
3caed8f01e7d67f3ad5d47cb28bb4e43131652fdjerenkrantz are easier to read. Note that the maximum key length is the digest
3caed8f01e7d67f3ad5d47cb28bb4e43131652fdjerenkrantz length, here 256 bits.
238e707c9022eaa8332a702dd6913dd0d1fb3df8jerenkrantz </p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>
3caed8f01e7d67f3ad5d47cb28bb4e43131652fdjerenkrantz <strong class="userinput"><code>dnssec-keygen -a hmac-sha256 -b 128 -n HOST host1-host2.</code></strong>
e127d82e8afc2f885fe2183b68d4a110580d21dfjwoolley </p>
e127d82e8afc2f885fe2183b68d4a110580d21dfjwoolley<p>
e127d82e8afc2f885fe2183b68d4a110580d21dfjwoolley The key is in the file <code class="filename">Khost1-host2.+163+00000.private</code>.
e127d82e8afc2f885fe2183b68d4a110580d21dfjwoolley Nothing directly uses this file, but the base-64 encoded string
fd99717a52886f7d9f9f73be2080d3fdc2ec4bd6nd following "<code class="literal">Key:</code>"
fd99717a52886f7d9f9f73be2080d3fdc2ec4bd6nd can be extracted from the file and used as a shared secret:
fd99717a52886f7d9f9f73be2080d3fdc2ec4bd6nd </p>
5fb2e8564729922524cd011b11e2d4f5d76f5a8dnd<pre class="programlisting">Key: La/E5CjG9O+os1jq0a2jdA==</pre>
5fb2e8564729922524cd011b11e2d4f5d76f5a8dnd<p>
5fb2e8564729922524cd011b11e2d4f5d76f5a8dnd The string "<code class="literal">La/E5CjG9O+os1jq0a2jdA==</code>" can
987c2c2ff2f19f306357f79d3280b347d96c470fnd be used as the shared secret.
987c2c2ff2f19f306357f79d3280b347d96c470fnd </p>
987c2c2ff2f19f306357f79d3280b347d96c470fnd</div>
987c2c2ff2f19f306357f79d3280b347d96c470fnd<div class="sect3" lang="en">
a4dd3688dd6645faf0c1c1bfb22017c8f03d5b24nd<div class="titlepage"><div><div><h4 class="title">
a4dd3688dd6645faf0c1c1bfb22017c8f03d5b24nd<a name="id2571928"></a>Manual Generation</h4></div></div></div>
a4dd3688dd6645faf0c1c1bfb22017c8f03d5b24nd<p>
f2fe083bb9fabd2af7eb39d4f154f27a451bb5a4nd The shared secret is simply a random sequence of bits, encoded
f2fe083bb9fabd2af7eb39d4f154f27a451bb5a4nd in base-64. Most ASCII strings are valid base-64 strings (assuming
f2fe083bb9fabd2af7eb39d4f154f27a451bb5a4nd the length is a multiple of 4 and only valid characters are used),
f2fe083bb9fabd2af7eb39d4f154f27a451bb5a4nd so the shared secret can be manually generated.
7de6cb79f71a9007ba2b1e786cbad8b84f05d101nd </p>
7de6cb79f71a9007ba2b1e786cbad8b84f05d101nd<p>
7de6cb79f71a9007ba2b1e786cbad8b84f05d101nd Also, a known string can be run through <span><strong class="command">mmencode</strong></span> or
7de6cb79f71a9007ba2b1e786cbad8b84f05d101nd a similar program to generate base-64 encoded data.
aa9b03a5f32732c0caaef03a7ed78ffb290e29e4trawick </p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe</div>
aa9b03a5f32732c0caaef03a7ed78ffb290e29e4trawick</div>
ab56518227d474ee08f039e4c5540011c1b8a913trawick<div class="sect2" lang="en">
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<div class="titlepage"><div><div><h3 class="title">
ab56518227d474ee08f039e4c5540011c1b8a913trawick<a name="id2563959"></a>Copying the Shared Secret to Both Machines</h3></div></div></div>
a18a308d7a942230edcde1bf00d7ae9b4b143c90trawick<p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe This is beyond the scope of DNS. A secure transport mechanism
a18a308d7a942230edcde1bf00d7ae9b4b143c90trawick should be used. This could be secure FTP, ssh, telephone, etc.
3b872593fd5f61981d9dd69a4b0b5d5f5f668929trawick </p>
3b872593fd5f61981d9dd69a4b0b5d5f5f668929trawick</div>
3b872593fd5f61981d9dd69a4b0b5d5f5f668929trawick<div class="sect2" lang="en">
fc25339741311efd7d460f18b6287ef38d76bbe6madhum<div class="titlepage"><div><div><h3 class="title">
fc25339741311efd7d460f18b6287ef38d76bbe6madhum<a name="id2563970"></a>Informing the Servers of the Key's Existence</h3></div></div></div>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>
fc25339741311efd7d460f18b6287ef38d76bbe6madhum Imagine <span class="emphasis"><em>host1</em></span> and <span class="emphasis"><em>host 2</em></span>
fcdca175a52fe517f2317ba0e2b6e6d14522b869madhum are
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz both servers. The following is added to each server's <code class="filename">named.conf</code> file:
92a2439559cf1161742650ed9c50c6483bd029cemadhum </p>
92a2439559cf1161742650ed9c50c6483bd029cemadhum<pre class="programlisting">
36f2369ee230c310fed3b600e9e99cf5770804a3wrowekey host1-host2. {
92a2439559cf1161742650ed9c50c6483bd029cemadhum algorithm hmac-sha256;
ebecc16986604cce1369d5075eff65032e3dd0deianh secret "La/E5CjG9O+os1jq0a2jdA==";
0d60370bedd05f9632f54e85c417ce472d463674madhum};
ebecc16986604cce1369d5075eff65032e3dd0deianh</pre>
764315969cef40e50cdc6a5e9638454e10c1c06end<p>
764315969cef40e50cdc6a5e9638454e10c1c06end The secret is the one generated above. Since this is a secret, it
764315969cef40e50cdc6a5e9638454e10c1c06end is recommended that either <code class="filename">named.conf</code> be
764315969cef40e50cdc6a5e9638454e10c1c06end non-world readable, or the key directive be added to a non-world
b92cba59a0890be43b14aaf1ce30606140be9593nd readable file that is included by <code class="filename">named.conf</code>.
b92cba59a0890be43b14aaf1ce30606140be9593nd </p>
b92cba59a0890be43b14aaf1ce30606140be9593nd<p>
b92cba59a0890be43b14aaf1ce30606140be9593nd At this point, the key is recognized. This means that if the
402d23baca89e8c4fcb4e52ad8b2d66a6904baaetrawick server receives a message signed by this key, it can verify the
402d23baca89e8c4fcb4e52ad8b2d66a6904baaetrawick signature. If the signature is successfully verified, the
402d23baca89e8c4fcb4e52ad8b2d66a6904baaetrawick response is signed by the same key.
4caa28863a3418d26cc20a998dc368c3de3b7e19jerenkrantz </p>
4caa28863a3418d26cc20a998dc368c3de3b7e19jerenkrantz</div>
4caa28863a3418d26cc20a998dc368c3de3b7e19jerenkrantz<div class="sect2" lang="en">
a3f2646ef3d8a3a5234a5601de0f95f10308c2a6jerenkrantz<div class="titlepage"><div><div><h3 class="title">
a3f2646ef3d8a3a5234a5601de0f95f10308c2a6jerenkrantz<a name="id2564006"></a>Instructing the Server to Use the Key</h3></div></div></div>
a3f2646ef3d8a3a5234a5601de0f95f10308c2a6jerenkrantz<p>
9e398d701dd430f073ff5418fb720642e064046ajerenkrantz Since keys are shared between two hosts only, the server must
9e398d701dd430f073ff5418fb720642e064046ajerenkrantz be told when keys are to be used. The following is added to the <code class="filename">named.conf</code> file
9e398d701dd430f073ff5418fb720642e064046ajerenkrantz for <span class="emphasis"><em>host1</em></span>, if the IP address of <span class="emphasis"><em>host2</em></span> is
1a5b9e0071f0c662036250b482d566ad87ff0b4bjerenkrantz 10.1.2.3:
1a5b9e0071f0c662036250b482d566ad87ff0b4bjerenkrantz </p>
1a5b9e0071f0c662036250b482d566ad87ff0b4bjerenkrantz<pre class="programlisting">
a7ac9b52c3d9f7ce937f078a0d585023db626c55jerenkrantzserver 10.1.2.3 {
a7ac9b52c3d9f7ce937f078a0d585023db626c55jerenkrantz keys { host1-host2. ;};
a7ac9b52c3d9f7ce937f078a0d585023db626c55jerenkrantz};
db5837bbc9bef214303e755fa52122140366cb6fianh</pre>
db5837bbc9bef214303e755fa52122140366cb6fianh<p>
db5837bbc9bef214303e755fa52122140366cb6fianh Multiple keys may be present, but only the first is used.
aac2b82fe4f1ac117e2a0702438d6615542642dand This directive does not contain any secrets, so it may be in a
aac2b82fe4f1ac117e2a0702438d6615542642dand world-readable
aac2b82fe4f1ac117e2a0702438d6615542642dand file.
a793d402c74e50326a2401cfbdc562c5781948fdnd </p>
a793d402c74e50326a2401cfbdc562c5781948fdnd<p>
0a209fcb17b8c9a42a6149a1758e61cf6527d367nd If <span class="emphasis"><em>host1</em></span> sends a message that is a request
a793d402c74e50326a2401cfbdc562c5781948fdnd to that address, the message will be signed with the specified key. <span class="emphasis"><em>host1</em></span> will
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz expect any responses to signed messages to be signed with the same
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe key.
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz </p>
3ded62d7f2c9b12616d718b8c97d3044baa9ecdbjerenkrantz<p>
3ded62d7f2c9b12616d718b8c97d3044baa9ecdbjerenkrantz A similar statement must be present in <span class="emphasis"><em>host2</em></span>'s
3ded62d7f2c9b12616d718b8c97d3044baa9ecdbjerenkrantz configuration file (with <span class="emphasis"><em>host1</em></span>'s address) for <span class="emphasis"><em>host2</em></span> to
ab8c0315521735c73ce16c8072f91e17c406ca5bnd sign request messages to <span class="emphasis"><em>host1</em></span>.
ab8c0315521735c73ce16c8072f91e17c406ca5bnd </p>
ab8c0315521735c73ce16c8072f91e17c406ca5bnd</div>
b9e99e0d3154bbebe3e1b8d11d6c15bde79510a5nd<div class="sect2" lang="en">
b9e99e0d3154bbebe3e1b8d11d6c15bde79510a5nd<div class="titlepage"><div><div><h3 class="title">
b9e99e0d3154bbebe3e1b8d11d6c15bde79510a5nd<a name="id2564064"></a>TSIG Key Based Access Control</h3></div></div></div>
b9e99e0d3154bbebe3e1b8d11d6c15bde79510a5nd<p>
ea5f8cfbb7ef1d19318f6994c26dd73c38ffd8ddjerenkrantz <acronym class="acronym">BIND</acronym> allows IP addresses and ranges
ea5f8cfbb7ef1d19318f6994c26dd73c38ffd8ddjerenkrantz to be specified in ACL
ea5f8cfbb7ef1d19318f6994c26dd73c38ffd8ddjerenkrantz definitions and
4567cfc6a65328bd3e8dd2b758ca926b389c7058brianp <span><strong class="command">allow-{ query | transfer | update }</strong></span>
4567cfc6a65328bd3e8dd2b758ca926b389c7058brianp directives.
4567cfc6a65328bd3e8dd2b758ca926b389c7058brianp This has been extended to allow TSIG keys also. The above key would
4cdc5446050c19b9d519a273a129188586e8d445jerenkrantz be denoted <span><strong class="command">key host1-host2.</strong></span>
4cdc5446050c19b9d519a273a129188586e8d445jerenkrantz </p>
4cdc5446050c19b9d519a273a129188586e8d445jerenkrantz<p>
2f408250e9111c4b85b2b4b9b8836e83987efdefstoddard An example of an <span><strong class="command">allow-update</strong></span> directive would be:
2f408250e9111c4b85b2b4b9b8836e83987efdefstoddard </p>
2f408250e9111c4b85b2b4b9b8836e83987efdefstoddard<pre class="programlisting">
2f408250e9111c4b85b2b4b9b8836e83987efdefstoddardallow-update { key host1-host2. ;};
d5b7ba26785d7494166d48876362ba30ff30b98awrowe</pre>
47fe07199bddec6124ab7251c6be5c6c9ac00485jerenkrantz<p>
47fe07199bddec6124ab7251c6be5c6c9ac00485jerenkrantz This allows dynamic updates to succeed only if the request
6646a289c2d4778c8cd43d62b5a1cc966a356f85jerenkrantz was signed by a key named "<span><strong class="command">host1-host2.</strong></span>".
6646a289c2d4778c8cd43d62b5a1cc966a356f85jerenkrantz </p>
6646a289c2d4778c8cd43d62b5a1cc966a356f85jerenkrantz<p>
6646a289c2d4778c8cd43d62b5a1cc966a356f85jerenkrantz See <a href="Bv9ARM.ch06.html#dynamic_update_policies" title="Dynamic Update Policies">the section called &#8220;Dynamic Update Policies&#8221;</a> for a discussion of
aec70520ebe1e33e0d5e83c3626649d2a41dbe68wrowe the more flexible <span><strong class="command">update-policy</strong></span> statement.
aec70520ebe1e33e0d5e83c3626649d2a41dbe68wrowe </p>
aec70520ebe1e33e0d5e83c3626649d2a41dbe68wrowe</div>
ad451e2e428a069086d1c18c9e3372f8846ec617wrowe<div class="sect2" lang="en">
ad451e2e428a069086d1c18c9e3372f8846ec617wrowe<div class="titlepage"><div><div><h3 class="title">
ad451e2e428a069086d1c18c9e3372f8846ec617wrowe<a name="id2564113"></a>Errors</h3></div></div></div>
ad451e2e428a069086d1c18c9e3372f8846ec617wrowe<p>
65a7f60c610357218a5ec198437d0465c6fad214wrowe The processing of TSIG signed messages can result in
65a7f60c610357218a5ec198437d0465c6fad214wrowe several errors. If a signed message is sent to a non-TSIG aware
67ee515870e5e436e6246ae88d879d4750ebd9abstriker server, a FORMERR (format error) will be returned, since the server will not
67ee515870e5e436e6246ae88d879d4750ebd9abstriker understand the record. This is a result of misconfiguration,
67ee515870e5e436e6246ae88d879d4750ebd9abstriker since the server must be explicitly configured to send a TSIG
7f06b23e079d319a24c7d57d22552aee36ff08ebbnicholes signed message to a specific server.
7f06b23e079d319a24c7d57d22552aee36ff08ebbnicholes </p>
7f06b23e079d319a24c7d57d22552aee36ff08ebbnicholes<p>
7f06b23e079d319a24c7d57d22552aee36ff08ebbnicholes If a TSIG aware server receives a message signed by an
0b08d15db7dbe16a7f48994cda1d57307c0bcf83trawick unknown key, the response will be unsigned with the TSIG
0b08d15db7dbe16a7f48994cda1d57307c0bcf83trawick extended error code set to BADKEY. If a TSIG aware server
0b08d15db7dbe16a7f48994cda1d57307c0bcf83trawick receives a message with a signature that does not validate, the
0b08d15db7dbe16a7f48994cda1d57307c0bcf83trawick response will be unsigned with the TSIG extended error code set
0b08d15db7dbe16a7f48994cda1d57307c0bcf83trawick to BADSIG. If a TSIG aware server receives a message with a time
0b08d15db7dbe16a7f48994cda1d57307c0bcf83trawick outside of the allowed range, the response will be signed with
e58e3d50c3c55d09697d20ad8d5c674b137a136etrawick the TSIG extended error code set to BADTIME, and the time values
e58e3d50c3c55d09697d20ad8d5c674b137a136etrawick will be adjusted so that the response can be successfully
e58e3d50c3c55d09697d20ad8d5c674b137a136etrawick verified. In any of these cases, the message's rcode (response code) is set to
e58e3d50c3c55d09697d20ad8d5c674b137a136etrawick NOTAUTH (not authenticated).
67ee515870e5e436e6246ae88d879d4750ebd9abstriker </p>
67ee515870e5e436e6246ae88d879d4750ebd9abstriker</div>
67ee515870e5e436e6246ae88d879d4750ebd9abstriker</div>
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton<div class="sect1" lang="en">
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton<div class="titlepage"><div><div><h2 class="title" style="clear: both">
053e8270ecd2d2cb608625e78f06685e5375615fpquerna<a name="id2564126"></a>TKEY</h2></div></div></div>
053e8270ecd2d2cb608625e78f06685e5375615fpquerna<p><span><strong class="command">TKEY</strong></span>
053e8270ecd2d2cb608625e78f06685e5375615fpquerna is a mechanism for automatically generating a shared secret
053e8270ecd2d2cb608625e78f06685e5375615fpquerna between two hosts. There are several "modes" of
65a7f60c610357218a5ec198437d0465c6fad214wrowe <span><strong class="command">TKEY</strong></span> that specify how the key is generated
65a7f60c610357218a5ec198437d0465c6fad214wrowe or assigned. <acronym class="acronym">BIND</acronym> 9 implements only one of
65a7f60c610357218a5ec198437d0465c6fad214wrowe these modes, the Diffie-Hellman key exchange. Both hosts are
65a7f60c610357218a5ec198437d0465c6fad214wrowe required to have a Diffie-Hellman KEY record (although this
a57463e9530d71befcc34dc69b999fa88c38b14fstoddard record is not required to be present in a zone). The
a57463e9530d71befcc34dc69b999fa88c38b14fstoddard <span><strong class="command">TKEY</strong></span> process must use signed messages,
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton signed either by TSIG or SIG(0). The result of
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton <span><strong class="command">TKEY</strong></span> is a shared secret that can be used to
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton sign messages with TSIG. <span><strong class="command">TKEY</strong></span> can also be
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton used to delete shared secrets that it had previously
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton generated.
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton </p>
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton<p>
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton The <span><strong class="command">TKEY</strong></span> process is initiated by a
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton client
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton or server by sending a signed <span><strong class="command">TKEY</strong></span>
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton query
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton (including any appropriate KEYs) to a TKEY-aware server. The
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton server response, if it indicates success, will contain a
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton <span><strong class="command">TKEY</strong></span> record and any appropriate keys.
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton After
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton this exchange, both participants have enough information to
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton determine the shared secret; the exact process depends on the
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton <span><strong class="command">TKEY</strong></span> mode. When using the
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton Diffie-Hellman
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton <span><strong class="command">TKEY</strong></span> mode, Diffie-Hellman keys are
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton exchanged,
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton and the shared secret is derived by both participants.
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton </p>
306b67433d26194a779e0755a3e670398bdfd9d3jerenkrantz</div>
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton<div class="sect1" lang="en">
306b67433d26194a779e0755a3e670398bdfd9d3jerenkrantz<div class="titlepage"><div><div><h2 class="title" style="clear: both">
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz<a name="id2572368"></a>SIG(0)</h2></div></div></div>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz<p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz <acronym class="acronym">BIND</acronym> 9 partially supports DNSSEC SIG(0)
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz transaction signatures as specified in RFC 2535 and RFC 2931.
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz SIG(0)
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz uses public/private keys to authenticate messages. Access control
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz is performed in the same manner as TSIG keys; privileges can be
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz granted or denied based on the key name.
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz </p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz<p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz When a SIG(0) signed message is received, it will only be
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz verified if the key is known and trusted by the server; the server
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz will not attempt to locate and/or validate the key.
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz </p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz<p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz SIG(0) signing of multiple-message TCP streams is not
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz supported.
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz </p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz<p>
fb1491ee67d7ae38b12f68c8da2743dfacd5e2b5jerenkrantz The only tool shipped with <acronym class="acronym">BIND</acronym> 9 that
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton generates SIG(0) signed messages is <span><strong class="command">nsupdate</strong></span>.
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton </p>
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton</div>
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton<div class="sect1" lang="en">
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton<div class="titlepage"><div><div><h2 class="title" style="clear: both">
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton<a name="DNSSEC"></a>DNSSEC</h2></div></div></div>
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton<p>
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton Cryptographic authentication of DNS information is possible
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton through the DNS Security (<span class="emphasis"><em>DNSSEC-bis</em></span>) extensions,
13cb3ceccbefd170673ec7059a1f84c3aac9301djorton defined in RFC 4033, RFC 4034, and RFC 4035.
1ed67ffc7376e930b17cefcaf3b8fbe8c9d02fe3erikabele This section describes the creation and use of DNSSEC signed zones.
1ed67ffc7376e930b17cefcaf3b8fbe8c9d02fe3erikabele </p>
1ed67ffc7376e930b17cefcaf3b8fbe8c9d02fe3erikabele<p>
1ed67ffc7376e930b17cefcaf3b8fbe8c9d02fe3erikabele In order to set up a DNSSEC secure zone, there are a series
1ed67ffc7376e930b17cefcaf3b8fbe8c9d02fe3erikabele of steps which must be followed. <acronym class="acronym">BIND</acronym>
db913c8820608d6d525290ad407678e476aed0b4bnicholes 9 ships
db913c8820608d6d525290ad407678e476aed0b4bnicholes with several tools
db913c8820608d6d525290ad407678e476aed0b4bnicholes that are used in this process, which are explained in more detail
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton below. In all cases, the <code class="option">-h</code> option prints a
db913c8820608d6d525290ad407678e476aed0b4bnicholes full list of parameters. Note that the DNSSEC tools require the
db913c8820608d6d525290ad407678e476aed0b4bnicholes keyset files to be in the working directory or the
db913c8820608d6d525290ad407678e476aed0b4bnicholes directory specified by the <code class="option">-d</code> option, and
db913c8820608d6d525290ad407678e476aed0b4bnicholes that the tools shipped with BIND 9.2.x and earlier are not compatible
db913c8820608d6d525290ad407678e476aed0b4bnicholes with the current ones.
db913c8820608d6d525290ad407678e476aed0b4bnicholes </p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton There must also be communication with the administrators of
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton the parent and/or child zone to transmit keys. A zone's security
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton status must be indicated by the parent zone for a DNSSEC capable
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton resolver to trust its data. This is done through the presence
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton or absence of a <code class="literal">DS</code> record at the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton delegation
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton point.
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton </p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton For other servers to trust data in this zone, they must
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton either be statically configured with this zone's zone key or the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton zone key of another zone above this one in the DNS tree.
6ce789f46b020038831a8bc8def2bbd039471eccminfrin </p>
6ce789f46b020038831a8bc8def2bbd039471eccminfrin<div class="sect2" lang="en">
6ce789f46b020038831a8bc8def2bbd039471eccminfrin<div class="titlepage"><div><div><h3 class="title">
1aeb17f23e558c7fc587ef2f232025071d28ce2bminfrin<a name="id2572504"></a>Generating Keys</h3></div></div></div>
1aeb17f23e558c7fc587ef2f232025071d28ce2bminfrin<p>
1aeb17f23e558c7fc587ef2f232025071d28ce2bminfrin The <span><strong class="command">dnssec-keygen</strong></span> program is used to
233a7697bd6064885197c568fe5a6aa4bafa1558minfrin generate keys.
233a7697bd6064885197c568fe5a6aa4bafa1558minfrin </p>
233a7697bd6064885197c568fe5a6aa4bafa1558minfrin<p>
233a7697bd6064885197c568fe5a6aa4bafa1558minfrin A secure zone must contain one or more zone keys. The
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin zone keys will sign all other records in the zone, as well as
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin the zone keys of any secure delegated zones. Zone keys must
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin have the same name as the zone, a name type of
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin <span><strong class="command">ZONE</strong></span>, and must be usable for
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin authentication.
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin It is recommended that zone keys use a cryptographic algorithm
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin designated as "mandatory to implement" by the IETF; currently
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin the only one is RSASHA1.
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin </p>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin<p>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin The following command will generate a 768-bit RSASHA1 key for
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin the <code class="filename">child.example</code> zone:
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin </p>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin<p>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin <strong class="userinput"><code>dnssec-keygen -a RSASHA1 -b 768 -n ZONE child.example.</code></strong>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin </p>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin<p>
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton Two output files will be produced:
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin <code class="filename">Kchild.example.+005+12345.key</code> and
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin <code class="filename">Kchild.example.+005+12345.private</code>
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin (where
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin 12345 is an example of a key tag). The key filenames contain
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin the key name (<code class="filename">child.example.</code>),
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin algorithm (3
2afded63386f82778457d31bf2d5fbea4f3e2ab0minfrin is DSA, 1 is RSAMD5, 5 is RSASHA1, etc.), and the key tag (12345 in
95502b537c0cd0cef69b85cea6b5ce3785949d65bnicholes this case).
e5c5bf5c81ee55b9a98bb0a9e26473dcc5775c0bjorton The private key (in the <code class="filename">.private</code>
95502b537c0cd0cef69b85cea6b5ce3785949d65bnicholes file) is
a57463e9530d71befcc34dc69b999fa88c38b14fstoddard used to generate signatures, and the public key (in the
a57463e9530d71befcc34dc69b999fa88c38b14fstoddard <code class="filename">.key</code> file) is used for signature
a57463e9530d71befcc34dc69b999fa88c38b14fstoddard verification.
a57463e9530d71befcc34dc69b999fa88c38b14fstoddard </p>
90692b194d8545ef6d0659e2a5e555b07a826203stoddard<p>
90692b194d8545ef6d0659e2a5e555b07a826203stoddard To generate another key with the same properties (but with
90692b194d8545ef6d0659e2a5e555b07a826203stoddard a different key tag), repeat the above command.
1f729c89340144196af6120eb6be0d9704effd86stoddard </p>
1f729c89340144196af6120eb6be0d9704effd86stoddard<p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton The <span><strong class="command">dnssec-keyfromlabel</strong></span> program is used
3a47088a3cd486d3639763ef940e298bb75726b1jorton to get a key pair from a crypto hardware and build the key
3a47088a3cd486d3639763ef940e298bb75726b1jorton files. Its usage is similar to <span><strong class="command">dnssec-keygen</strong></span>.
3a47088a3cd486d3639763ef940e298bb75726b1jorton </p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton<p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton The public keys should be inserted into the zone file by
3a47088a3cd486d3639763ef940e298bb75726b1jorton including the <code class="filename">.key</code> files using
68f29716d504ffafacc47f211563afa8bfddc75fminfrin <span><strong class="command">$INCLUDE</strong></span> statements.
fda9724d890bc5d8d39e42b6baa6847623a319f8geoff </p>
fda9724d890bc5d8d39e42b6baa6847623a319f8geoff</div>
fda9724d890bc5d8d39e42b6baa6847623a319f8geoff<div class="sect2" lang="en">
fda9724d890bc5d8d39e42b6baa6847623a319f8geoff<div class="titlepage"><div><div><h3 class="title">
fda9724d890bc5d8d39e42b6baa6847623a319f8geoff<a name="id2572651"></a>Signing the Zone</h3></div></div></div>
a13cde9773cabe1c57cf5871afdfcca265b4fb2ftrawick<p>
a13cde9773cabe1c57cf5871afdfcca265b4fb2ftrawick The <span><strong class="command">dnssec-signzone</strong></span> program is used
a13cde9773cabe1c57cf5871afdfcca265b4fb2ftrawick to sign a zone.
a13cde9773cabe1c57cf5871afdfcca265b4fb2ftrawick </p>
1f729c89340144196af6120eb6be0d9704effd86stoddard<p>
1f729c89340144196af6120eb6be0d9704effd86stoddard Any <code class="filename">keyset</code> files corresponding to
1f729c89340144196af6120eb6be0d9704effd86stoddard secure subzones should be present. The zone signer will
1f729c89340144196af6120eb6be0d9704effd86stoddard generate <code class="literal">NSEC</code>, <code class="literal">NSEC3</code>
50b887f89293bb12f156cb5b768ff3834c6c0ecdtrawick and <code class="literal">RRSIG</code> records for the zone, as
50b887f89293bb12f156cb5b768ff3834c6c0ecdtrawick well as <code class="literal">DS</code> for the child zones if
50b887f89293bb12f156cb5b768ff3834c6c0ecdtrawick <code class="literal">'-g'</code> is specified. If <code class="literal">'-g'</code>
dbbd7d4a411d7f781052101461c520468a39dd64trawick is not specified, then DS RRsets for the secure child
dbbd7d4a411d7f781052101461c520468a39dd64trawick zones need to be added manually.
dbbd7d4a411d7f781052101461c520468a39dd64trawick </p>
dbbd7d4a411d7f781052101461c520468a39dd64trawick<p>
22fc5d45d68b6bb99dfe77ffbd4248ce4a1f71b1stoddard The following command signs the zone, assuming it is in a
22fc5d45d68b6bb99dfe77ffbd4248ce4a1f71b1stoddard file called <code class="filename">zone.child.example</code>. By
3a47088a3cd486d3639763ef940e298bb75726b1jorton default, all zone keys which have an available private key are
3a47088a3cd486d3639763ef940e298bb75726b1jorton used to generate signatures.
3a47088a3cd486d3639763ef940e298bb75726b1jorton </p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton<p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton <strong class="userinput"><code>dnssec-signzone -o child.example zone.child.example</code></strong>
3a47088a3cd486d3639763ef940e298bb75726b1jorton </p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton<p>
3a47088a3cd486d3639763ef940e298bb75726b1jorton One output file is produced:
3a47088a3cd486d3639763ef940e298bb75726b1jorton <code class="filename">zone.child.example.signed</code>. This
3a47088a3cd486d3639763ef940e298bb75726b1jorton file
3a47088a3cd486d3639763ef940e298bb75726b1jorton should be referenced by <code class="filename">named.conf</code>
3a47088a3cd486d3639763ef940e298bb75726b1jorton as the
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd input file for the zone.
25e0bab0a1533a32dfc32d64664d8fe927656640jwoolley </p>
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd<p><span><strong class="command">dnssec-signzone</strong></span>
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd will also produce a keyset and dsset files and optionally a
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd dlvset file. These are used to provide the parent zone
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd administrators with the <code class="literal">DNSKEYs</code> (or their
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd corresponding <code class="literal">DS</code> records) that are the
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd secure entry point to the zone.
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd </p>
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd</div>
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd<div class="sect2" lang="en">
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd<div class="titlepage"><div><div><h3 class="title">
0596b673a5841c431b8f4c5de1f351cc3ae90fb9nd<a name="id2572801"></a>Configuring Servers</h3></div></div></div>
2b436143f38de8b0239c1371594fe129030a08cbstoddard<p>
2b436143f38de8b0239c1371594fe129030a08cbstoddard To enable <span><strong class="command">named</strong></span> to respond appropriately
2b436143f38de8b0239c1371594fe129030a08cbstoddard to DNS requests from DNSSEC aware clients,
2b436143f38de8b0239c1371594fe129030a08cbstoddard <span><strong class="command">dnssec-enable</strong></span> must be set to yes.
2b436143f38de8b0239c1371594fe129030a08cbstoddard (This is the default setting.)
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton </p>
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton<p>
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton To enable <span><strong class="command">named</strong></span> to validate answers from
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton other servers, the <span><strong class="command">dnssec-enable</strong></span> option
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton must be set to <strong class="userinput"><code>yes</code></strong>, and the
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton <span><strong class="command">dnssec-validation</strong></span> options must be set to
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton <strong class="userinput"><code>yes</code></strong> or <strong class="userinput"><code>auto</code></strong>.
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton </p>
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton<p>
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton If <span><strong class="command">dnssec-validation</strong></span> is set to
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton <strong class="userinput"><code>auto</code></strong>, then a default
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton trust anchor for the DNS root zone will be used.
a4f89d40fa1b708cdffaf99f3f1e15beaf243367jorton If it is set to <strong class="userinput"><code>yes</code></strong>, however,
807d7e34c8631e4dcc9aab53d2e5867c325c4effnd then at least one trust anchor must be configured
807d7e34c8631e4dcc9aab53d2e5867c325c4effnd with a <span><strong class="command">trusted-keys</strong></span> or
807d7e34c8631e4dcc9aab53d2e5867c325c4effnd <span><strong class="command">managed-keys</strong></span> statement in
807d7e34c8631e4dcc9aab53d2e5867c325c4effnd <code class="filename">named.conf</code>, or DNSSEC validation
807d7e34c8631e4dcc9aab53d2e5867c325c4effnd will not occur. The default setting is
807d7e34c8631e4dcc9aab53d2e5867c325c4effnd <strong class="userinput"><code>yes</code></strong>.
c949f779c0c5714ec0a1307ae6b8a2ff8ee5fcaastoddard </p>
c949f779c0c5714ec0a1307ae6b8a2ff8ee5fcaastoddard<p>
c949f779c0c5714ec0a1307ae6b8a2ff8ee5fcaastoddard <span><strong class="command">trusted-keys</strong></span> are copies of DNSKEY RRs
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz for zones that are used to form the first link in the
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz cryptographic chain of trust. All keys listed in
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz <span><strong class="command">trusted-keys</strong></span> (and corresponding zones)
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz are deemed to exist and only the listed keys will be used
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz to validated the DNSKEY RRset that they are from.
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz </p>
8df1d6d36f53225e62a767e255db91df7182a242jerenkrantz<p>
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton <span><strong class="command">managed-keys</strong></span> are trusted keys which are
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton automatically kept up to date via RFC 5011 trust anchor
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton maintenance.
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton </p>
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton<p>
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton <span><strong class="command">trusted-keys</strong></span> and
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton <span><strong class="command">managed-keys</strong></span> are described in more detail
60a66740fd7cf3974d7eb7791513d1d4a697f245stoddard later in this document.
60a66740fd7cf3974d7eb7791513d1d4a697f245stoddard </p>
60a66740fd7cf3974d7eb7791513d1d4a697f245stoddard<p>
d09682d04d135cab4463dbbd628c5185103960c7stoddard Unlike <acronym class="acronym">BIND</acronym> 8, <acronym class="acronym">BIND</acronym>
d09682d04d135cab4463dbbd628c5185103960c7stoddard 9 does not verify signatures on load, so zone keys for
98c70f5863f1e63b16a457beb9736712b7c995fcjorton authoritative zones do not need to be specified in the
98c70f5863f1e63b16a457beb9736712b7c995fcjorton configuration file.
98c70f5863f1e63b16a457beb9736712b7c995fcjorton </p>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton<p>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton After DNSSEC gets established, a typical DNSSEC configuration
98c70f5863f1e63b16a457beb9736712b7c995fcjorton will look something like the following. It has one or
98c70f5863f1e63b16a457beb9736712b7c995fcjorton more public keys for the root. This allows answers from
98c70f5863f1e63b16a457beb9736712b7c995fcjorton outside the organization to be validated. It will also
98c70f5863f1e63b16a457beb9736712b7c995fcjorton have several keys for parts of the namespace the organization
98c70f5863f1e63b16a457beb9736712b7c995fcjorton controls. These are here to ensure that <span><strong class="command">named</strong></span>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton is immune to compromises in the DNSSEC components of the security
98c70f5863f1e63b16a457beb9736712b7c995fcjorton of parent zones.
98c70f5863f1e63b16a457beb9736712b7c995fcjorton </p>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton<pre class="programlisting">
98c70f5863f1e63b16a457beb9736712b7c995fcjortonmanaged-keys {
98c70f5863f1e63b16a457beb9736712b7c995fcjorton /* Root Key */
98c70f5863f1e63b16a457beb9736712b7c995fcjorton "." initial-key 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwS
98c70f5863f1e63b16a457beb9736712b7c995fcjorton JxrGkxJWoZu6I7PzJu/E9gx4UC1zGAHlXKdE4zYIpRh
98c70f5863f1e63b16a457beb9736712b7c995fcjorton aBKnvcC2U9mZhkdUpd1Vso/HAdjNe8LmMlnzY3zy2Xy
98c70f5863f1e63b16a457beb9736712b7c995fcjorton 4klWOADTPzSv9eamj8V18PHGjBLaVtYvk/ln5ZApjYg
98c70f5863f1e63b16a457beb9736712b7c995fcjorton hf+6fElrmLkdaz MQ2OCnACR817DF4BBa7UR/beDHyp
98c70f5863f1e63b16a457beb9736712b7c995fcjorton 5iWTXWSi6XmoJLbG9Scqc7l70KDqlvXR3M/lUUVRbke
a423b2901680984502cca9694d32535d7061ee33nd g1IPJSidmK3ZyCllh4XSKbje/45SKucHgnwU5jefMtq
a423b2901680984502cca9694d32535d7061ee33nd 66gKodQj+MiA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ
a423b2901680984502cca9694d32535d7061ee33nd 97S+LKUTpQcq27R7AT3/V5hRQxScINqwcz4jYqZD2fQ
a423b2901680984502cca9694d32535d7061ee33nd dgxbcDTClU0CRBdiieyLMNzXG3";
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd};
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd
abb92a2029fbfe7e69e5185ce104b7939310a4cbndtrusted-keys {
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd /* Key for our organization's forward zone */
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM6
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd 5KbhTjrW1ZaARmPhEZZe3Y9ifgEuq7vZ/z
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd GZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd 4JKUbbOTcM8pwXlj0EiX3oDFVmjHO444gL
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd kBOUKUf/mC7HvfwYH/Be22GnClrinKJp1O
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd g4ywzO9WglMk7jbfW33gUKvirTHr25GL7S
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd TQUzBb5Usxt8lgnyTUHs1t3JwCY5hKZ6Cq
abb92a2029fbfe7e69e5185ce104b7939310a4cbnd FxmAVZP20igTixin/1LcrgX/KMEGd/biuv
6bdb9c5d3d177a897b58777f28a0b94c798a5b2end F4qJCyduieHukuY3H4XMAcR+xia2nIUPvm
6bdb9c5d3d177a897b58777f28a0b94c798a5b2end /oyWR8BW/hWdzOvnSCThlHf3xiYleDbt/o
6bdb9c5d3d177a897b58777f28a0b94c798a5b2end 1OTQ09A0=";
624dd0eb3cff4353cf6a7ec70592adae319787bdnd
624dd0eb3cff4353cf6a7ec70592adae319787bdnd /* Key for our reverse zone. */
624dd0eb3cff4353cf6a7ec70592adae319787bdnd 2.0.192.IN-ADDRPA.NET. 257 3 5 "AQOnS4xn/IgOUpBPJ3bogzwc
624dd0eb3cff4353cf6a7ec70592adae319787bdnd xOdNax071L18QqZnQQQAVVr+i
624dd0eb3cff4353cf6a7ec70592adae319787bdnd LhGTnNGp3HoWQLUIzKrJVZ3zg
624dd0eb3cff4353cf6a7ec70592adae319787bdnd gy3WwNT6kZo6c0tszYqbtvchm
624dd0eb3cff4353cf6a7ec70592adae319787bdnd gQC8CzKojM/W16i6MG/eafGU3
624dd0eb3cff4353cf6a7ec70592adae319787bdnd siaOdS0yOI6BgPsw+YZdzlYMa
624dd0eb3cff4353cf6a7ec70592adae319787bdnd IJGf4M4dyoKIhzdZyQ2bYQrjy
624dd0eb3cff4353cf6a7ec70592adae319787bdnd Q4LB0lC7aOnsMyYKHHYeRvPxj
624dd0eb3cff4353cf6a7ec70592adae319787bdnd IQXmdqgOJGq+vsevG06zW+1xg
624dd0eb3cff4353cf6a7ec70592adae319787bdnd YJh9rCIfnm1GX/KMgxLPG2vXT
624dd0eb3cff4353cf6a7ec70592adae319787bdnd D/RnLX+D3T3UL7HJYHJhAZD5L
624dd0eb3cff4353cf6a7ec70592adae319787bdnd 59VvjSPsZJHeDCUyWYrvPZesZ
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes DIRvhDD52SKvbheeTJUm6Ehkz
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes ytNN2SN96QRk8j/iI8ib";
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes};
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholesoptions {
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes ...
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes dnssec-enable yes;
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes dnssec-validation yes;
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes};
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes</pre>
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
a0cf51c951403c8dbc7b8caf88a77074dd8731bbbnicholes<h3 class="title">Note</h3>
fdfa27042409771401b31da24a4aed9c7ee02ba7bnicholes None of the keys listed in this example are valid. In particular,
fdfa27042409771401b31da24a4aed9c7ee02ba7bnicholes the root key is not valid.
fdfa27042409771401b31da24a4aed9c7ee02ba7bnicholes </div>
15bf15191092c9bffdfb3a8c25f543c21381847fgeoff<p>
15bf15191092c9bffdfb3a8c25f543c21381847fgeoff When DNSSEC validation is enabled and properly configured,
162e147f0561548589a5e3595401438301c0d5bfnd the resolver will reject any answers from signed, secure zones
15bf15191092c9bffdfb3a8c25f543c21381847fgeoff which fail to validate, and will return SERVFAIL to the client.
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna </p>
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna<p>
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna Responses may fail to validate for any of several reasons,
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna including missing, expired, or invalid signatures, a key which
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna does not match the DS RRset in the parent zone, or an insecure
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna response from a zone which, according to its parent, should have
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna been secure.
38ec256e83361accbe95c1089d4cb2d92052acb3pquerna </p>
41f1dec46fe56a30962601d0e8ce689ac6c86147geoff<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
41f1dec46fe56a30962601d0e8ce689ac6c86147geoff<h3 class="title">Note</h3>
41f1dec46fe56a30962601d0e8ce689ac6c86147geoff<p>
41f1dec46fe56a30962601d0e8ce689ac6c86147geoff When the validator receives a response from an unsigned zone
508fc9d45fb7ab0ef69294f6a8fd25cb96dbde72trawick that has a signed parent, it must confirm with the parent
508fc9d45fb7ab0ef69294f6a8fd25cb96dbde72trawick that the zone was intentionally left unsigned. It does
508fc9d45fb7ab0ef69294f6a8fd25cb96dbde72trawick this by verifying, via signed and validated NSEC/NSEC3 records,
508fc9d45fb7ab0ef69294f6a8fd25cb96dbde72trawick that the parent zone contains no DS records for the child.
508fc9d45fb7ab0ef69294f6a8fd25cb96dbde72trawick </p>
8c2f8720f8fe23c6085509198773a5a1dda268fbminfrin<p>
8c2f8720f8fe23c6085509198773a5a1dda268fbminfrin If the validator <span class="emphasis"><em>can</em></span> prove that the zone
8c2f8720f8fe23c6085509198773a5a1dda268fbminfrin is insecure, then the response is accepted. However, if it
f1c413e3b75fa1b6aadbb7022ff82042ca10b2a8minfrin cannot, then it must assume an insecure response to be a
f1c413e3b75fa1b6aadbb7022ff82042ca10b2a8minfrin forgery; it rejects the response and logs an error.
f1c413e3b75fa1b6aadbb7022ff82042ca10b2a8minfrin </p>
f1c413e3b75fa1b6aadbb7022ff82042ca10b2a8minfrin<p>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard The logged error reads "insecurity proof failed" and
ee64282e65aac20cde407210163ecbf7e104cc56stoddard "got insecure response; parent indicates it should be secure".
d00ce17e51cb219a98ed5ae4687be42d264e818dtrawick (Prior to BIND 9.7, the logged error was "not insecure".
d00ce17e51cb219a98ed5ae4687be42d264e818dtrawick This referred to the zone, not the response.)
d00ce17e51cb219a98ed5ae4687be42d264e818dtrawick </p>
d00ce17e51cb219a98ed5ae4687be42d264e818dtrawick</div>
d00ce17e51cb219a98ed5ae4687be42d264e818dtrawick</div>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton</div>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton<div class="sect1" lang="en">
98c70f5863f1e63b16a457beb9736712b7c995fcjorton<div class="titlepage"><div><div><h2 class="title" style="clear: both">
98c70f5863f1e63b16a457beb9736712b7c995fcjorton<a name="dnssec.dynamic.zones"></a>DNSSEC, Dynamic Zones, and Automatic Signing</h2></div></div></div>
98c70f5863f1e63b16a457beb9736712b7c995fcjorton<p>As of BIND 9.7.0 it is possible to change a dynamic zone
92c2e82603d4f08cd8b87e68be5e3888ef32f917nd from insecure to signed and back again. A secure zone can use
92c2e82603d4f08cd8b87e68be5e3888ef32f917nd either NSEC or NSEC3 chains.</p>
92c2e82603d4f08cd8b87e68be5e3888ef32f917nd<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
463ec285d00a089e8861dda975cc3fc77fbdbd67nd<a name="id2610941"></a>Converting from insecure to secure</h3></div></div></div></div>
463ec285d00a089e8861dda975cc3fc77fbdbd67nd<p>Changing a zone from insecure to secure can be done in two
463ec285d00a089e8861dda975cc3fc77fbdbd67nd ways: using a dynamic DNS update, or the
463ec285d00a089e8861dda975cc3fc77fbdbd67nd <span><strong class="command">auto-dnssec</strong></span> zone option.</p>
463ec285d00a089e8861dda975cc3fc77fbdbd67nd<p>For either method, you need to configure
463ec285d00a089e8861dda975cc3fc77fbdbd67nd <span><strong class="command">named</strong></span> so that it can see the
463ec285d00a089e8861dda975cc3fc77fbdbd67nd <code class="filename">K*</code> files which contain the public and private
463ec285d00a089e8861dda975cc3fc77fbdbd67nd parts of the keys that will be used to sign the zone. These files
c5cb4c9e7c8696907ddebab2a0037717c710b0f6jorton will have been generated by
463ec285d00a089e8861dda975cc3fc77fbdbd67nd <span><strong class="command">dnssec-keygen</strong></span>. You can do this by placing them
c022ee876f3666435b58534680719193b9aece70trawick in the key-directory, as specified in
c022ee876f3666435b58534680719193b9aece70trawick <code class="filename">named.conf</code>:</p>
c022ee876f3666435b58534680719193b9aece70trawick<pre class="programlisting">
c022ee876f3666435b58534680719193b9aece70trawick zone example.net {
1940eeecc1f7d1ce69b3e43b49378f5e2b307e8ebnicholes type master;
1940eeecc1f7d1ce69b3e43b49378f5e2b307e8ebnicholes update-policy local;
1940eeecc1f7d1ce69b3e43b49378f5e2b307e8ebnicholes file "dynamic/example.net/example.net";
40cbbfafeb47550fb1b208b31c41813392720f69jorton key-directory "dynamic/example.net";
40cbbfafeb47550fb1b208b31c41813392720f69jorton };
40cbbfafeb47550fb1b208b31c41813392720f69jorton</pre>
40cbbfafeb47550fb1b208b31c41813392720f69jorton<p>If one KSK and one ZSK DNSKEY key have been generated, this
40cbbfafeb47550fb1b208b31c41813392720f69jorton configuration will cause all records in the zone to be signed
40cbbfafeb47550fb1b208b31c41813392720f69jorton with the ZSK, and the DNSKEY RRset to be signed with the KSK as
40cbbfafeb47550fb1b208b31c41813392720f69jorton well. An NSEC chain will be generated as part of the initial
40cbbfafeb47550fb1b208b31c41813392720f69jorton signing process.</p>
40cbbfafeb47550fb1b208b31c41813392720f69jorton<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
40cbbfafeb47550fb1b208b31c41813392720f69jorton<a name="id2610979"></a>Dynamic DNS update method</h3></div></div></div></div>
40cbbfafeb47550fb1b208b31c41813392720f69jorton<p>To insert the keys via dynamic update:</p>
40cbbfafeb47550fb1b208b31c41813392720f69jorton<pre class="screen">
40cbbfafeb47550fb1b208b31c41813392720f69jorton % nsupdate
40cbbfafeb47550fb1b208b31c41813392720f69jorton &gt; ttl 3600
40cbbfafeb47550fb1b208b31c41813392720f69jorton &gt; update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
fc14030410c01063b4e6f3c1cee4142962a0338fnd &gt; update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
fc14030410c01063b4e6f3c1cee4142962a0338fnd &gt; send
fc14030410c01063b4e6f3c1cee4142962a0338fnd</pre>
8f697acb97f27aaa43c67d649cd69618123f4ebdnd<p>While the update request will complete almost immediately,
8f697acb97f27aaa43c67d649cd69618123f4ebdnd the zone will not be completely signed until
8f697acb97f27aaa43c67d649cd69618123f4ebdnd <span><strong class="command">named</strong></span> has had time to walk the zone and
aa37a703efc2aae38e9dcf68375018e01d2af950nd generate the NSEC and RRSIG records. The NSEC record at the apex
aa37a703efc2aae38e9dcf68375018e01d2af950nd will be added last, to signal that there is a complete NSEC
aa37a703efc2aae38e9dcf68375018e01d2af950nd chain.</p>
aa37a703efc2aae38e9dcf68375018e01d2af950nd<p>If you wish to sign using NSEC3 instead of NSEC, you should
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton add an NSEC3PARAM record to the initial update request. If you
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton wish the NSEC3 chain to have the OPTOUT bit set, set it in the
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton flags field of the NSEC3PARAM record.</p>
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton<pre class="screen">
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton % nsupdate
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton &gt; ttl 3600
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd &gt; update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd &gt; update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd &gt; update add example.net NSEC3PARAM 1 1 100 1234567890
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd &gt; send
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd</pre>
9026fcf39ea5fbacee72b6c4f68e6c778dbad478nd<p>Again, this update request will complete almost
0043caa79a47e74a29c19b87bc85b2545e7209e6nd immediately; however, the record won't show up until
0043caa79a47e74a29c19b87bc85b2545e7209e6nd <span><strong class="command">named</strong></span> has had a chance to build/remove the
0043caa79a47e74a29c19b87bc85b2545e7209e6nd relevant chain. A private type record will be created to record
5d3ba6c91839d8b8bb98b2ff43c0d686c335b783nd the state of the operation (see below for more details), and will
0043caa79a47e74a29c19b87bc85b2545e7209e6nd be removed once the operation completes.</p>
0043caa79a47e74a29c19b87bc85b2545e7209e6nd<p>While the initial signing and NSEC/NSEC3 chain generation
0043caa79a47e74a29c19b87bc85b2545e7209e6nd is happening, other updates are possible as well.</p>
0043caa79a47e74a29c19b87bc85b2545e7209e6nd<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
0043caa79a47e74a29c19b87bc85b2545e7209e6nd<a name="id2563501"></a>Fully automatic zone signing</h3></div></div></div></div>
0043caa79a47e74a29c19b87bc85b2545e7209e6nd<p>To enable automatic signing, add the
0043caa79a47e74a29c19b87bc85b2545e7209e6nd <span><strong class="command">auto-dnssec</strong></span> option to the zone statement in
0043caa79a47e74a29c19b87bc85b2545e7209e6nd <code class="filename">named.conf</code>.
0043caa79a47e74a29c19b87bc85b2545e7209e6nd <span><strong class="command">auto-dnssec</strong></span> has two possible arguments:
73e8c23f3efca94370c24e6a5908ee6e522bf4dbminfrin <code class="constant">allow</code> or
73e8c23f3efca94370c24e6a5908ee6e522bf4dbminfrin <code class="constant">maintain</code>.</p>
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton<p>With
73e8c23f3efca94370c24e6a5908ee6e522bf4dbminfrin <span><strong class="command">auto-dnssec allow</strong></span>,
94e96b9af3e76ff6913fcf5306e3acb75c70168bminfrin <span><strong class="command">named</strong></span> can search the key directory for keys
94e96b9af3e76ff6913fcf5306e3acb75c70168bminfrin matching the zone, insert them into the zone, and use them to
94e96b9af3e76ff6913fcf5306e3acb75c70168bminfrin sign the zone. It will do so only when it receives an
94e96b9af3e76ff6913fcf5306e3acb75c70168bminfrin <span><strong class="command">rndc sign &lt;zonename&gt;</strong></span>.</p>
294742ca68d050582b774a02fa708926d4eba173minfrin<p>
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton
294742ca68d050582b774a02fa708926d4eba173minfrin <span><strong class="command">auto-dnssec maintain</strong></span> includes the above
294742ca68d050582b774a02fa708926d4eba173minfrin functionality, but will also automatically adjust the zone's
294742ca68d050582b774a02fa708926d4eba173minfrin DNSKEY records on schedule according to the keys' timing metadata.
294742ca68d050582b774a02fa708926d4eba173minfrin (See <a href="man.dnssec-keygen.html" title="dnssec-keygen"><span class="refentrytitle"><span class="application">dnssec-keygen</span></span>(8)</a> and
294742ca68d050582b774a02fa708926d4eba173minfrin <a href="man.dnssec-settime.html" title="dnssec-settime"><span class="refentrytitle"><span class="application">dnssec-settime</span></span>(8)</a> for more information.)
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton </p>
294742ca68d050582b774a02fa708926d4eba173minfrin<p>
294742ca68d050582b774a02fa708926d4eba173minfrin <span><strong class="command">named</strong></span> will periodically search the key directory
294742ca68d050582b774a02fa708926d4eba173minfrin for keys matching the zone, and if the keys' metadata indicates
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton that any change should be made the zone, such as adding, removing,
294742ca68d050582b774a02fa708926d4eba173minfrin or revoking a key, then that action will be carried out. By default,
294742ca68d050582b774a02fa708926d4eba173minfrin the key directory is checked for changes every 60 minutes; this period
294742ca68d050582b774a02fa708926d4eba173minfrin can be adjusted with the <code class="option">dnssec-loadkeys-interval</code>, up
294742ca68d050582b774a02fa708926d4eba173minfrin to a maximum of 24 hours. The <span><strong class="command">rndc loadkeys</strong></span> forces
294742ca68d050582b774a02fa708926d4eba173minfrin <span><strong class="command">named</strong></span> to check for key updates immediately.
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton </p>
29bb843fb0833aec0d7f631a2bdbba9e9f6f3851minfrin<p>
29bb843fb0833aec0d7f631a2bdbba9e9f6f3851minfrin If keys are present in the key directory the first time the zone
29bb843fb0833aec0d7f631a2bdbba9e9f6f3851minfrin is loaded, the zone will be signed immediately, without waiting for an
29bb843fb0833aec0d7f631a2bdbba9e9f6f3851minfrin <span><strong class="command">rndc sign</strong></span> or <span><strong class="command">rndc loadkeys</strong></span>
29bb843fb0833aec0d7f631a2bdbba9e9f6f3851minfrin command. (Those commands can still be used when there are unscheduled
edc6a3f9716dedb2d3f365820544f729ef666ab9jorton key changes, however.)
b837ddaa27238a68194cefc842a0620dd28c75fbtrawick </p>
b837ddaa27238a68194cefc842a0620dd28c75fbtrawick<p>
b837ddaa27238a68194cefc842a0620dd28c75fbtrawick If you wish the zone to be signed using NSEC3 instead of NSEC,
b837ddaa27238a68194cefc842a0620dd28c75fbtrawick submit an NSEC3PARAM record via dynamic update prior to the
9ee730154a1f2bcd0e650ffc4df999460c2c6660bnicholes scheduled publication and activation of the keys. If you wish the
9ee730154a1f2bcd0e650ffc4df999460c2c6660bnicholes NSEC3 chain to have the OPTOUT bit set, set it in the flags field
9ee730154a1f2bcd0e650ffc4df999460c2c6660bnicholes of the NSEC3PARAM record. The NSEC3PARAM record will not appear in
9ee730154a1f2bcd0e650ffc4df999460c2c6660bnicholes the zone immediately, but it will be stored for later reference. When
9ee730154a1f2bcd0e650ffc4df999460c2c6660bnicholes the zone is signed and the NSEC3 chain is completed, the NSEC3PARAM
c386113d5a8d0760909f40632fa84b387405e976trawick record will appear in the zone.
c386113d5a8d0760909f40632fa84b387405e976trawick </p>
c386113d5a8d0760909f40632fa84b387405e976trawick<p>Using the
c386113d5a8d0760909f40632fa84b387405e976trawick <span><strong class="command">auto-dnssec</strong></span> option requires the zone to be
c386113d5a8d0760909f40632fa84b387405e976trawick configured to allow dynamic updates, by adding an
c386113d5a8d0760909f40632fa84b387405e976trawick <span><strong class="command">allow-update</strong></span> or
c386113d5a8d0760909f40632fa84b387405e976trawick <span><strong class="command">update-policy</strong></span> statement to the zone
c386113d5a8d0760909f40632fa84b387405e976trawick configuration. If this has not been done, the configuration will
c386113d5a8d0760909f40632fa84b387405e976trawick fail.</p>
c386113d5a8d0760909f40632fa84b387405e976trawick<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
408cee92f47d2d345c9fd57b17341d3dbbca4259nd<a name="id2563605"></a>Private-type records</h3></div></div></div></div>
408cee92f47d2d345c9fd57b17341d3dbbca4259nd<p>The state of the signing process is signaled by
408cee92f47d2d345c9fd57b17341d3dbbca4259nd private-type records (with a default type value of 65534). When
408cee92f47d2d345c9fd57b17341d3dbbca4259nd signing is complete, these records will have a nonzero value for
408cee92f47d2d345c9fd57b17341d3dbbca4259nd the final octet (for those records which have a nonzero initial
408cee92f47d2d345c9fd57b17341d3dbbca4259nd octet).</p>
916b4a16ae45981780b372609bbaa05d45f8d9babnicholes<p>The private type record format: If the first octet is
916b4a16ae45981780b372609bbaa05d45f8d9babnicholes non-zero then the record indicates that the zone needs to be
916b4a16ae45981780b372609bbaa05d45f8d9babnicholes signed with the key matching the record, or that all signatures
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton that match the record should be removed.</p>
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton<p>
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton </p>
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton<div class="literallayout"><p><br>
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton<br>
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton��algorithm�(octet�1)<br>
7b95cbe3641be28a5b9aed8bbf749643f3c9e65cnd��key�id�in�network�order�(octet�2�and�3)<br>
7b95cbe3641be28a5b9aed8bbf749643f3c9e65cnd��removal�flag�(octet�4)<br>
7b95cbe3641be28a5b9aed8bbf749643f3c9e65cnd��complete�flag�(octet�5)<br>
250e3f54ac9cfd4d78b1180e7f75d8a16288b0f8trawick</p></div>
250e3f54ac9cfd4d78b1180e7f75d8a16288b0f8trawick<p>
250e3f54ac9cfd4d78b1180e7f75d8a16288b0f8trawick </p>
78b82ad2a006e5edfc85c5b306369e278a916eb8bnicholes<p>Only records flagged as "complete" can be removed via
78b82ad2a006e5edfc85c5b306369e278a916eb8bnicholes dynamic update. Attempts to remove other private type records
78b82ad2a006e5edfc85c5b306369e278a916eb8bnicholes will be silently ignored.</p>
78b82ad2a006e5edfc85c5b306369e278a916eb8bnicholes<p>If the first octet is zero (this is a reserved algorithm
78b82ad2a006e5edfc85c5b306369e278a916eb8bnicholes number that should never appear in a DNSKEY record) then the
ee64282e65aac20cde407210163ecbf7e104cc56stoddard record indicates changes to the NSEC3 chains are in progress. The
ee64282e65aac20cde407210163ecbf7e104cc56stoddard rest of the record contains an NSEC3PARAM record. The flag field
ee64282e65aac20cde407210163ecbf7e104cc56stoddard tells what operation to perform based on the flag bits.</p>
911591cbd699fcc3df55396b264f2b811a068fb2stoddard<p>
911591cbd699fcc3df55396b264f2b811a068fb2stoddard </p>
911591cbd699fcc3df55396b264f2b811a068fb2stoddard<div class="literallayout"><p><br>
911591cbd699fcc3df55396b264f2b811a068fb2stoddard<br>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard��0x01�OPTOUT<br>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard��0x80�CREATE<br>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard��0x40�REMOVE<br>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard��0x20�NONSEC<br>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard</p></div>
329ce430c1ad464f1927f95f114ab16fe91e4c9bstoddard<p>
2fe16d53f7d596938f07b0e68f65313047028a11geoff </p>
2fe16d53f7d596938f07b0e68f65313047028a11geoff<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
2fe16d53f7d596938f07b0e68f65313047028a11geoff<a name="id2563779"></a>DNSKEY rollovers</h3></div></div></div></div>
2fe16d53f7d596938f07b0e68f65313047028a11geoff<p>As with insecure-to-secure conversions, rolling DNSSEC
2fe16d53f7d596938f07b0e68f65313047028a11geoff keys can be done in two ways: using a dynamic DNS update, or the
de9ac31ae22a1111c3305da66f8a0b289469150ftrawick <span><strong class="command">auto-dnssec</strong></span> zone option.</p>
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
422a2e9e48a594c7d46d62410e45651a7a994430trawick<a name="id2563792"></a>Dynamic DNS update method</h3></div></div></div></div>
422a2e9e48a594c7d46d62410e45651a7a994430trawick<p> To perform key rollovers via dynamic update, you need to add
422a2e9e48a594c7d46d62410e45651a7a994430trawick the <code class="filename">K*</code> files for the new keys so that
422a2e9e48a594c7d46d62410e45651a7a994430trawick <span><strong class="command">named</strong></span> can find them. You can then add the new
422a2e9e48a594c7d46d62410e45651a7a994430trawick DNSKEY RRs via dynamic update.
422a2e9e48a594c7d46d62410e45651a7a994430trawick <span><strong class="command">named</strong></span> will then cause the zone to be signed
422a2e9e48a594c7d46d62410e45651a7a994430trawick with the new keys. When the signing is complete the private type
422a2e9e48a594c7d46d62410e45651a7a994430trawick records will be updated so that the last octet is non
422a2e9e48a594c7d46d62410e45651a7a994430trawick zero.</p>
804768c70a799483fa88678e6e3b3f0f0a2fee77trawick<p>If this is for a KSK you need to inform the parent and any
804768c70a799483fa88678e6e3b3f0f0a2fee77trawick trust anchor repositories of the new KSK.</p>
804768c70a799483fa88678e6e3b3f0f0a2fee77trawick<p>You should then wait for the maximum TTL in the zone before
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz removing the old DNSKEY. If it is a KSK that is being updated,
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz you also need to wait for the DS RRset in the parent to be
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz updated and its TTL to expire. This ensures that all clients will
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz be able to verify at least one signature when you remove the old
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz DNSKEY.</p>
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz<p>The old DNSKEY can be removed via UPDATE. Take care to
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz specify the correct key.
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz <span><strong class="command">named</strong></span> will clean out any signatures generated
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz by the old key after the update completes.</p>
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz<a name="id2571948"></a>Automatic key rollovers</h3></div></div></div></div>
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz<p>When a new key reaches its activation date (as set by
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz <span><strong class="command">dnssec-keygen</strong></span> or <span><strong class="command">dnssec-settime</strong></span>),
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz if the <span><strong class="command">auto-dnssec</strong></span> zone option is set to
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz <code class="constant">maintain</code>, <span><strong class="command">named</strong></span> will
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz automatically carry out the key rollover. If the key's algorithm
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz has not previously been used to sign the zone, then the zone will
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz be fully signed as quickly as possible. However, if the new key
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz is replacing an existing key of the same algorithm, then the
ed3570ebd308d1e57fc42f7ccffec5ca8a6c8afdjorton zone will be re-signed incrementally, with signatures from the
5bd2a3a3d9e7d622546f5a3a973a9b802394ecf1jerenkrantz old key being replaced with signatures from the new key as their
b3f1e12598377cadeff089fc51e1156dbdb1ed00mjc signature validity periods expire. By default, this rollover
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton completes in 30 days, after which it will be safe to remove the
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton old key from the DNSKEY RRset.</p>
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<a name="id2571975"></a>NSEC3PARAM rollovers via UPDATE</h3></div></div></div></div>
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<p>Add the new NSEC3PARAM record via dynamic update. When the
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton new NSEC3 chain has been generated, the NSEC3PARAM flag field
cc0b2a935c91a33f5bc0f13115def505d4b864e3trawick will be zero. At this point you can remove the old NSEC3PARAM
cc0b2a935c91a33f5bc0f13115def505d4b864e3trawick record. The old chain will be removed after the update request
cc0b2a935c91a33f5bc0f13115def505d4b864e3trawick completes.</p>
2a30bb2c6d10ba7eb726e592f090fae2bc316f55nd<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
2a30bb2c6d10ba7eb726e592f090fae2bc316f55nd<a name="id2571985"></a>Converting from NSEC to NSEC3</h3></div></div></div></div>
2a30bb2c6d10ba7eb726e592f090fae2bc316f55nd<p>To do this, you just need to add an NSEC3PARAM record. When
2bc1c8cb65f7b7833251e6ee4c9be636762a5081trawick the conversion is complete, the NSEC chain will have been removed
2bc1c8cb65f7b7833251e6ee4c9be636762a5081trawick and the NSEC3PARAM record will have a zero flag field. The NSEC3
2bc1c8cb65f7b7833251e6ee4c9be636762a5081trawick chain will be generated before the NSEC chain is
2bc1c8cb65f7b7833251e6ee4c9be636762a5081trawick destroyed.</p>
2bc1c8cb65f7b7833251e6ee4c9be636762a5081trawick<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
8006e0b5db61df8e16b3ea4705862cd15b66e8a5striker<a name="id2571994"></a>Converting from NSEC3 to NSEC</h3></div></div></div></div>
8006e0b5db61df8e16b3ea4705862cd15b66e8a5striker<p>To do this, use <span><strong class="command">nsupdate</strong></span> to
8006e0b5db61df8e16b3ea4705862cd15b66e8a5striker remove all NSEC3PARAM records with a zero flag
8006e0b5db61df8e16b3ea4705862cd15b66e8a5striker field. The NSEC chain will be generated before the NSEC3 chain is
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton removed.</p>
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<a name="id2572007"></a>Converting from secure to insecure</h3></div></div></div></div>
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<p>To convert a signed zone to unsigned using dynamic DNS,
dd9feec012ad7760f0f0dd5c12cdd72aee86d243bnicholes delete all the DNSKEY records from the zone apex using
dd9feec012ad7760f0f0dd5c12cdd72aee86d243bnicholes <span><strong class="command">nsupdate</strong></span>. All signatures, NSEC or NSEC3 chains,
dd9feec012ad7760f0f0dd5c12cdd72aee86d243bnicholes and associated NSEC3PARAM records will be removed automatically.
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton This will take place after the update request completes.</p>
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton<p> This requires the
270a4b12c5e0e51c8ffdbe8317db257a79a5f56ajorton <span><strong class="command">dnssec-secure-to-insecure</strong></span> option to be set to
cbb5a63b9436fd6d32b6679812d17e95764a095dnd <strong class="userinput"><code>yes</code></strong> in
cbb5a63b9436fd6d32b6679812d17e95764a095dnd <code class="filename">named.conf</code>.</p>
cbb5a63b9436fd6d32b6679812d17e95764a095dnd<p>In addition, if the <span><strong class="command">auto-dnssec maintain</strong></span>
cbb5a63b9436fd6d32b6679812d17e95764a095dnd zone statement is used, it should be removed or changed to
432de55307c72b09db614e14e79764ac2e6caa2arederpj <span><strong class="command">allow</strong></span> instead (or it will re-sign).
432de55307c72b09db614e14e79764ac2e6caa2arederpj </p>
432de55307c72b09db614e14e79764ac2e6caa2arederpj<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
da152944fea872835df37b7c2141648926c7c22crederpj<a name="id2572044"></a>Periodic re-signing</h3></div></div></div></div>
da152944fea872835df37b7c2141648926c7c22crederpj<p>In any secure zone which supports dynamic updates, named
da152944fea872835df37b7c2141648926c7c22crederpj will periodically re-sign RRsets which have not been re-signed as
da152944fea872835df37b7c2141648926c7c22crederpj a result of some update action. The signature lifetimes will be
6af3206a1b2ebe14ec93368e71f09258998467b4rederpj adjusted so as to spread the re-sign load over time rather than
6af3206a1b2ebe14ec93368e71f09258998467b4rederpj all at once.</p>
6af3206a1b2ebe14ec93368e71f09258998467b4rederpj<div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title">
34e4083fa62b3a9cc49b25b1e11691e5094ad084rederpj<a name="id2572054"></a>NSEC3 and OPTOUT</h3></div></div></div></div>
34e4083fa62b3a9cc49b25b1e11691e5094ad084rederpj<p>
34e4083fa62b3a9cc49b25b1e11691e5094ad084rederpj <span><strong class="command">named</strong></span> only supports creating new NSEC3 chains
c65ea82ddd0e43b6fe808c4b843c5f21eb341dbdrederpj where all the NSEC3 records in the zone have the same OPTOUT
c65ea82ddd0e43b6fe808c4b843c5f21eb341dbdrederpj state.
c65ea82ddd0e43b6fe808c4b843c5f21eb341dbdrederpj <span><strong class="command">named</strong></span> supports UPDATES to zones where the NSEC3
c65ea82ddd0e43b6fe808c4b843c5f21eb341dbdrederpj records in the chain have mixed OPTOUT state.
6cad04219c5f99d71d86b8156520f393b610bb04rederpj <span><strong class="command">named</strong></span> does not support changing the OPTOUT
6cad04219c5f99d71d86b8156520f393b610bb04rederpj state of an individual NSEC3 record, the entire chain needs to be
6cad04219c5f99d71d86b8156520f393b610bb04rederpj changed if the OPTOUT state of an individual NSEC3 needs to be
1b6c93a6a669e703316455afdd1c789c2c3fa3a2rederpj changed.</p>
1b6c93a6a669e703316455afdd1c789c2c3fa3a2rederpj</div>
1b6c93a6a669e703316455afdd1c789c2c3fa3a2rederpj<div class="sect1" lang="en">
1b6c93a6a669e703316455afdd1c789c2c3fa3a2rederpj<div class="titlepage"><div><div><h2 class="title" style="clear: both">
7a706bb27e442a89a00d736fb5a6cc3ec0713cedrederpj<a name="rfc5011.support"></a>Dynamic Trust Anchor Management</h2></div></div></div>
7a706bb27e442a89a00d736fb5a6cc3ec0713cedrederpj<p>BIND 9.7.0 introduces support for RFC 5011, dynamic trust
7a706bb27e442a89a00d736fb5a6cc3ec0713cedrederpj anchor management. Using this feature allows
7a706bb27e442a89a00d736fb5a6cc3ec0713cedrederpj <span><strong class="command">named</strong></span> to keep track of changes to critical
7a706bb27e442a89a00d736fb5a6cc3ec0713cedrederpj DNSSEC keys without any need for the operator to make changes to
7a706bb27e442a89a00d736fb5a6cc3ec0713cedrederpj configuration files.</p>
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj<div class="sect2" lang="en">
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj<div class="titlepage"><div><div><h3 class="title">
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj<a name="id2572087"></a>Validating Resolver</h3></div></div></div>
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj<p>To configure a validating resolver to use RFC 5011 to
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj maintain a trust anchor, configure the trust anchor using a
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj <span><strong class="command">managed-keys</strong></span> statement. Information about
f93e3a425ac550079682c6e4d9ecccdb2c9225fdrederpj this can be found in
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton <a href="Bv9ARM.ch06.html#managed-keys" title="managed-keys Statement Definition
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton and Usage">the section called &#8220;<span><strong class="command">managed-keys</strong></span> Statement Definition
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton and Usage&#8221;</a>.</p>
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton</div>
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton<div class="sect2" lang="en">
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton<div class="titlepage"><div><div><h3 class="title">
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton<a name="id2572109"></a>Authoritative Server</h3></div></div></div>
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton<p>To set up an authoritative zone for RFC 5011 trust anchor
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton maintenance, generate two (or more) key signing keys (KSKs) for
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton the zone. Sign the zone with one of them; this is the "active"
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton KSK. All KSK's which do not sign the zone are "stand-by"
2666c6e15c495cdc39b00c7bd5e3f180407dae9ejorton keys.</p>
166ee86bb7bdcf9a89ebccee59c72064ac627dc0nd<p>Any validating resolver which is configured to use the
166ee86bb7bdcf9a89ebccee59c72064ac627dc0nd active KSK as an RFC 5011-managed trust anchor will take note
166ee86bb7bdcf9a89ebccee59c72064ac627dc0nd of the stand-by KSKs in the zone's DNSKEY RRset, and store them
166ee86bb7bdcf9a89ebccee59c72064ac627dc0nd for future reference. The resolver will recheck the zone
166ee86bb7bdcf9a89ebccee59c72064ac627dc0nd periodically, and after 30 days, if the new key is still there,
166ee86bb7bdcf9a89ebccee59c72064ac627dc0nd then the key will be accepted by the resolver as a valid trust
0dd9b0cc0c1dcf7f6c4dba782a0b50f0b69f519dtrawick anchor for the zone. Any time after this 30-day acceptance
0dd9b0cc0c1dcf7f6c4dba782a0b50f0b69f519dtrawick timer has completed, the active KSK can be revoked, and the
0dd9b0cc0c1dcf7f6c4dba782a0b50f0b69f519dtrawick zone can be "rolled over" to the newly accepted key.</p>
0c4c708dd860d02dd784da6dc5e7001044185620stoddard<p>The easiest way to place a stand-by key in a zone is to
0c4c708dd860d02dd784da6dc5e7001044185620stoddard use the "smart signing" features of
0c4c708dd860d02dd784da6dc5e7001044185620stoddard <span><strong class="command">dnssec-keygen</strong></span> and
0c4c708dd860d02dd784da6dc5e7001044185620stoddard <span><strong class="command">dnssec-signzone</strong></span>. If a key with a publication
0c4c708dd860d02dd784da6dc5e7001044185620stoddard date in the past, but an activation date which is unset or in
0c4c708dd860d02dd784da6dc5e7001044185620stoddard the future, "
0c4c708dd860d02dd784da6dc5e7001044185620stoddard <span><strong class="command">dnssec-signzone -S</strong></span>" will include the DNSKEY
0c4c708dd860d02dd784da6dc5e7001044185620stoddard record in the zone, but will not sign with it:</p>
84e59981d4df2f141ac6153e06fd8371406dd23cnd<pre class="screen">
84e59981d4df2f141ac6153e06fd8371406dd23cnd$ <strong class="userinput"><code>dnssec-keygen -K keys -f KSK -P now -A now+2y example.net</code></strong>
84e59981d4df2f141ac6153e06fd8371406dd23cnd$ <strong class="userinput"><code>dnssec-signzone -S -K keys example.net</code></strong>
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick</pre>
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick<p>To revoke a key, the new command
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick <span><strong class="command">dnssec-revoke</strong></span> has been added. This adds the
d545dd10d4e60c2ae57205017550cb48311a3ac7nd REVOKED bit to the key flags and re-generates the
d545dd10d4e60c2ae57205017550cb48311a3ac7nd <code class="filename">K*.key</code> and
d545dd10d4e60c2ae57205017550cb48311a3ac7nd <code class="filename">K*.private</code> files.</p>
d545dd10d4e60c2ae57205017550cb48311a3ac7nd<p>After revoking the active key, the zone must be signed
d545dd10d4e60c2ae57205017550cb48311a3ac7nd with both the revoked KSK and the new active KSK. (Smart
d545dd10d4e60c2ae57205017550cb48311a3ac7nd signing takes care of this automatically.)</p>
75c180fb45396964ad10af6444077798a470b6a3jorton<p>Once a key has been revoked and used to sign the DNSKEY
75c180fb45396964ad10af6444077798a470b6a3jorton RRset in which it appears, that key will never again be
75c180fb45396964ad10af6444077798a470b6a3jorton accepted as a valid trust anchor by the resolver. However,
75c180fb45396964ad10af6444077798a470b6a3jorton validation can proceed using the new active key (which had been
75c180fb45396964ad10af6444077798a470b6a3jorton accepted by the resolver when it was a stand-by key).</p>
75c180fb45396964ad10af6444077798a470b6a3jorton<p>See RFC 5011 for more details on key rollover
75c180fb45396964ad10af6444077798a470b6a3jorton scenarios.</p>
75c180fb45396964ad10af6444077798a470b6a3jorton<p>When a key has been revoked, its key ID changes,
277e05eebdd1878d86c1edc2538c94c5b42102e4nd increasing by 128, and wrapping around at 65535. So, for
277e05eebdd1878d86c1edc2538c94c5b42102e4nd example, the key "<code class="filename">Kexample.com.+005+10000</code>" becomes
277e05eebdd1878d86c1edc2538c94c5b42102e4nd "<code class="filename">Kexample.com.+005+10128</code>".</p>
277e05eebdd1878d86c1edc2538c94c5b42102e4nd<p>If two keys have ID's exactly 128 apart, and one is
277e05eebdd1878d86c1edc2538c94c5b42102e4nd revoked, then the two key ID's will collide, causing several
277e05eebdd1878d86c1edc2538c94c5b42102e4nd problems. To prevent this,
277e05eebdd1878d86c1edc2538c94c5b42102e4nd <span><strong class="command">dnssec-keygen</strong></span> will not generate a new key if
277e05eebdd1878d86c1edc2538c94c5b42102e4nd another key is present which may collide. This checking will
277e05eebdd1878d86c1edc2538c94c5b42102e4nd only occur if the new keys are written to the same directory
277e05eebdd1878d86c1edc2538c94c5b42102e4nd which holds all other keys in use for that zone.</p>
1cc35a6e650c0567003fc814e9887d31191756cdrederpj<p>Older versions of BIND 9 did not have this precaution.
1cc35a6e650c0567003fc814e9887d31191756cdrederpj Exercise caution if using key revocation on keys that were
1cc35a6e650c0567003fc814e9887d31191756cdrederpj generated by previous releases, or if using keys stored in
1cc35a6e650c0567003fc814e9887d31191756cdrederpj multiple directories or on multiple machines.</p>
1cc35a6e650c0567003fc814e9887d31191756cdrederpj<p>It is expected that a future release of BIND 9 will
1cc35a6e650c0567003fc814e9887d31191756cdrederpj address this problem in a different way, by storing revoked
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick keys with their original unrevoked key ID's.</p>
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick</div>
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick</div>
24a4c5e6b1bef738d5eb25cf8201d6515c42c923trawick<div class="sect1" lang="en">
b5d97619ae59d852d8552dbc66413a653d049314trawick<div class="titlepage"><div><div><h2 class="title" style="clear: both">
b5d97619ae59d852d8552dbc66413a653d049314trawick<a name="pkcs11"></a>PKCS #11 (Cryptoki) support</h2></div></div></div>
24a4c5e6b1bef738d5eb25cf8201d6515c42c923trawick<p>PKCS #11 (Public Key Cryptography Standard #11) defines a
24a4c5e6b1bef738d5eb25cf8201d6515c42c923trawick platform- independent API for the control of hardware security
24a4c5e6b1bef738d5eb25cf8201d6515c42c923trawick modules (HSMs) and other cryptographic support devices.</p>
24a4c5e6b1bef738d5eb25cf8201d6515c42c923trawick<p>BIND 9 is known to work with two HSMs: The Sun SCA 6000
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz cryptographic acceleration board, tested under Solaris x86, and
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz the AEP Keyper network-attached key storage device, tested with
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz Debian Linux, Solaris x86 and Windows Server 2003.</p>
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<div class="sect2" lang="en">
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<div class="titlepage"><div><div><h3 class="title">
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<a name="id2613378"></a>Prerequisites</h3></div></div></div>
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<p>See the HSM vendor documentation for information about
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz installing, initializing, testing and troubleshooting the
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz HSM.</p>
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<p>BIND 9 uses OpenSSL for cryptography, but stock OpenSSL
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz does not yet fully support PKCS #11. However, a PKCS #11 engine
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz for OpenSSL is available from the OpenSolaris project. It has
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz been modified by ISC to work with with BIND 9, and to provide
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz new features such as PIN management and key by
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz reference.</p>
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<p>The patched OpenSSL depends on a "PKCS #11 provider".
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick This is a shared library object, providing a low-level PKCS #11
4bf5825d6c53ba24264110d7bf774709b1b2bc78trawick interface to the HSM hardware. It is dynamically loaded by
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz OpenSSL at runtime. The PKCS #11 provider comes from the HSM
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz vendor, and is specific to the HSM to be controlled.</p>
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz<p>There are two "flavors" of PKCS #11 support provided by
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz the patched OpenSSL, one of which must be chosen at
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz configuration time. The correct choice depends on the HSM
fe5303df6dec2c01e27c211277c64743ab631ceajerenkrantz hardware:</p>
b3f1e12598377cadeff089fc51e1156dbdb1ed00mjc<div class="itemizedlist"><ul type="disc">
4fa67b2497a22630f91186ee68d0798576a7af3and<li><p>Use 'crypto-accelerator' with HSMs that have hardware
4fa67b2497a22630f91186ee68d0798576a7af3and cryptographic acceleration features, such as the SCA 6000
4fa67b2497a22630f91186ee68d0798576a7af3and board. This causes OpenSSL to run all supported
645462b550a122912993af71d6d5bf36b59ccd2and cryptographic operations in the HSM.</p></li>
645462b550a122912993af71d6d5bf36b59ccd2and<li><p>Use 'sign-only' with HSMs that are designed to
645462b550a122912993af71d6d5bf36b59ccd2and function primarily as secure key storage devices, but lack
645462b550a122912993af71d6d5bf36b59ccd2and hardware acceleration. These devices are highly secure, but
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick are not necessarily any faster at cryptography than the
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick system CPU &#8212; often, they are slower. It is therefore
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick most efficient to use them only for those cryptographic
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick functions that require access to the secured private key,
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick such as zone signing, and to use the system CPU for all
b1ec41290ed913e1b9088e0a0191f8a751ee56b1trawick other computationally-intensive operations. The AEP Keyper
398ad83052f1d7ac83465320fc0bf3fef43126f4stoddard is an example of such a device.</p></li>
398ad83052f1d7ac83465320fc0bf3fef43126f4stoddard</ul></div>
398ad83052f1d7ac83465320fc0bf3fef43126f4stoddard<p>The modified OpenSSL code is included in the BIND 9 release,
de9ac31ae22a1111c3305da66f8a0b289469150ftrawick in the form of a context diff against the latest verions of
69a2f591a7db749c7b5d07c847b94aa55c378521rederpj OpenSSL. OpenSSL 0.9.8 and 1.0.0 are both supported; there are
69a2f591a7db749c7b5d07c847b94aa55c378521rederpj separate diffs for each version. In the examples to follow,
69a2f591a7db749c7b5d07c847b94aa55c378521rederpj we use OpenSSL 0.9.8, but the same methods work with OpenSSL 1.0.0.
69a2f591a7db749c7b5d07c847b94aa55c378521rederpj </p>
69a2f591a7db749c7b5d07c847b94aa55c378521rederpj<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
69a2f591a7db749c7b5d07c847b94aa55c378521rederpj<h3 class="title">Note</h3>
0f27f7efd99f727b3dc16c7cbe03e8ff477790f4stas The latest OpenSSL versions at the time of the BIND release
0f27f7efd99f727b3dc16c7cbe03e8ff477790f4stas are 0.9.8s and 1.0.0f.
0f27f7efd99f727b3dc16c7cbe03e8ff477790f4stas ISC will provide an updated patch as new versions of OpenSSL
0f27f7efd99f727b3dc16c7cbe03e8ff477790f4stas are released. The version number in the following examples
0f27f7efd99f727b3dc16c7cbe03e8ff477790f4stas is expected to change.</div>
0f27f7efd99f727b3dc16c7cbe03e8ff477790f4stas<p>
34460b4bbbc11663429978600a97abfbf38fc38atrawick Before building BIND 9 with PKCS #11 support, it will be
34460b4bbbc11663429978600a97abfbf38fc38atrawick necessary to build OpenSSL with this patch in place and inform
34460b4bbbc11663429978600a97abfbf38fc38atrawick it of the path to the HSM-specific PKCS #11 provider
34460b4bbbc11663429978600a97abfbf38fc38atrawick library.</p>
34460b4bbbc11663429978600a97abfbf38fc38atrawick<p>Obtain OpenSSL 0.9.8s:</p>
34460b4bbbc11663429978600a97abfbf38fc38atrawick<pre class="screen">
34460b4bbbc11663429978600a97abfbf38fc38atrawick$ <strong class="userinput"><code>wget <a href="" target="_top">http://www.openssl.org/source/openssl-0.9.8s.tar.gz</a></code></strong>
34460b4bbbc11663429978600a97abfbf38fc38atrawick</pre>
34460b4bbbc11663429978600a97abfbf38fc38atrawick<p>Extract the tarball:</p>
32316124ea6961dc3aaa63272844bc2f919c0827jorton<pre class="screen">
32316124ea6961dc3aaa63272844bc2f919c0827jorton$ <strong class="userinput"><code>tar zxf openssl-0.9.8s.tar.gz</code></strong>
32316124ea6961dc3aaa63272844bc2f919c0827jorton</pre>
32316124ea6961dc3aaa63272844bc2f919c0827jorton<p>Apply the patch from the BIND 9 release:</p>
32316124ea6961dc3aaa63272844bc2f919c0827jorton<pre class="screen">
32316124ea6961dc3aaa63272844bc2f919c0827jorton$ <strong class="userinput"><code>patch -p1 -d openssl-0.9.8s \
32316124ea6961dc3aaa63272844bc2f919c0827jorton &lt; bind9/bin/pkcs11/openssl-0.9.8s-patch</code></strong>
32316124ea6961dc3aaa63272844bc2f919c0827jorton</pre>
32316124ea6961dc3aaa63272844bc2f919c0827jorton<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
32316124ea6961dc3aaa63272844bc2f919c0827jorton<h3 class="title">Note</h3>(Note that the patch file may not be compatible with the
32316124ea6961dc3aaa63272844bc2f919c0827jorton "patch" utility on all operating systems. You may need to
32316124ea6961dc3aaa63272844bc2f919c0827jorton install GNU patch.)</div>
ec7f4f32825686dbd6fc4cb9a4aa024b807dae8brederpj<p>When building OpenSSL, place it in a non-standard
ec7f4f32825686dbd6fc4cb9a4aa024b807dae8brederpj location so that it does not interfere with OpenSSL libraries
ec7f4f32825686dbd6fc4cb9a4aa024b807dae8brederpj elsewhere on the system. In the following examples, we choose
ec7f4f32825686dbd6fc4cb9a4aa024b807dae8brederpj to install into "/opt/pkcs11/usr". We will use this location
ec7f4f32825686dbd6fc4cb9a4aa024b807dae8brederpj when we configure BIND 9.</p>
c41285f93f9d382af7fee08bbdf1ff173be0da77nd<div class="sect3" lang="en">
c41285f93f9d382af7fee08bbdf1ff173be0da77nd<div class="titlepage"><div><div><h4 class="title">
c41285f93f9d382af7fee08bbdf1ff173be0da77nd<a name="id2611289"></a>Building OpenSSL for the AEP Keyper on Linux</h4></div></div></div>
c41285f93f9d382af7fee08bbdf1ff173be0da77nd<p>The AEP Keyper is a highly secure key storage device,
c41285f93f9d382af7fee08bbdf1ff173be0da77nd but does not provide hardware cryptographic acceleration. It
c41285f93f9d382af7fee08bbdf1ff173be0da77nd can carry out cryptographic operations, but it is probably
812be02eda26272b189161e3be099155b195b667trawick slower than your system's CPU. Therefore, we choose the
812be02eda26272b189161e3be099155b195b667trawick 'sign-only' flavor when building OpenSSL.</p>
812be02eda26272b189161e3be099155b195b667trawick<p>The Keyper-specific PKCS #11 provider library is
452eaf978884ae5c01422f563ec77b8ef17d12b8trawick delivered with the Keyper software. In this example, we place
452eaf978884ae5c01422f563ec77b8ef17d12b8trawick it /opt/pkcs11/usr/lib:</p>
452eaf978884ae5c01422f563ec77b8ef17d12b8trawick<pre class="screen">
452eaf978884ae5c01422f563ec77b8ef17d12b8trawick$ <strong class="userinput"><code>cp pkcs11.GCC4.0.2.so.4.05 /opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
452eaf978884ae5c01422f563ec77b8ef17d12b8trawick</pre>
beeffe96b9eca176aa9120df8c0b7df8c94138adtrawick<p>This library is only available for Linux as a 32-bit
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe binary. If we are compiling on a 64-bit Linux system, it is
beeffe96b9eca176aa9120df8c0b7df8c94138adtrawick necessary to force a 32-bit build, by specifying -m32 in the
de9ac31ae22a1111c3305da66f8a0b289469150ftrawick build options.</p>
de9ac31ae22a1111c3305da66f8a0b289469150ftrawick<p>Finally, the Keyper library requires threads, so we
de9ac31ae22a1111c3305da66f8a0b289469150ftrawick must specify -pthread.</p>
de9ac31ae22a1111c3305da66f8a0b289469150ftrawick<pre class="screen">
59b910556d04c82e951d6c6f7a413ab8fed21467trawick$ <strong class="userinput"><code>cd openssl-0.9.8s</code></strong>
34109fa9f1317edbc6bb7d67ff8933850668b797striker$ <strong class="userinput"><code>/Configure linux-generic32 -m32 -pthread \
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton --pk11-libname=/opt/pkcs11/usr/lib/libpkcs11.so \
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton --pk11-flavor=sign-only \
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton --prefix=/opt/pkcs11/usr</code></strong>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton</pre>
fb5e196e2ee5aa7c185292c07c73e99bdf1d376astriker<p>After configuring, run "<span><strong class="command">make</strong></span>"
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton and "<span><strong class="command">make test</strong></span>". If "<span><strong class="command">make
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton test</strong></span>" fails with "pthread_atfork() not found", you forgot to
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton add the -pthread above.</p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton</div>
bbe046d7cbb950ab3e372e4119ae001a5fe52ed4striker<div class="sect3" lang="en">
2963f1c4b67ba02ba20c26ec8f0102261c758440nd<div class="titlepage"><div><div><h4 class="title">
2963f1c4b67ba02ba20c26ec8f0102261c758440nd<a name="id2611358"></a>Building OpenSSL for the SCA 6000 on Solaris</h4></div></div></div>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>The SCA-6000 PKCS #11 provider is installed as a system
2963f1c4b67ba02ba20c26ec8f0102261c758440nd library, libpkcs11. It is a true crypto accelerator, up to 4
741e26a23be86c7e457455b09501ee68b1118e1bstas times faster than any CPU, so the flavor shall be
741e26a23be86c7e457455b09501ee68b1118e1bstas 'crypto-accelerator'.</p>
741e26a23be86c7e457455b09501ee68b1118e1bstas<p>In this example, we are building on Solaris x86 on an
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe AMD64 system.</p>
741e26a23be86c7e457455b09501ee68b1118e1bstas<pre class="screen">
e65b630463d750b296566135c16a30a551aa8cb4trawick$ <strong class="userinput"><code>cd openssl-0.9.8s</code></strong>
e65b630463d750b296566135c16a30a551aa8cb4trawick$ <strong class="userinput"><code>/Configure solaris64-x86_64-cc \
e65b630463d750b296566135c16a30a551aa8cb4trawick --pk11-libname=/usr/lib/64/libpkcs11.so \
e65b630463d750b296566135c16a30a551aa8cb4trawick --pk11-flavor=crypto-accelerator \
b1a4bfe2ea1faafd10cad5051e07503e7596b1f0fielding --prefix=/opt/pkcs11/usr</code></strong>
b1a4bfe2ea1faafd10cad5051e07503e7596b1f0fielding</pre>
b1a4bfe2ea1faafd10cad5051e07503e7596b1f0fielding<p>(For a 32-bit build, use "solaris-x86-cc" and
b1a4bfe2ea1faafd10cad5051e07503e7596b1f0fielding /usr/lib/libpkcs11.so.)</p>
6562ca01f461db28f8b2ce4626b548627644ce12nd<p>After configuring, run
6562ca01f461db28f8b2ce4626b548627644ce12nd <span><strong class="command">make</strong></span> and
6562ca01f461db28f8b2ce4626b548627644ce12nd <span><strong class="command">make test</strong></span>.</p>
e41198355d5d81236db1da8892402a4cdd89525drederpj</div>
b1a4bfe2ea1faafd10cad5051e07503e7596b1f0fielding<div class="sect3" lang="en">
b1a4bfe2ea1faafd10cad5051e07503e7596b1f0fielding<div class="titlepage"><div><div><h4 class="title">
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<a name="id2611408"></a>Building OpenSSL for SoftHSM</h4></div></div></div>
e41198355d5d81236db1da8892402a4cdd89525drederpj<p>SoftHSM is a software library provided by the OpenDNSSEC
99110e8199a4c4b53731e80466aefba5715c342amartin project (http://www.opendnssec.org) which provides a PKCS#11
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe interface to a virtual HSM, implemented in the form of encrypted
d701aa8681316e8735d511d4912eb7b9b492fb68rederpj data on the local filesystem. It uses the Botan library for
dac743792d4e2f6824b4a5853d9f6fa98e3acfa7thommay encryption and SQLite3 for data storage. Though less secure
dac743792d4e2f6824b4a5853d9f6fa98e3acfa7thommay than a true HSM, it can provide more secure key storage than
6562ca01f461db28f8b2ce4626b548627644ce12nd traditional key files, and can allow you to experiment with
dac743792d4e2f6824b4a5853d9f6fa98e3acfa7thommay PKCS#11 when an HSM is not available.</p>
dac743792d4e2f6824b4a5853d9f6fa98e3acfa7thommay<p>The SoftHSM cryptographic store must be installed and
34109fa9f1317edbc6bb7d67ff8933850668b797striker initialized before using it with OpenSSL, and the SOFTHSM_CONF
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe environment variable must always point to the SoftHSM configuration
34109fa9f1317edbc6bb7d67ff8933850668b797striker file:</p>
2657c07d01de3105a1cf72aa3b708f2e9d8b9f08striker<pre class="screen">
2657c07d01de3105a1cf72aa3b708f2e9d8b9f08striker$ <strong class="userinput"><code> cd softhsm-1.3.0 </code></strong>
2657c07d01de3105a1cf72aa3b708f2e9d8b9f08striker$ <strong class="userinput"><code> configure --prefix=/opt/pkcs11/usr </code></strong>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe$ <strong class="userinput"><code> make </code></strong>
59b910556d04c82e951d6c6f7a413ab8fed21467trawick$ <strong class="userinput"><code> make install </code></strong>
ac22e37364071bc5160c4c1956fa64577988ce2dstriker$ <strong class="userinput"><code> export SOFTHSM_CONF=/opt/pkcs11/softhsm.conf </code></strong>
ac22e37364071bc5160c4c1956fa64577988ce2dstriker$ <strong class="userinput"><code> echo "0:/opt/pkcs11/softhsm.db" &gt; $SOFTHSM_CONF </code></strong>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe$ <strong class="userinput"><code> /opt/pkcs11/usr/bin/softhsm --init-token 0 --slot 0 --label softhsm </code></strong>
ac22e37364071bc5160c4c1956fa64577988ce2dstriker</pre>
d2ca4f326388fdd19058284043d15ec0b23d0722striker<p>SoftHSM can perform all cryptographic operations, but
d2ca4f326388fdd19058284043d15ec0b23d0722striker since it only uses your system CPU, there is no need to use it
d2ca4f326388fdd19058284043d15ec0b23d0722striker for anything but signing. Therefore, we choose the 'sign-only'
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe flavor when building OpenSSL.</p>
d2ca4f326388fdd19058284043d15ec0b23d0722striker<pre class="screen">
6562ca01f461db28f8b2ce4626b548627644ce12nd$ <strong class="userinput"><code>cd openssl-0.9.8s</code></strong>
6562ca01f461db28f8b2ce4626b548627644ce12nd$ <strong class="userinput"><code>/Configure linux-x86_64 -pthread \
6562ca01f461db28f8b2ce4626b548627644ce12nd --pk11-libname=/opt/pkcs11/usr/lib/libpkcs11.so \
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick --pk11-flavor=sign-only \
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick --prefix=/opt/pkcs11/usr</code></strong>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick</pre>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<p>After configuring, run "<span><strong class="command">make</strong></span>"
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick and "<span><strong class="command">make test</strong></span>".</p>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick</div>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<p>Once you have built OpenSSL, run
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick "<span><strong class="command">apps/openssl engine pkcs11</strong></span>" to confirm
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick that PKCS #11 support was compiled in correctly. The output
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick should be one of the following lines, depending on the flavor
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick selected:</p>
ec7254c302703353d73d8d69d83cdeb0c580c8cetrawick<pre class="screen">
ec7254c302703353d73d8d69d83cdeb0c580c8cetrawick (pkcs11) PKCS #11 engine support (sign only)
ec7254c302703353d73d8d69d83cdeb0c580c8cetrawick</pre>
ba5e097fd39f0937be37ae32d65e1d3339e07f43trawick<p>Or:</p>
ba5e097fd39f0937be37ae32d65e1d3339e07f43trawick<pre class="screen">
ba5e097fd39f0937be37ae32d65e1d3339e07f43trawick (pkcs11) PKCS #11 engine support (crypto accelerator)
ba5e097fd39f0937be37ae32d65e1d3339e07f43trawick</pre>
4c517f7e59d17e86aeb473088d254f24034b4de8trawick<p>Next, run
4c517f7e59d17e86aeb473088d254f24034b4de8trawick "<span><strong class="command">apps/openssl engine pkcs11 -t</strong></span>". This will
26280128921459eadd3f76a44aee9ba2f7f941c2trawick attempt to initialize the PKCS #11 engine. If it is able to
26280128921459eadd3f76a44aee9ba2f7f941c2trawick do so successfully, it will report
26280128921459eadd3f76a44aee9ba2f7f941c2trawick &#8220;<span class="quote"><code class="literal">[ available ]</code></span>&#8221;.</p>
26280128921459eadd3f76a44aee9ba2f7f941c2trawick<p>If the output is correct, run
26280128921459eadd3f76a44aee9ba2f7f941c2trawick "<span><strong class="command">make install</strong></span>" which will install the
26280128921459eadd3f76a44aee9ba2f7f941c2trawick modified OpenSSL suite to
26280128921459eadd3f76a44aee9ba2f7f941c2trawick <code class="filename">/opt/pkcs11/usr</code>.</p>
26280128921459eadd3f76a44aee9ba2f7f941c2trawick</div>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<div class="sect2" lang="en">
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<div class="titlepage"><div><div><h3 class="title">
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<a name="id2638115"></a>Building BIND 9 with PKCS#11</h3></div></div></div>
dd4dfb1a26f821768f4174cf0465fee13556b68ejerenkrantz<p>When building BIND 9, the location of the custom-built
dd4dfb1a26f821768f4174cf0465fee13556b68ejerenkrantz OpenSSL library must be specified via configure.</p>
dd4dfb1a26f821768f4174cf0465fee13556b68ejerenkrantz<div class="sect3" lang="en">
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<div class="titlepage"><div><div><h4 class="title">
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<a name="id2638123"></a>Configuring BIND 9 for Linux with the AEP Keyper</h4></div></div></div>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<p>To link with the PKCS #11 provider, threads must be
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick enabled in the BIND 9 build.</p>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<p>The PKCS #11 library for the AEP Keyper is currently
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick only available as a 32-bit binary. If we are building on a
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick 64-bit host, we must force a 32-bit build by adding "-m32" to
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick the CC options on the "configure" command line.</p>
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick<pre class="screen">
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd$ <strong class="userinput"><code>cd /bind9</code></strong>
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd$ <strong class="userinput"><code>/configure CC="gcc -m32" --enable-threads \
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd --with-openssl=/opt/pkcs11/usr \
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd --with-pkcs11=/opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd</pre>
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd</div>
f2af12bd7c7b0506678b4dc981482d59e49f08d3nd<div class="sect3" lang="en">
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz<div class="titlepage"><div><div><h4 class="title">
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz<a name="id2638155"></a>Configuring BIND 9 for Solaris with the SCA 6000</h4></div></div></div>
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz<p>To link with the PKCS #11 provider, threads must be
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz enabled in the BIND 9 build.</p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<pre class="screen">
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz$ <strong class="userinput"><code>cd /bind9</code></strong>
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz$ <strong class="userinput"><code>/configure CC="cc -xarch=amd64" --enable-threads \
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz --with-openssl=/opt/pkcs11/usr \
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz --with-pkcs11=/usr/lib/64/libpkcs11.so</code></strong>
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz</pre>
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz<p>(For a 32-bit build, omit CC="cc -xarch=amd64".)</p>
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz<p>If configure complains about OpenSSL not working, you
321f88f4de9d60b5f846555b10f866348b7d598cjerenkrantz may have a 32/64-bit architecture mismatch. Or, you may have
6830e61f24984184ce3095c204935d06963dcc51nd incorrectly specified the path to OpenSSL (it should be the
6830e61f24984184ce3095c204935d06963dcc51nd same as the --prefix argument to the OpenSSL
6830e61f24984184ce3095c204935d06963dcc51nd Configure).</p>
6830e61f24984184ce3095c204935d06963dcc51nd</div>
6830e61f24984184ce3095c204935d06963dcc51nd<div class="sect3" lang="en">
85bf271a2a8d88736575e93504528639f5971f97nd<div class="titlepage"><div><div><h4 class="title">
85bf271a2a8d88736575e93504528639f5971f97nd<a name="id2638192"></a>Configuring BIND 9 for SoftHSM</h4></div></div></div>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<pre class="screen">
85bf271a2a8d88736575e93504528639f5971f97nd$ <strong class="userinput"><code>cd /bind9</code></strong>
5c457d20a708ef42b0824290d0feda1852a37493rederpj$ <strong class="userinput"><code>/configure --enable-threads \
5c457d20a708ef42b0824290d0feda1852a37493rederpj --with-openssl=/opt/pkcs11/usr \
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe --with-pkcs11=/opt/pkcs11/usr/lib/libpkcs11.so</code></strong>
5c457d20a708ef42b0824290d0feda1852a37493rederpj</pre>
a22d4a5da8c5167776b9e62737379cc9b857ef4drederpj</div>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>After configuring, run
a22d4a5da8c5167776b9e62737379cc9b857ef4drederpj "<span><strong class="command">make</strong></span>",
cde00ab9085ea6e93db4a27bf6fe9a9b6eda4addnd "<span><strong class="command">make test</strong></span>" and
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe "<span><strong class="command">make install</strong></span>".</p>
cde00ab9085ea6e93db4a27bf6fe9a9b6eda4addnd<p>(Note: If "make test" fails in the "pkcs11" system test, you may
cde00ab9085ea6e93db4a27bf6fe9a9b6eda4addnd have forgotten to set the SOFTHSM_CONF environment variable.)</p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe</div>
cde00ab9085ea6e93db4a27bf6fe9a9b6eda4addnd<div class="sect2" lang="en">
159d95df05b3100bbef7a60cb5f5d7d8d5a3328etrawick<div class="titlepage"><div><div><h3 class="title">
159d95df05b3100bbef7a60cb5f5d7d8d5a3328etrawick<a name="id2638240"></a>PKCS #11 Tools</h3></div></div></div>
159d95df05b3100bbef7a60cb5f5d7d8d5a3328etrawick<p>BIND 9 includes a minimal set of tools to operate the
159d95df05b3100bbef7a60cb5f5d7d8d5a3328etrawick HSM, including
59b910556d04c82e951d6c6f7a413ab8fed21467trawick <span><strong class="command">pkcs11-keygen</strong></span> to generate a new key pair
acba1dfc9d36dbd7d307769f0f7c74f776d2458btrawick within the HSM,
59b910556d04c82e951d6c6f7a413ab8fed21467trawick <span><strong class="command">pkcs11-list</strong></span> to list objects currently
59b910556d04c82e951d6c6f7a413ab8fed21467trawick available, and
59b910556d04c82e951d6c6f7a413ab8fed21467trawick <span><strong class="command">pkcs11-destroy</strong></span> to remove objects.</p>
9768955299008e29705461b314b763a79104e576nd<p>In UNIX/Linux builds, these tools are built only if BIND
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd 9 is configured with the --with-pkcs11 option. (NOTE: If
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton --with-pkcs11 is set to "yes", rather than to the path of the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton PKCS #11 provider, then the tools will be built but the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton provider will be left undefined. Use the -m option or the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton PKCS11_PROVIDER environment variable to specify the path to the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton provider.)</p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton</div>
03e310ef946842b4dfa718776c870d012fc9ec67striker<div class="sect2" lang="en">
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<div class="titlepage"><div><div><h3 class="title">
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<a name="id2638270"></a>Using the HSM</h3></div></div></div>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<p>First, we must set up the runtime environment so the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton OpenSSL and PKCS #11 libraries can be loaded:</p>
611d2f4e86b4eceb640a5301bd88a23cb459e5a8striker<pre class="screen">
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton$ <strong class="userinput"><code>export LD_LIBRARY_PATH=/opt/pkcs11/usr/lib:${LD_LIBRARY_PATH}</code></strong>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton</pre>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<p>When operating an AEP Keyper, it is also necessary to
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton specify the location of the "machine" file, which stores
f59888906d0566361498848fa95b4c416fad976cstriker information about the Keyper for use by PKCS #11 provider
6a3078c438bee65f22004ac65cd2eb4fa521bbfastriker library. If the machine file is in
6a3078c438bee65f22004ac65cd2eb4fa521bbfastriker <code class="filename">/opt/Keyper/PKCS11Provider/machine</code>,
6a3078c438bee65f22004ac65cd2eb4fa521bbfastriker use:</p>
6a3078c438bee65f22004ac65cd2eb4fa521bbfastriker<pre class="screen">
26acc990e97a62631a3654405d676b928a78ebbcstriker$ <strong class="userinput"><code>export KEYPER_LIBRARY_PATH=/opt/Keyper/PKCS11Provider</code></strong>
26acc990e97a62631a3654405d676b928a78ebbcstriker</pre>
29ecc0949b383793b24cdd0741cb86c02138ab36striker<p>These environment variables must be set whenever running
29ecc0949b383793b24cdd0741cb86c02138ab36striker any tool that uses the HSM, including
29ecc0949b383793b24cdd0741cb86c02138ab36striker <span><strong class="command">pkcs11-keygen</strong></span>,
29ecc0949b383793b24cdd0741cb86c02138ab36striker <span><strong class="command">pkcs11-list</strong></span>,
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe <span><strong class="command">pkcs11-destroy</strong></span>,
29ecc0949b383793b24cdd0741cb86c02138ab36striker <span><strong class="command">dnssec-keyfromlabel</strong></span>,
c97f8ff3a7479c838545de0c59770938b50ab6d3gstein <span><strong class="command">dnssec-signzone</strong></span>,
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe <span><strong class="command">dnssec-keygen</strong></span>(which will use the HSM for
c97f8ff3a7479c838545de0c59770938b50ab6d3gstein random number generation), and
6fb9d10c529c2be3bb1833b0eefdd27ba4df1610trawick <span><strong class="command">named</strong></span>.</p>
6fb9d10c529c2be3bb1833b0eefdd27ba4df1610trawick<p>We can now create and use keys in the HSM. In this case,
6fb9d10c529c2be3bb1833b0eefdd27ba4df1610trawick we will create a 2048 bit key and give it the label
6fb9d10c529c2be3bb1833b0eefdd27ba4df1610trawick "sample-ksk":</p>
6fb9d10c529c2be3bb1833b0eefdd27ba4df1610trawick<pre class="screen">
6fb9d10c529c2be3bb1833b0eefdd27ba4df1610trawick$ <strong class="userinput"><code>pkcs11-keygen -b 2048 -l sample-ksk</code></strong>
368a950bc36b428b737d079f77e8962c831f88aand</pre>
368a950bc36b428b737d079f77e8962c831f88aand<p>To confirm that the key exists:</p>
368a950bc36b428b737d079f77e8962c831f88aand<pre class="screen">
368a950bc36b428b737d079f77e8962c831f88aand$ <strong class="userinput"><code>pkcs11-list</code></strong>
9768955299008e29705461b314b763a79104e576ndEnter PIN:
1ead2314e821e9ac264ea35425e7d0816030e404stoddardobject[0]: handle 2147483658 class 3 label[8] 'sample-ksk' id[0]
9768955299008e29705461b314b763a79104e576ndobject[1]: handle 2147483657 class 2 label[8] 'sample-ksk' id[0]
9768955299008e29705461b314b763a79104e576nd</pre>
9768955299008e29705461b314b763a79104e576nd<p>Before using this key to sign a zone, we must create a
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton pair of BIND 9 key files. The "dnssec-keyfromlabel" utility
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton does this. In this case, we will be using the HSM key
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton "sample-ksk" as the key-signing key for "example.net":</p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<pre class="screen">
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton$ <strong class="userinput"><code>dnssec-keyfromlabel -l sample-ksk -f KSK example.net</code></strong>
1005ad40d72c4a1df2c0f1b95b770a4c43c49a47mjc</pre>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<p>The resulting K*.key and K*.private files can now be used
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton to sign the zone. Unlike normal K* files, which contain both
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton public and private key data, these files will contain only the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton public key data, plus an identifier for the private key which
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton remains stored within the HSM. The HSM handles signing with the
1005ad40d72c4a1df2c0f1b95b770a4c43c49a47mjc private key.</p>
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz<p>If you wish to generate a second key in the HSM for use
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz as a zone-signing key, follow the same procedure above, using a
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe different keylabel, a smaller key size, and omitting "-f KSK"
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz from the dnssec-keyfromlabel arguments:</p>
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz<pre class="screen">
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz$ <strong class="userinput"><code>pkcs11-keygen -b 1024 -l sample-zsk</code></strong>
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz$ <strong class="userinput"><code>dnssec-keyfromlabel -l sample-zsk example.net</code></strong>
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz</pre>
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz<p>Alternatively, you may prefer to generate a conventional
da5a84048552168ea64c3012573acd4de1434dcdjerenkrantz on-disk key, using dnssec-keygen:</p>
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz<pre class="screen">
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz$ <strong class="userinput"><code>dnssec-keygen example.net</code></strong>
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz</pre>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>This provides less security than an HSM key, but since
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz HSMs can be slow or cumbersome to use for security reasons, it
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz may be more efficient to reserve HSM keys for use in the less
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz frequent key-signing operation. The zone-signing key can be
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe rolled more frequently, if you wish, to compensate for a
19fdbc5566bf67dde644be9e8d38d62db4dd0ba5jerenkrantz reduction in key security.</p>
e874834efe9943668668c7fa498af3b3c7caffbdnd<p>Now you can sign the zone. (Note: If not using the -S
e874834efe9943668668c7fa498af3b3c7caffbdnd option to
e874834efe9943668668c7fa498af3b3c7caffbdnd <span><strong class="command">dnssec-signzone</strong></span>, it will be necessary to add
e874834efe9943668668c7fa498af3b3c7caffbdnd the contents of both
e874834efe9943668668c7fa498af3b3c7caffbdnd <code class="filename">K*.key</code> files to the zone master file before
e874834efe9943668668c7fa498af3b3c7caffbdnd signing it.)</p>
e874834efe9943668668c7fa498af3b3c7caffbdnd<pre class="screen">
b617020883fa3b18bc9b5be5e896ceed79a7ff7fnd$ <strong class="userinput"><code>dnssec-signzone -S example.net</code></strong>
36f2369ee230c310fed3b600e9e99cf5770804a3wroweEnter PIN:
b617020883fa3b18bc9b5be5e896ceed79a7ff7fndVerifying the zone using the following algorithms:
38873f61704cbe5eadaa3fb9dca84a4bee1ae5d5wroweNSEC3RSASHA1.
38873f61704cbe5eadaa3fb9dca84a4bee1ae5d5wroweZone signing complete:
38873f61704cbe5eadaa3fb9dca84a4bee1ae5d5wroweAlgorithm: NSEC3RSASHA1: ZSKs: 1, KSKs: 1 active, 0 revoked, 0 stand-by
38873f61704cbe5eadaa3fb9dca84a4bee1ae5d5wroweexample.net.signed
38873f61704cbe5eadaa3fb9dca84a4bee1ae5d5wrowe</pre>
68a80326bd8b6f717ae0c44d4bb7273023aad1edwrowe</div>
68a80326bd8b6f717ae0c44d4bb7273023aad1edwrowe<div class="sect2" lang="en">
68a80326bd8b6f717ae0c44d4bb7273023aad1edwrowe<div class="titlepage"><div><div><h3 class="title">
68a80326bd8b6f717ae0c44d4bb7273023aad1edwrowe<a name="id2638469"></a>Specifying the engine on the command line</h3></div></div></div>
68a80326bd8b6f717ae0c44d4bb7273023aad1edwrowe<p>The OpenSSL engine can be specified in
68a80326bd8b6f717ae0c44d4bb7273023aad1edwrowe <span><strong class="command">named</strong></span> and all of the BIND
6838d0e05a193cb77265db36e3549201b3df57e6wrowe <span><strong class="command">dnssec-*</strong></span> tools by using the "-E
6838d0e05a193cb77265db36e3549201b3df57e6wrowe &lt;engine&gt;" command line option. If BIND 9 is built with
6838d0e05a193cb77265db36e3549201b3df57e6wrowe the --with-pkcs11 option, this option defaults to "pkcs11".
6838d0e05a193cb77265db36e3549201b3df57e6wrowe Specifying the engine will generally not be necessary unless
903c124068c87c957f1327de486017a19cccd348stoddard for some reason you wish to use a different OpenSSL
903c124068c87c957f1327de486017a19cccd348stoddard engine.</p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>If you wish to disable use of the "pkcs11" engine &#8212;
903c124068c87c957f1327de486017a19cccd348stoddard for troubleshooting purposes, or because the HSM is unavailable
732269e2780cb818c1b48aeffa0b432b0ce4ee5eaaron &#8212; set the engine to the empty string. For example:</p>
732269e2780cb818c1b48aeffa0b432b0ce4ee5eaaron<pre class="screen">
20aa030accab9a4df293294283fbe6a4ae961588trawick$ <strong class="userinput"><code>dnssec-signzone -E '' -S example.net</code></strong>
20aa030accab9a4df293294283fbe6a4ae961588trawick</pre>
20aa030accab9a4df293294283fbe6a4ae961588trawick<p>This causes
b617020883fa3b18bc9b5be5e896ceed79a7ff7fnd <span><strong class="command">dnssec-signzone</strong></span> to run as if it were compiled
e08b3783b570fdea39520da5e6c174394e956d17nd without the --with-pkcs11 option.</p>
e08b3783b570fdea39520da5e6c174394e956d17nd</div>
e08b3783b570fdea39520da5e6c174394e956d17nd<div class="sect2" lang="en">
e08b3783b570fdea39520da5e6c174394e956d17nd<div class="titlepage"><div><div><h3 class="title">
e08b3783b570fdea39520da5e6c174394e956d17nd<a name="id2638515"></a>Running named with automatic zone re-signing</h3></div></div></div>
e08b3783b570fdea39520da5e6c174394e956d17nd<p>If you want
e08b3783b570fdea39520da5e6c174394e956d17nd <span><strong class="command">named</strong></span> to dynamically re-sign zones using HSM
e08b3783b570fdea39520da5e6c174394e956d17nd keys, and/or to to sign new records inserted via nsupdate, then
e08b3783b570fdea39520da5e6c174394e956d17nd named must have access to the HSM PIN. This can be accomplished
e08b3783b570fdea39520da5e6c174394e956d17nd by placing the PIN into the openssl.cnf file (in the above
16de8ff78c533f06c64d5ab2b685953992ff8659thommay examples,
16de8ff78c533f06c64d5ab2b685953992ff8659thommay <code class="filename">/opt/pkcs11/usr/ssl/openssl.cnf</code>).</p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<p>The location of the openssl.cnf file can be overridden by
16de8ff78c533f06c64d5ab2b685953992ff8659thommay setting the OPENSSL_CONF environment variable before running
5aef954598e763eea457d204897a6a12d281755dtrawick named.</p>
5aef954598e763eea457d204897a6a12d281755dtrawick<p>Sample openssl.cnf:</p>
5aef954598e763eea457d204897a6a12d281755dtrawick<pre class="programlisting">
5aef954598e763eea457d204897a6a12d281755dtrawick openssl_conf = openssl_def
340e970018246649e86dd3ebbd34f4719e3ceaf7trawick [ openssl_def ]
340e970018246649e86dd3ebbd34f4719e3ceaf7trawick engines = engine_section
340e970018246649e86dd3ebbd34f4719e3ceaf7trawick [ engine_section ]
340e970018246649e86dd3ebbd34f4719e3ceaf7trawick pkcs11 = pkcs11_section
1360e9b0036040edfbcd2273ae18db83a93536detrawick [ pkcs11_section ]
1360e9b0036040edfbcd2273ae18db83a93536detrawick PIN = <em class="replaceable"><code>&lt;PLACE PIN HERE&gt;</code></em>
1360e9b0036040edfbcd2273ae18db83a93536detrawick</pre>
1360e9b0036040edfbcd2273ae18db83a93536detrawick<p>This will also allow the dnssec-* tools to access the HSM
1360e9b0036040edfbcd2273ae18db83a93536detrawick without PIN entry. (The pkcs11-* tools access the HSM directly,
1360e9b0036040edfbcd2273ae18db83a93536detrawick not via OpenSSL, so a PIN will still be required to use
c3f32ea297c5350948a0c4472c1ff8433ea4e6bastoddard them.)</p>
c3f32ea297c5350948a0c4472c1ff8433ea4e6bastoddard<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
c3f32ea297c5350948a0c4472c1ff8433ea4e6bastoddard<h3 class="title">Warning</h3>
c3f32ea297c5350948a0c4472c1ff8433ea4e6bastoddard<p>Placing the HSM's PIN in a text file in
6838d0e05a193cb77265db36e3549201b3df57e6wrowe this manner may reduce the security advantage of using an
c3f32ea297c5350948a0c4472c1ff8433ea4e6bastoddard HSM. Be sure this is what you want to do before configuring
946f7bd76a0dec6d67af79af56a8cff3cb6ef9c1nd OpenSSL in this way.</p>
946f7bd76a0dec6d67af79af56a8cff3cb6ef9c1nd</div>
946f7bd76a0dec6d67af79af56a8cff3cb6ef9c1nd</div>
946f7bd76a0dec6d67af79af56a8cff3cb6ef9c1nd</div>
8c038cdb417502a969599568ccc4020576d82a10nd<div class="sect1" lang="en">
8c038cdb417502a969599568ccc4020576d82a10nd<div class="titlepage"><div><div><h2 class="title" style="clear: both">
8c038cdb417502a969599568ccc4020576d82a10nd<a name="dlz-info"></a>DLZ (Dynamically Loadable Zones)</h2></div></div></div>
8c038cdb417502a969599568ccc4020576d82a10nd<p>
8c038cdb417502a969599568ccc4020576d82a10nd DLZ (Dynamically Loadable Zones) is an extention to BIND 9 that allows
8c038cdb417502a969599568ccc4020576d82a10nd zone data to be retrieved directly from an external database. There is
8c038cdb417502a969599568ccc4020576d82a10nd no required format or schema. DLZ drivers exist for several different
8c038cdb417502a969599568ccc4020576d82a10nd database backends including PostgreSQL, MySQL, and LDAP and can be
6838d0e05a193cb77265db36e3549201b3df57e6wrowe written for any other.
6838d0e05a193cb77265db36e3549201b3df57e6wrowe </p>
83938932cb2dbe320eda488799bb7a0c04156bcdake<p>
83938932cb2dbe320eda488799bb7a0c04156bcdake Historically, DLZ drivers had to be statically linked with the named
6838d0e05a193cb77265db36e3549201b3df57e6wrowe binary and were turned on via a configure option at compile time (for
6838d0e05a193cb77265db36e3549201b3df57e6wrowe example, <strong class="userinput"><code>"configure --with-dlz-ldap"</code></strong>).
6838d0e05a193cb77265db36e3549201b3df57e6wrowe Currently, the drivers provided in the BIND 9 tarball in
6838d0e05a193cb77265db36e3549201b3df57e6wrowe <code class="filename">contrib/dlz/drivers</code> are still linked this
6838d0e05a193cb77265db36e3549201b3df57e6wrowe way.
6fbf645df300ffa9c9693399571f2cd821af06fdtrawick </p>
6fbf645df300ffa9c9693399571f2cd821af06fdtrawick<p>
6fbf645df300ffa9c9693399571f2cd821af06fdtrawick In BIND 9.8 and higher, it is possible to link some DLZ modules
6fbf645df300ffa9c9693399571f2cd821af06fdtrawick dynamically at runtime, via the DLZ "dlopen" driver, which acts as a
6fbf645df300ffa9c9693399571f2cd821af06fdtrawick generic wrapper around a shared object implementing the DLZ API. The
c8ff8621370eb28a3f697a00bf5e6b3bc1a0d9f1minfrin "dlopen" driver is linked into named by default, so configure options
c8ff8621370eb28a3f697a00bf5e6b3bc1a0d9f1minfrin are no longer necessary when using these dynamically linkable drivers,
c8ff8621370eb28a3f697a00bf5e6b3bc1a0d9f1minfrin but are still needed for the older drivers in
c8ff8621370eb28a3f697a00bf5e6b3bc1a0d9f1minfrin <code class="filename">contrib/dlz/drivers</code>.
c8ff8621370eb28a3f697a00bf5e6b3bc1a0d9f1minfrin </p>
c8989f842c2ad4533950c13d99d3dfb099da0d67minfrin<p>
c8989f842c2ad4533950c13d99d3dfb099da0d67minfrin When the DLZ module provides data to named, it does so in text format.
c8989f842c2ad4533950c13d99d3dfb099da0d67minfrin The response is converted to DNS wire format by named. This
c8989f842c2ad4533950c13d99d3dfb099da0d67minfrin conversion, and the lack of any internal caching, places significant
97610ac677a5eda4a3bb366c5bb34a27eeb4288cminfrin limits on the query performance of DLZ modules. Consequently, DLZ is
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe not recommended for use on high-volume servers. However, it can be
97610ac677a5eda4a3bb366c5bb34a27eeb4288cminfrin used in a hidden master configuration, with slaves retrieving zone
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton updates via AXFR. (Note, however, that DLZ has no built-in support for
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton DNS notify; slaves are not automatically informed of changes to the
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton zones in the database.)
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton </p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<div class="sect2" lang="en">
6aa783d83f4304f664233d8252cb67116769676ewrowe<div class="titlepage"><div><div><h3 class="title">
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd<a name="id2572205"></a>Configuring DLZ</h3></div></div></div>
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd<p>
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd A DLZ database is configured with a <span><strong class="command">dlz</strong></span>
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd statement in <code class="filename">named.conf</code>:
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd </p>
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd<pre class="screen">
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd dlz example {
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd database "dlopen driver.so <code class="option">args</code>";
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd search yes;
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd };
761fb8d21084bd7b7eb590fbd54a925dfdf806bbnd </pre>
367cefc17f8dcfe65651c9c16cb3151589c6cecetrawick<p>
5d6ffa7b5c77dd4132ed6d7f0dd63548b1c3c1c9nd This specifies a DLZ module to search when answering queries; the
d8f54fe5534b61afa68100dddbe2eb98285d1100wrowe module is implemented in <code class="filename">driver.so</code> and is
d8f54fe5534b61afa68100dddbe2eb98285d1100wrowe loaded at runtime by the dlopen DLZ driver. Multiple
d8f54fe5534b61afa68100dddbe2eb98285d1100wrowe <span><strong class="command">dlz</strong></span> statements can be specified; when
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton answering a query, all DLZ modules with <code class="option">search</code>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton set to <code class="literal">yes</code> will be queried to find out if
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton they contain an answer for the query name; the best available
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton answer will be returned to the client.
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton </p>
87093daecb1e5ed178d1fa9773d2d7ffe8c96329jorton<p>
d8f54fe5534b61afa68100dddbe2eb98285d1100wrowe The <code class="option">search</code> option in the above example can be
18f36c8bdc74f9fd18739b9a154852c541b18900minfrin omitted, because <code class="literal">yes</code> is the default value.
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe </p>
18f36c8bdc74f9fd18739b9a154852c541b18900minfrin<p>
f1e73dbab9ba73d83c9ac8a13ab6150653bb71a9brianp If <code class="option">search</code> is set to <code class="literal">no</code>, then
f1e73dbab9ba73d83c9ac8a13ab6150653bb71a9brianp this DLZ module is <span class="emphasis"><em>not</em></span> searched for the best
7a01bcd2d59be7ec9ce55701c58054fa1c0bb5b6wrowe match when a query is received. Instead, zones in this DLZ must be
6aa783d83f4304f664233d8252cb67116769676ewrowe separately specified in a zone statement. This allows you to
6aa783d83f4304f664233d8252cb67116769676ewrowe configure a zone normally using standard zone option semantics,
6aa783d83f4304f664233d8252cb67116769676ewrowe but specify a different database back-end for storage of the
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe zone's data. For example, to implement NXDOMAIN redirection using
7a01bcd2d59be7ec9ce55701c58054fa1c0bb5b6wrowe a DLZ module for back-end storage of redirection rules:
9d71a9210ee030534400d37010f34e6a7d72b53fnd </p>
9d71a9210ee030534400d37010f34e6a7d72b53fnd<pre class="screen">
9d71a9210ee030534400d37010f34e6a7d72b53fnd dlz other {
9d71a9210ee030534400d37010f34e6a7d72b53fnd database "dlopen driver.so <code class="option">args</code>";
5d6ffa7b5c77dd4132ed6d7f0dd63548b1c3c1c9nd search no;
5d6ffa7b5c77dd4132ed6d7f0dd63548b1c3c1c9nd };
5d6ffa7b5c77dd4132ed6d7f0dd63548b1c3c1c9nd
5d6ffa7b5c77dd4132ed6d7f0dd63548b1c3c1c9nd zone "." {
5d6ffa7b5c77dd4132ed6d7f0dd63548b1c3c1c9nd type redirect;
144b1e2ebb48b2878017a8ac9a4cad1e771bc1b6stoddard dlz other;
144b1e2ebb48b2878017a8ac9a4cad1e771bc1b6stoddard };
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe </pre>
74b84dd6e146edc93cf1b3200e411bfc581f7c36nd</div>
143a04461642dea548a4bebdb302f5e411528a14trawick<div class="sect2" lang="en">
143a04461642dea548a4bebdb302f5e411528a14trawick<div class="titlepage"><div><div><h3 class="title">
143a04461642dea548a4bebdb302f5e411528a14trawick<a name="id2610643"></a>Sample DLZ Driver</h3></div></div></div>
ebecc16986604cce1369d5075eff65032e3dd0deianh<p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe For guidance in implementation of DLZ modules, the directory
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe <code class="filename">contrib/dlz/example</code> contains a basic
ebecc16986604cce1369d5075eff65032e3dd0deianh dynamically-linkable DLZ module--i.e., one which can be
ebecc16986604cce1369d5075eff65032e3dd0deianh loaded at runtime by the "dlopen" DLZ driver.
ebecc16986604cce1369d5075eff65032e3dd0deianh The example sets up a single zone, whose name is passed
ebecc16986604cce1369d5075eff65032e3dd0deianh to the module as an argument in the <span><strong class="command">dlz</strong></span>
ebecc16986604cce1369d5075eff65032e3dd0deianh statement:
7a2b9ea4788ea59d81b9e84192e4b90a9a0da875wrowe </p>
7a2b9ea4788ea59d81b9e84192e4b90a9a0da875wrowe<pre class="screen">
7a2b9ea4788ea59d81b9e84192e4b90a9a0da875wrowe dlz other {
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe database "dlopen driver.so example.nil";
7a2b9ea4788ea59d81b9e84192e4b90a9a0da875wrowe };
d225a894172ec361d2c6791638bacf604a8c6fa4nd </pre>
d225a894172ec361d2c6791638bacf604a8c6fa4nd<p>
d225a894172ec361d2c6791638bacf604a8c6fa4nd In the above example, the module is configured to create a zone
d225a894172ec361d2c6791638bacf604a8c6fa4nd "example.nil", which can answer queries and AXFR requests, and
d225a894172ec361d2c6791638bacf604a8c6fa4nd accept DDNS updates. At runtime, prior to any updates, the zone
d225a894172ec361d2c6791638bacf604a8c6fa4nd contains an SOA, NS, and a single A record at the apex:
d225a894172ec361d2c6791638bacf604a8c6fa4nd </p>
70f28b17978da5478a97843ab7cbcb4baf7a8711nd<pre class="screen">
70f28b17978da5478a97843ab7cbcb4baf7a8711nd example.nil. 3600 IN SOA example.nil. hostmaster.example.nil. (
70f28b17978da5478a97843ab7cbcb4baf7a8711nd 123 900 600 86400 3600
70f28b17978da5478a97843ab7cbcb4baf7a8711nd )
ac539bd6714277d9ce7c39361de4cc11d1fb8eadnd example.nil. 3600 IN NS example.nil.
ac539bd6714277d9ce7c39361de4cc11d1fb8eadnd example.nil. 1800 IN A 10.53.0.1
ac539bd6714277d9ce7c39361de4cc11d1fb8eadnd </pre>
f5208b93c14accca0cd5f5acb042332b20172fb1nd<p>
f5208b93c14accca0cd5f5acb042332b20172fb1nd The sample driver is capable of retrieving information about the
f5208b93c14accca0cd5f5acb042332b20172fb1nd querying client, and altering its response on the basis of this
d8f54fe5534b61afa68100dddbe2eb98285d1100wrowe information. To demonstrate this feature, the example driver
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes responds to queries for "source-addr.<code class="option">zonename</code>&gt;/TXT"
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes with the source address of the query. Note, however, that this
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes record will *not* be included in AXFR or ANY responses. Normally,
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes this feature would be used to alter responses in some other fashion,
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes e.g., by providing different address records for a particular name
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes depending on the network from which the query arrived.
1125f364c5cb4fd9bff71e89b5d4cbf551590035bnicholes </p>
9d999c5deeddad9211695fc736a845afda6a2e95wrowe<p>
9d999c5deeddad9211695fc736a845afda6a2e95wrowe Documentation of the DLZ module API can be found in
9d999c5deeddad9211695fc736a845afda6a2e95wrowe <code class="filename">contrib/dlz/example/README</code>. This directory also
9d999c5deeddad9211695fc736a845afda6a2e95wrowe contains the header file <code class="filename">dlz_minimal.h</code>, which
f19141958ebbfa8feb78e27007b4023d710d1c7etrawick defines the API and should be included by any dynamically-linkable
f19141958ebbfa8feb78e27007b4023d710d1c7etrawick DLZ module.
f19141958ebbfa8feb78e27007b4023d710d1c7etrawick </p>
f19141958ebbfa8feb78e27007b4023d710d1c7etrawick</div>
3ac9911bdb9c066a068041218d5b05bc851340bdtrawick</div>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<div class="sect1" lang="en">
3ac9911bdb9c066a068041218d5b05bc851340bdtrawick<div class="titlepage"><div><div><h2 class="title" style="clear: both">
c5c445b5614e4d5040d3c0994d2456f1ac8cb9b5jerenkrantz<a name="id2572956"></a>IPv6 Support in <acronym class="acronym">BIND</acronym> 9</h2></div></div></div>
c5c445b5614e4d5040d3c0994d2456f1ac8cb9b5jerenkrantz<p>
c5c445b5614e4d5040d3c0994d2456f1ac8cb9b5jerenkrantz <acronym class="acronym">BIND</acronym> 9 fully supports all currently
c5c445b5614e4d5040d3c0994d2456f1ac8cb9b5jerenkrantz defined forms of IPv6 name to address and address to name
c5c445b5614e4d5040d3c0994d2456f1ac8cb9b5jerenkrantz lookups. It will also use IPv6 addresses to make queries when
c5c445b5614e4d5040d3c0994d2456f1ac8cb9b5jerenkrantz running on an IPv6 capable system.
5541a81e194dc99521c0ecf904a940b0b65a93f2nd </p>
5541a81e194dc99521c0ecf904a940b0b65a93f2nd<p>
5541a81e194dc99521c0ecf904a940b0b65a93f2nd For forward lookups, <acronym class="acronym">BIND</acronym> 9 supports
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe only AAAA records. RFC 3363 deprecated the use of A6 records,
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe and client-side support for A6 records was accordingly removed
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe from <acronym class="acronym">BIND</acronym> 9.
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe However, authoritative <acronym class="acronym">BIND</acronym> 9 name servers still
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe load zone files containing A6 records correctly, answer queries
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe for A6 records, and accept zone transfer for a zone containing A6
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe records.
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe </p>
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe<p>
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe For IPv6 reverse lookups, <acronym class="acronym">BIND</acronym> 9 supports
f16b2c3124a11bff93724342099e1afdb8145917bnicholes the traditional "nibble" format used in the
f16b2c3124a11bff93724342099e1afdb8145917bnicholes <span class="emphasis"><em>ip6.arpa</em></span> domain, as well as the older, deprecated
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe <span class="emphasis"><em>ip6.int</em></span> domain.
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe Older versions of <acronym class="acronym">BIND</acronym> 9
60736084c3e45fe7ece48483188e58b0f9e3a36bwrowe supported the "binary label" (also known as "bitstring") format,
f16b2c3124a11bff93724342099e1afdb8145917bnicholes but support of binary labels has been completely removed per
d584e3b7a33da68233e7ac403213b436b402f5bend RFC 3363.
d584e3b7a33da68233e7ac403213b436b402f5bend Many applications in <acronym class="acronym">BIND</acronym> 9 do not understand
d584e3b7a33da68233e7ac403213b436b402f5bend the binary label format at all any more, and will return an
d584e3b7a33da68233e7ac403213b436b402f5bend error if given.
d584e3b7a33da68233e7ac403213b436b402f5bend In particular, an authoritative <acronym class="acronym">BIND</acronym> 9
d584e3b7a33da68233e7ac403213b436b402f5bend name server will not load a zone file containing binary labels.
d584e3b7a33da68233e7ac403213b436b402f5bend </p>
d584e3b7a33da68233e7ac403213b436b402f5bend<p>
d584e3b7a33da68233e7ac403213b436b402f5bend For an overview of the format and structure of IPv6 addresses,
d584e3b7a33da68233e7ac403213b436b402f5bend see <a href="Bv9ARM.ch09.html#ipv6addresses" title="IPv6 addresses (AAAA)">the section called &#8220;IPv6 addresses (AAAA)&#8221;</a>.
d584e3b7a33da68233e7ac403213b436b402f5bend </p>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<div class="sect2" lang="en">
d584e3b7a33da68233e7ac403213b436b402f5bend<div class="titlepage"><div><div><h3 class="title">
d584e3b7a33da68233e7ac403213b436b402f5bend<a name="id2573086"></a>Address Lookups Using AAAA Records</h3></div></div></div>
d584e3b7a33da68233e7ac403213b436b402f5bend<p>
d584e3b7a33da68233e7ac403213b436b402f5bend The IPv6 AAAA record is a parallel to the IPv4 A record,
d584e3b7a33da68233e7ac403213b436b402f5bend and, unlike the deprecated A6 record, specifies the entire
d584e3b7a33da68233e7ac403213b436b402f5bend IPv6 address in a single record. For example,
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe </p>
d584e3b7a33da68233e7ac403213b436b402f5bend<pre class="programlisting">
3e49fe84a5024d831ffb14697747c5948821f958trawick$ORIGIN example.com.
3e49fe84a5024d831ffb14697747c5948821f958trawickhost 3600 IN AAAA 2001:db8::1
3e49fe84a5024d831ffb14697747c5948821f958trawick</pre>
5610fc134df70e725bcdef518cc93de70261eb1dnd<p>
5610fc134df70e725bcdef518cc93de70261eb1dnd Use of IPv4-in-IPv6 mapped addresses is not recommended.
5610fc134df70e725bcdef518cc93de70261eb1dnd If a host has an IPv4 address, use an A record, not
5610fc134df70e725bcdef518cc93de70261eb1dnd a AAAA, with <code class="literal">::ffff:192.168.42.1</code> as
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick the address.
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick </p>
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick</div>
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick<div class="sect2" lang="en">
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick<div class="titlepage"><div><div><h3 class="title">
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick<a name="id2573176"></a>Address to Name Lookups Using Nibble Format</h3></div></div></div>
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick<p>
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick When looking up an address in nibble format, the address
965680cd7c050ec8c8c751ffdbaf19c91213d562trawick components are simply reversed, just as in IPv4, and
52d61f96a186861d991583851218e15ea16f0abetrawick <code class="literal">ip6.arpa.</code> is appended to the
52d61f96a186861d991583851218e15ea16f0abetrawick resulting name.
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe For example, the following would provide reverse name lookup for
52d61f96a186861d991583851218e15ea16f0abetrawick a host with address
4fa5f4378779a06834ec5efa44810f93741c5f27wrowe <code class="literal">2001:db8::1</code>.
4fa5f4378779a06834ec5efa44810f93741c5f27wrowe </p>
4fa5f4378779a06834ec5efa44810f93741c5f27wrowe<pre class="programlisting">
4fa5f4378779a06834ec5efa44810f93741c5f27wrowe$ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
6838d0e05a193cb77265db36e3549201b3df57e6wrowe1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 14400 IN PTR (
74b84dd6e146edc93cf1b3200e411bfc581f7c36nd host.example.com. )
74b84dd6e146edc93cf1b3200e411bfc581f7c36nd</pre>
74b84dd6e146edc93cf1b3200e411bfc581f7c36nd</div>
11e365512cbf021726cd3ec3d80743f408170ff9stoddard</div>
11e365512cbf021726cd3ec3d80743f408170ff9stoddard</div>
11e365512cbf021726cd3ec3d80743f408170ff9stoddard<div class="navfooter">
11e365512cbf021726cd3ec3d80743f408170ff9stoddard<hr>
11e365512cbf021726cd3ec3d80743f408170ff9stoddard<table width="100%" summary="Navigation footer">
367cefc17f8dcfe65651c9c16cb3151589c6cecetrawick<tr>
2774f23eee36fdb1b30a8213bbcabe5336175e54jwoolley<td width="40%" align="left">
2774f23eee36fdb1b30a8213bbcabe5336175e54jwoolley<a accesskey="p" href="Bv9ARM.ch03.html">Prev</a>�</td>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe<td width="20%" align="center">�</td>
2774f23eee36fdb1b30a8213bbcabe5336175e54jwoolley<td width="40%" align="right">�<a accesskey="n" href="Bv9ARM.ch05.html">Next</a>
1944ddbbad413b60307d66081b022a3eee5f04cfbnicholes</td>
1944ddbbad413b60307d66081b022a3eee5f04cfbnicholes</tr>
1944ddbbad413b60307d66081b022a3eee5f04cfbnicholes<tr>
1944ddbbad413b60307d66081b022a3eee5f04cfbnicholes<td width="40%" align="left" valign="top">Chapter�3.�Name Server Configuration�</td>
3b1dc8f8f153d7167da9e64ab44f3e90f486a458wrowe<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
3b1dc8f8f153d7167da9e64ab44f3e90f486a458wrowe<td width="40%" align="right" valign="top">�Chapter�5.�The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</td>
3b1dc8f8f153d7167da9e64ab44f3e90f486a458wrowe</tr>
3b1dc8f8f153d7167da9e64ab44f3e90f486a458wrowe</table>
2404b81d39a1a539f980d4808d52d23997a9e006nd</div>
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe</body>
2404b81d39a1a539f980d4808d52d23997a9e006nd</html>
a3754e9d2edd5758f94fd743b9cf9f814be80383nd