1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3 [<!ENTITY mdash "—">]>
5 - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
6 - Copyright (C) 2000-2003 Internet Software Consortium.
8 - Permission to use, copy, modify, and/or distribute this software for any
9 - purpose with or without fee is hereby granted, provided that the above
10 - copyright notice and this permission notice appear in all copies.
12 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14 - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18 - PERFORMANCE OF THIS SOFTWARE.
21 <!-- $Id: dnssec-keygen.docbook,v 1.7.18.11 2007/08/28 07:20:00 tbox Exp $ -->
22 <refentry id="man.dnssec-keygen">
24 <date>June 30, 2000</date>
28 <refentrytitle><application>dnssec-keygen</application></refentrytitle>
29 <manvolnum>8</manvolnum>
30 <refmiscinfo>BIND9</refmiscinfo>
34 <refname><application>dnssec-keygen</application></refname>
35 <refpurpose>DNSSEC key generation tool</refpurpose>
43 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
50 <holder>Internet Software Consortium.</holder>
56 <command>dnssec-keygen</command>
57 <arg choice="req">-a <replaceable class="parameter">algorithm</replaceable></arg>
58 <arg choice="req">-b <replaceable class="parameter">keysize</replaceable></arg>
59 <arg choice="req">-n <replaceable class="parameter">nametype</replaceable></arg>
60 <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
61 <arg><option>-e</option></arg>
62 <arg><option>-f <replaceable class="parameter">flag</replaceable></option></arg>
63 <arg><option>-g <replaceable class="parameter">generator</replaceable></option></arg>
64 <arg><option>-h</option></arg>
65 <arg><option>-k</option></arg>
66 <arg><option>-p <replaceable class="parameter">protocol</replaceable></option></arg>
67 <arg><option>-r <replaceable class="parameter">randomdev</replaceable></option></arg>
68 <arg><option>-s <replaceable class="parameter">strength</replaceable></option></arg>
69 <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
70 <arg><option>-v <replaceable class="parameter">level</replaceable></option></arg>
71 <arg choice="req">name</arg>
76 <title>DESCRIPTION</title>
77 <para><command>dnssec-keygen</command>
78 generates keys for DNSSEC (Secure DNS), as defined in RFC 2535
79 and RFC 4034. It can also generate keys for use with
80 TSIG (Transaction Signatures), as defined in RFC 2845.
85 <title>OPTIONS</title>
89 <term>-a <replaceable class="parameter">algorithm</replaceable></term>
92 Selects the cryptographic algorithm. The value of
93 <option>algorithm</option> must be one of RSAMD5 (RSA) or RSASHA1,
94 DSA, DH (Diffie Hellman), or HMAC-MD5. These values
98 Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
100 and DSA is recommended. For TSIG, HMAC-MD5 is mandatory.
103 Note 2: HMAC-MD5 and DH automatically set the -k flag.
109 <term>-b <replaceable class="parameter">keysize</replaceable></term>
112 Specifies the number of bits in the key. The choice of key
113 size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be
115 512 and 2048 bits. Diffie Hellman keys must be between
116 128 and 4096 bits. DSA keys must be between 512 and 1024
117 bits and an exact multiple of 64. HMAC-MD5 keys must be
118 between 1 and 512 bits.
124 <term>-n <replaceable class="parameter">nametype</replaceable></term>
127 Specifies the owner type of the key. The value of
128 <option>nametype</option> must either be ZONE (for a DNSSEC
129 zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with
131 USER (for a key associated with a user(KEY)) or OTHER (DNSKEY).
139 <term>-c <replaceable class="parameter">class</replaceable></term>
142 Indicates that the DNS record containing the key should have
143 the specified class. If not specified, class IN is used.
152 If generating an RSAMD5/RSASHA1 key, use a large exponent.
158 <term>-f <replaceable class="parameter">flag</replaceable></term>
161 Set the specified flag in the flag field of the KEY/DNSKEY record.
162 The only recognized flag is KSK (Key Signing Key) DNSKEY.
168 <term>-g <replaceable class="parameter">generator</replaceable></term>
171 If generating a Diffie Hellman key, use this generator.
172 Allowed values are 2 and 5. If no generator
173 is specified, a known prime from RFC 2539 will be used
174 if possible; otherwise the default is 2.
183 Prints a short summary of the options and arguments to
184 <command>dnssec-keygen</command>.
193 Generate KEY records rather than DNSKEY records.
199 <term>-p <replaceable class="parameter">protocol</replaceable></term>
202 Sets the protocol value for the generated key. The protocol
203 is a number between 0 and 255. The default is 3 (DNSSEC).
204 Other possible values for this argument are listed in
205 RFC 2535 and its successors.
211 <term>-r <replaceable class="parameter">randomdev</replaceable></term>
214 Specifies the source of randomness. If the operating
215 system does not provide a <filename>/dev/random</filename>
216 or equivalent device, the default source of randomness
217 is keyboard input. <filename>randomdev</filename>
219 the name of a character device or file containing random
220 data to be used instead of the default. The special value
221 <filename>keyboard</filename> indicates that keyboard
222 input should be used.
228 <term>-s <replaceable class="parameter">strength</replaceable></term>
231 Specifies the strength value of the key. The strength is
232 a number between 0 and 15, and currently has no defined
239 <term>-t <replaceable class="parameter">type</replaceable></term>
242 Indicates the use of the key. <option>type</option> must be
243 one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default
244 is AUTHCONF. AUTH refers to the ability to authenticate
245 data, and CONF the ability to encrypt data.
251 <term>-v <replaceable class="parameter">level</replaceable></term>
254 Sets the debugging level.
263 <title>GENERATED KEYS</title>
265 When <command>dnssec-keygen</command> completes
267 it prints a string of the form <filename>Knnnn.+aaa+iiiii</filename>
268 to the standard output. This is an identification string for
269 the key it has generated.
273 <para><filename>nnnn</filename> is the key name.
277 <para><filename>aaa</filename> is the numeric representation
283 <para><filename>iiiii</filename> is the key identifier (or
288 <para><command>dnssec-keygen</command>
289 creates two files, with names based
290 on the printed string. <filename>Knnnn.+aaa+iiiii.key</filename>
291 contains the public key, and
292 <filename>Knnnn.+aaa+iiiii.private</filename> contains the
297 The <filename>.key</filename> file contains a DNS KEY record
299 can be inserted into a zone file (directly or with a $INCLUDE
303 The <filename>.private</filename> file contains
305 fields. For obvious security reasons, this file does not have
306 general read permission.
309 Both <filename>.key</filename> and <filename>.private</filename>
310 files are generated for symmetric encryption algorithms such as
311 HMAC-MD5, even though the public and private key are equivalent.
316 <title>EXAMPLE</title>
318 To generate a 768-bit DSA key for the domain
319 <userinput>example.com</userinput>, the following command would be
322 <para><userinput>dnssec-keygen -a DSA -b 768 -n ZONE example.com</userinput>
325 The command would print a string of the form:
327 <para><userinput>Kexample.com.+003+26160</userinput>
330 In this example, <command>dnssec-keygen</command> creates
331 the files <filename>Kexample.com.+003+26160.key</filename>
333 <filename>Kexample.com.+003+26160.private</filename>.
338 <title>SEE ALSO</title>
340 <refentrytitle>dnssec-signzone</refentrytitle><manvolnum>8</manvolnum>
342 <citetitle>BIND 9 Administrator Reference Manual</citetitle>,
343 <citetitle>RFC 2535</citetitle>,
344 <citetitle>RFC 2845</citetitle>,
345 <citetitle>RFC 2539</citetitle>.
350 <title>AUTHOR</title>
351 <para><corpauthor>Internet Systems Consortium</corpauthor>