1DNSSEC-KEYGEN(8)                     BIND9                    DNSSEC-KEYGEN(8)
2
3
4

NAME

6       dnssec-keygen - DNSSEC key generation tool
7

SYNOPSIS

9       dnssec-keygen [-a algorithm] [-b keysize] [-n nametype] [-3]
10                     [-A date/offset] [-C] [-c class] [-D date/offset]
11                     [-E engine] [-e] [-f flag] [-G] [-g generator] [-h]
12                     [-I date/offset] [-i interval] [-K directory] [-k]
13                     [-P date/offset] [-p protocol] [-q] [-R date/offset]
14                     [-r randomdev] [-S key] [-s strength] [-t type]
15                     [-v level] [-z] {name}
16

DESCRIPTION

18       dnssec-keygen generates keys for DNSSEC (Secure DNS), as defined in RFC
19       2535 and RFC 4034. It can also generate keys for use with TSIG
20       (Transaction Signatures) as defined in RFC 2845, or TKEY (Transaction
21       Key) as defined in RFC 2930.
22
23       The name of the key is specified on the command line. For DNSSEC keys,
24       this must match the name of the zone for which the key is being
25       generated.
26

OPTIONS

28       -a algorithm
29           Selects the cryptographic algorithm. For DNSSEC keys, the value of
30           algorithm must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1,
31           NSEC3DSA, RSASHA256, RSASHA512 or ECCGOST. For TSIG/TKEY, the value
32           must be DH (Diffie Hellman), HMAC-MD5, HMAC-SHA1, HMAC-SHA224,
33           HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512. These values are case
34           insensitive.
35
36           If no algorithm is specified, then RSASHA1 will be used by default,
37           unless the -3 option is specified, in which case NSEC3RSASHA1 will
38           be used instead. (If -3 is used and an algorithm is specified, that
39           algorithm will be checked for compatibility with NSEC3.)
40
41           Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
42           algorithm, and DSA is recommended. For TSIG, HMAC-MD5 is mandatory.
43
44           Note 2: DH, HMAC-MD5, and HMAC-SHA1 through HMAC-SHA512
45           automatically set the -T KEY option.
46
47       -b keysize
48           Specifies the number of bits in the key. The choice of key size
49           depends on the algorithm used. RSA keys must be between 512 and
50           2048 bits. Diffie Hellman keys must be between 128 and 4096 bits.
51           DSA keys must be between 512 and 1024 bits and an exact multiple of
52           64. HMAC keys must be between 1 and 512 bits.
53
54           The key size does not need to be specified if using a default
55           algorithm. The default key size is 1024 bits for zone signing keys
56           (ZSK's) and 2048 bits for key signing keys (KSK's, generated with
57           -f KSK). However, if an algorithm is explicitly specified with the
58           -a, then there is no default key size, and the -b must be used.
59
60       -n nametype
61           Specifies the owner type of the key. The value of nametype must
62           either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY
63           (for a key associated with a host (KEY)), USER (for a key
64           associated with a user(KEY)) or OTHER (DNSKEY). These values are
65           case insensitive. Defaults to ZONE for DNSKEY generation.
66
67       -3
68           Use an NSEC3-capable algorithm to generate a DNSSEC key. If this
69           option is used and no algorithm is explicitly set on the command
70           line, NSEC3RSASHA1 will be used by default. Note that RSASHA256,
71           RSASHA512 and ECCGOST algorithms are NSEC3-capable.
72
73       -C
74           Compatibility mode: generates an old-style key, without any
75           metadata. By default, dnssec-keygen will include the key's creation
76           date in the metadata stored with the private key, and other dates
77           may be set there as well (publication date, activation date, etc).
78           Keys that include this data may be incompatible with older versions
79           of BIND; the -C option suppresses them.
80
81       -c class
82           Indicates that the DNS record containing the key should have the
83           specified class. If not specified, class IN is used.
84
85       -E engine
86           Uses a crypto hardware (OpenSSL engine) for random number and, when
87           supported, key generation. When compiled with PKCS#11 support it
88           defaults to pkcs11; the empty name resets it to no engine.
89
90       -e
91           If generating an RSAMD5/RSASHA1 key, use a large exponent.
92
93       -f flag
94           Set the specified flag in the flag field of the KEY/DNSKEY record.
95           The only recognized flags are KSK (Key Signing Key) and REVOKE.
96
97       -G
98           Generate a key, but do not publish it or sign with it. This option
99           is incompatible with -P and -A.
100
101       -g generator
102           If generating a Diffie Hellman key, use this generator. Allowed
103           values are 2 and 5. If no generator is specified, a known prime
104           from RFC 2539 will be used if possible; otherwise the default is 2.
105
106       -h
107           Prints a short summary of the options and arguments to
108           dnssec-keygen.
109
110       -K directory
111           Sets the directory in which the key files are to be written.
112
113       -k
114           Deprecated in favor of -T KEY.
115
116       -p protocol
117           Sets the protocol value for the generated key. The protocol is a
118           number between 0 and 255. The default is 3 (DNSSEC). Other possible
119           values for this argument are listed in RFC 2535 and its successors.
120
121       -q
122           Quiet mode: Suppresses unnecessary output, including progress
123           indication. Without this option, when dnssec-keygen is run
124           interactively to generate an RSA or DSA key pair, it will print a
125           string of symbols to stderr indicating the progress of the key
126           generation. A '.' indicates that a random number has been found
127           which passed an initial sieve test; '+' means a number has passed a
128           single round of the Miller-Rabin primality test; a space means that
129           the number has passed all the tests and is a satisfactory key.
130
131       -r randomdev
132           Specifies the source of randomness. If the operating system does
133           not provide a /dev/random or equivalent device, the default source
134           of randomness is keyboard input.  randomdev specifies the name of a
135           character device or file containing random data to be used instead
136           of the default. The special value keyboard indicates that keyboard
137           input should be used.
138
139       -S key
140           Create a new key which is an explicit successor to an existing key.
141           The name, algorithm, size, and type of the key will be set to match
142           the existing key. The activation date of the new key will be set to
143           the inactivation date of the existing one. The publication date
144           will be set to the activation date minus the prepublication
145           interval, which defaults to 30 days.
146
147       -s strength
148           Specifies the strength value of the key. The strength is a number
149           between 0 and 15, and currently has no defined purpose in DNSSEC.
150
151       -T rrtype
152           Specifies the resource record type to use for the key.  rrtype must
153           be either DNSKEY or KEY. The default is DNSKEY when using a DNSSEC
154           algorithm, but it can be overridden to KEY for use with SIG(0).
155           Using any TSIG algorithm (HMAC-* or DH) forces this option to KEY.
156
157       -t type
158           Indicates the use of the key.  type must be one of AUTHCONF,
159           NOAUTHCONF, NOAUTH, or NOCONF. The default is AUTHCONF. AUTH refers
160           to the ability to authenticate data, and CONF the ability to
161           encrypt data.
162
163       -v level
164           Sets the debugging level.
165

