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-2010 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.22.44.4 2010/01/15 23:47:33 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>
46 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
53 <holder>Internet Software Consortium.</holder>
59 <command>dnssec-keygen</command>
60 <arg choice="req">-a <replaceable class="parameter">algorithm</replaceable></arg>
61 <arg choice="req">-b <replaceable class="parameter">keysize</replaceable></arg>
62 <arg choice="req">-n <replaceable class="parameter">nametype</replaceable></arg>
63 <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
64 <arg><option>-e</option></arg>
65 <arg><option>-f <replaceable class="parameter">flag</replaceable></option></arg>
66 <arg><option>-g <replaceable class="parameter">generator</replaceable></option></arg>
67 <arg><option>-h</option></arg>
68 <arg><option>-k</option></arg>
69 <arg><option>-p <replaceable class="parameter">protocol</replaceable></option></arg>
70 <arg><option>-r <replaceable class="parameter">randomdev</replaceable></option></arg>
71 <arg><option>-s <replaceable class="parameter">strength</replaceable></option></arg>
72 <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
73 <arg><option>-v <replaceable class="parameter">level</replaceable></option></arg>
74 <arg choice="req">name</arg>
79 <title>DESCRIPTION</title>
80 <para><command>dnssec-keygen</command>
81 generates keys for DNSSEC (Secure DNS), as defined in RFC 2535
82 and RFC 4034. It can also generate keys for use with
83 TSIG (Transaction Signatures), as defined in RFC 2845.
86 The <option>name</option> of the key is specified on the command
87 line. For DNSSEC keys, this must match the name of the zone for
88 which the key is being generated.
93 <title>OPTIONS</title>
97 <term>-a <replaceable class="parameter">algorithm</replaceable></term>
100 Selects the cryptographic algorithm. For DNSSEC keys, the value
101 of <option>algorithm</option> must be one of RSAMD5, RSASHA1,
102 DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256 or RSASHA512.
103 For TSIG/TKEY, the value must
104 be DH (Diffie Hellman), HMAC-MD5, HMAC-SHA1, HMAC-SHA224,
105 HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512. These values are
109 Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
110 algorithm, and DSA is recommended. For TSIG, HMAC-MD5 is
114 Note 2: HMAC-MD5 and DH automatically set the -k flag.
120 <term>-b <replaceable class="parameter">keysize</replaceable></term>
123 Specifies the number of bits in the key. The choice of key
124 size depends on the algorithm used. RSA keys must be
125 between 512 and 2048 bits. Diffie Hellman keys must be between
126 128 and 4096 bits. DSA keys must be between 512 and 1024
127 bits and an exact multiple of 64. HMAC keys must be
128 between 1 and 512 bits.
134 <term>-n <replaceable class="parameter">nametype</replaceable></term>
137 Specifies the owner type of the key. The value of
138 <option>nametype</option> must either be ZONE (for a DNSSEC
139 zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with
141 USER (for a key associated with a user(KEY)) or OTHER (DNSKEY).
142 These values are case insensitive. Defaults to ZONE for DNSKEY
149 <term>-c <replaceable class="parameter">class</replaceable></term>
152 Indicates that the DNS record containing the key should have
153 the specified class. If not specified, class IN is used.
162 If generating an RSAMD5/RSASHA1 key, use a large exponent.
168 <term>-f <replaceable class="parameter">flag</replaceable></term>
171 Set the specified flag in the flag field of the KEY/DNSKEY record.
172 The only recognized flag is KSK (Key Signing Key) DNSKEY.
178 <term>-g <replaceable class="parameter">generator</replaceable></term>
181 If generating a Diffie Hellman key, use this generator.
182 Allowed values are 2 and 5. If no generator
183 is specified, a known prime from RFC 2539 will be used
184 if possible; otherwise the default is 2.
193 Prints a short summary of the options and arguments to
194 <command>dnssec-keygen</command>.
203 Generate KEY records rather than DNSKEY records.
209 <term>-p <replaceable class="parameter">protocol</replaceable></term>
212 Sets the protocol value for the generated key. The protocol
213 is a number between 0 and 255. The default is 3 (DNSSEC).
214 Other possible values for this argument are listed in
215 RFC 2535 and its successors.
221 <term>-r <replaceable class="parameter">randomdev</replaceable></term>
224 Specifies the source of randomness. If the operating
225 system does not provide a <filename>/dev/random</filename>
226 or equivalent device, the default source of randomness
227 is keyboard input. <filename>randomdev</filename>
229 the name of a character device or file containing random
230 data to be used instead of the default. The special value
231 <filename>keyboard</filename> indicates that keyboard
232 input should be used.
238 <term>-s <replaceable class="parameter">strength</replaceable></term>
241 Specifies the strength value of the key. The strength is
242 a number between 0 and 15, and currently has no defined
249 <term>-t <replaceable class="parameter">type</replaceable></term>
252 Indicates the use of the key. <option>type</option> must be
253 one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default
254 is AUTHCONF. AUTH refers to the ability to authenticate
255 data, and CONF the ability to encrypt data.
261 <term>-v <replaceable class="parameter">level</replaceable></term>
264 Sets the debugging level.
273 <title>GENERATED KEYS</title>
275 When <command>dnssec-keygen</command> completes
277 it prints a string of the form <filename>Knnnn.+aaa+iiiii</filename>
278 to the standard output. This is an identification string for
279 the key it has generated.
283 <para><filename>nnnn</filename> is the key name.
287 <para><filename>aaa</filename> is the numeric representation
293 <para><filename>iiiii</filename> is the key identifier (or
298 <para><command>dnssec-keygen</command>
299 creates two files, with names based
300 on the printed string. <filename>Knnnn.+aaa+iiiii.key</filename>
301 contains the public key, and
302 <filename>Knnnn.+aaa+iiiii.private</filename> contains the
307 The <filename>.key</filename> file contains a DNS KEY record
309 can be inserted into a zone file (directly or with a $INCLUDE
313 The <filename>.private</filename> file contains
315 fields. For obvious security reasons, this file does not have
316 general read permission.
319 Both <filename>.key</filename> and <filename>.private</filename>
320 files are generated for symmetric encryption algorithms such as
321 HMAC-MD5, even though the public and private key are equivalent.
326 <title>EXAMPLE</title>
328 To generate a 768-bit DSA key for the domain
329 <userinput>example.com</userinput>, the following command would be
332 <para><userinput>dnssec-keygen -a DSA -b 768 -n ZONE example.com</userinput>
335 The command would print a string of the form:
337 <para><userinput>Kexample.com.+003+26160</userinput>
340 In this example, <command>dnssec-keygen</command> creates
341 the files <filename>Kexample.com.+003+26160.key</filename>
343 <filename>Kexample.com.+003+26160.private</filename>.
348 <title>SEE ALSO</title>
350 <refentrytitle>dnssec-signzone</refentrytitle><manvolnum>8</manvolnum>
352 <citetitle>BIND 9 Administrator Reference Manual</citetitle>,
353 <citetitle>RFC 2539</citetitle>,
354 <citetitle>RFC 2845</citetitle>,
355 <citetitle>RFC 4034</citetitle>.
360 <title>AUTHOR</title>
361 <para><corpauthor>Internet Systems Consortium</corpauthor>