TIMING OPTIONS

167       Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the
168       argument begins with a '+' or '-', it is interpreted as an offset from
169       the present time. For convenience, if such an offset is followed by one
170       of the suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the offset is
171       computed in years (defined as 365 24-hour days, ignoring leap years),
172       months (defined as 30 24-hour days), weeks, days, hours, or minutes,
173       respectively. Without a suffix, the offset is computed in seconds.
174
175       -P date/offset
176           Sets the date on which a key is to be published to the zone. After
177           that date, the key will be included in the zone but will not be
178           used to sign it. If not set, and if the -G option has not been
179           used, the default is "now".
180
181       -A date/offset
182           Sets the date on which the key is to be activated. After that date,
183           the key will be included in the zone and used to sign it. If not
184           set, and if the -G option has not been used, the default is "now".
185
186       -R date/offset
187           Sets the date on which the key is to be revoked. After that date,
188           the key will be flagged as revoked. It will be included in the zone
189           and will be used to sign it.
190
191       -I date/offset
192           Sets the date on which the key is to be retired. After that date,
193           the key will still be included in the zone, but it will not be used
194           to sign it.
195
196       -D date/offset
197           Sets the date on which the key is to be deleted. After that date,
198           the key will no longer be included in the zone. (It may remain in
199           the key repository, however.)
200
201       -i interval
202           Sets the prepublication interval for a key. If set, then the
203           publication and activation dates must be separated by at least this
204           much time. If the activation date is specified but the publication
205           date isn't, then the publication date will default to this much
206           time before the activation date; conversely, if the publication
207           date is specified but activation date isn't, then activation will
208           be set to this much time after publication.
209
210           If the key is being created as an explicit successor to another
211           key, then the default prepublication interval is 30 days; otherwise
212           it is zero.
213
214           As with date offsets, if the argument is followed by one of the
215           suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the interval is
216           measured in years, months, weeks, days, hours, or minutes,
217           respectively. Without a suffix, the interval is measured in
218           seconds.
219

GENERATED KEYS

221       When dnssec-keygen completes successfully, it prints a string of the
222       form Knnnn.+aaa+iiiii to the standard output. This is an identification
223       string for the key it has generated.
224
225       ·   nnnn is the key name.
226
227       ·   aaa is the numeric representation of the algorithm.
228
229       ·   iiiii is the key identifier (or footprint).
230
231       dnssec-keygen creates two files, with names based on the printed
232       string.  Knnnn.+aaa+iiiii.key contains the public key, and
233       Knnnn.+aaa+iiiii.private contains the private key.
234
235       The .key file contains a DNS KEY record that can be inserted into a
236       zone file (directly or with a $INCLUDE statement).
237
238       The .private file contains algorithm-specific fields. For obvious
239       security reasons, this file does not have general read permission.
240
241       Both .key and .private files are generated for symmetric encryption
242       algorithms such as HMAC-MD5, even though the public and private key are
243       equivalent.
244

EXAMPLE

246       To generate a 768-bit DSA key for the domain example.com, the following
247       command would be issued:
248
249       dnssec-keygen -a DSA -b 768 -n ZONE example.com
250
251       The command would print a string of the form:
252
253       Kexample.com.+003+26160
254
255       In this example, dnssec-keygen creates the files
256       Kexample.com.+003+26160.key and Kexample.com.+003+26160.private.
257

SEE ALSO

259       dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539,
260       RFC 2845, RFC 4034.
261

AUTHOR

263       Internet Systems Consortium
264
266       Copyright © 2004, 2005, 2007-2010 Internet Systems Consortium, Inc.
267       ("ISC")
268       Copyright © 2000-2003 Internet Software Consortium.
269
270
271
272BIND9                            June 30, 2000                DNSSEC-KEYGEN(8)
Impressum