1DNSSEC-KEYGEN(8) BIND9 DNSSEC-KEYGEN(8)
2
3
4
6 dnssec-keygen - DNSSEC key generation tool
7
9 dnssec-keygen [-3] [-A date/offset] [-a algorithm] [-b keysize] [-C]
10 [-c class] [-D date/offset] [-D sync date/offset]
11 [-E engine] [-f flag] [-G] [-g generator] [-h]
12 [-I date/offset] [-i interval] [-K directory] [-k]
13 [-L ttl] [-n nametype] [-P date/offset]
14 [-P sync date/offset] [-p protocol] [-q] [-R date/offset]
15 [-r randomdev] [-S key] [-s strength] [-t type] [-V]
16 [-v level] {name}
17
19 dnssec-keygen generates keys for DNSSEC (Secure DNS), as defined in RFC
20 2535 and RFC 4034. It can also generate keys for use with TSIG
21 (Transaction Signatures) as defined in RFC 2845, or TKEY (Transaction
22 Key) as defined in RFC 2930.
23
24 The name of the key is specified on the command line. For DNSSEC keys,
25 this must match the name of the zone for which the key is being
26 generated.
27
29 -3
30 Use an NSEC3-capable algorithm to generate a DNSSEC key. If this
31 option is used with an algorithm that has both NSEC and NSEC3
32 versions, then the NSEC3 version will be used; for example,
33 dnssec-keygen -3a RSASHA1 specifies the NSEC3RSASHA1 algorithm.
34
35 -a algorithm
36 Selects the cryptographic algorithm. For DNSSEC keys, the value of
37 algorithm must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1,
38 NSEC3DSA, RSASHA256, RSASHA512, ECCGOST, ECDSAP256SHA256,
39 ECDSAP384SHA384, ED25519 or ED448. For TSIG/TKEY, the value must be
40 DH (Diffie Hellman), HMAC-MD5, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
41 HMAC-SHA384, or HMAC-SHA512. These values are case insensitive.
42
43 If no algorithm is specified, then RSASHA1 will be used by default,
44 unless the -3 option is specified, in which case NSEC3RSASHA1 will
45 be used instead. (If -3 is used and an algorithm is specified, that
46 algorithm will be checked for compatibility with NSEC3.)
47
48 Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
49 algorithm, and DSA is recommended. For TSIG, HMAC-MD5 is mandatory.
50
51 Note 2: DH, HMAC-MD5, and HMAC-SHA1 through HMAC-SHA512
52 automatically set the -T KEY option.
53
54 -b keysize
55 Specifies the number of bits in the key. The choice of key size
56 depends on the algorithm used. RSA keys must be between 512 and
57 2048 bits. Diffie Hellman keys must be between 128 and 4096 bits.
58 DSA keys must be between 512 and 1024 bits and an exact multiple of
59 64. HMAC keys must be between 1 and 512 bits. Elliptic curve
60 algorithms don't need this parameter.
61
62 The key size does not need to be specified if using a default
63 algorithm. The default key size is 1024 bits for zone signing keys
64 (ZSKs) and 2048 bits for key signing keys (KSKs, generated with -f
65 KSK). However, if an algorithm is explicitly specified with the -a,
66 then there is no default key size, and the -b must be used.
67
68 -C
69 Compatibility mode: generates an old-style key, without any timing
70 metadata. By default, dnssec-keygen will include the key's creation
71 date in the metadata stored with the private key, and other dates
72 may be set there as well (publication date, activation date, etc).
73 Keys that include this data may be incompatible with older versions
74 of BIND; the -C option suppresses them.
75
76 -c class
77 Indicates that the DNS record containing the key should have the
78 specified class. If not specified, class IN is used.
79
80 -E engine
81 Specifies the cryptographic hardware to use, when applicable.
82
83 When BIND is built with OpenSSL PKCS#11 support, this defaults to
84 the string "pkcs11", which identifies an OpenSSL engine that can
85 drive a cryptographic accelerator or hardware service module. When
86 BIND is built with native PKCS#11 cryptography
87 (--enable-native-pkcs11), it defaults to the path of the PKCS#11
88 provider library specified via "--with-pkcs11".
89
90 -f flag
91 Set the specified flag in the flag field of the KEY/DNSKEY record.
92 The only recognized flags are KSK (Key Signing Key) and REVOKE.
93
94 -G
95 Generate a key, but do not publish it or sign with it. This option
96 is incompatible with -P and -A.
97
98 -g generator
99 If generating a Diffie Hellman key, use this generator. Allowed
100 values are 2 and 5. If no generator is specified, a known prime
101 from RFC 2539 will be used if possible; otherwise the default is 2.
102
103 -h
104 Prints a short summary of the options and arguments to
105 dnssec-keygen.
106
107 -K directory
108 Sets the directory in which the key files are to be written.
109
110 -k
111 Deprecated in favor of -T KEY.
112
113 -L ttl
114 Sets the default TTL to use for this key when it is converted into
115 a DNSKEY RR. If the key is imported into a zone, this is the TTL
116 that will be used for it, unless there was already a DNSKEY RRset
117 in place, in which case the existing TTL would take precedence. If
118 this value is not set and there is no existing DNSKEY RRset, the
119 TTL will default to the SOA TTL. Setting the default TTL to 0 or
120 none is the same as leaving it unset.
121
122 -n nametype
123 Specifies the owner type of the key. The value of nametype must
124 either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY
125 (for a key associated with a host (KEY)), USER (for a key
126 associated with a user(KEY)) or OTHER (DNSKEY). These values are
127 case insensitive. Defaults to ZONE for DNSKEY generation.
128
129 -p protocol
130 Sets the protocol value for the generated key, for use with -T KEY.
131 The protocol is a number between 0 and 255. The default is 3
132 (DNSSEC). Other possible values for this argument are listed in RFC
133 2535 and its successors.
134
135 -q
136 Quiet mode: Suppresses unnecessary output, including progress
137 indication. Without this option, when dnssec-keygen is run
138 interactively to generate an RSA or DSA key pair, it will print a
139 string of symbols to stderr indicating the progress of the key
140 generation. A '.' indicates that a random number has been found
141 which passed an initial sieve test; '+' means a number has passed a
142 single round of the Miller-Rabin primality test; a space means that
143 the number has passed all the tests and is a satisfactory key.
144
145 -r randomdev
146 Specifies a source of randomness. Normally, when generating DNSSEC
147 keys, this option has no effect; the random number generation
148 function provided by the cryptographic library will be used.
149
150 If that behavior is disabled at compile time, however, the
151 specified file will be used as entropy source for key generation.
152 randomdev is the name of a character device or file containing
153 random data to be used. The special value keyboard indicates that
154 keyboard input should be used.
155
156 The default is /dev/random if the operating system provides it or
157 an equivalent device; if not, the default source of randomness is
158 keyboard input.
159
160 -S key
161 Create a new key which is an explicit successor to an existing key.
162 The name, algorithm, size, and type of the key will be set to match
163 the existing key. The activation date of the new key will be set to
164 the inactivation date of the existing one. The publication date
165 will be set to the activation date minus the prepublication
166 interval, which defaults to 30 days.
167
168 -s strength
169 Specifies the strength value of the key. The strength is a number
170 between 0 and 15, and currently has no defined purpose in DNSSEC.
171
172 -T rrtype
173 Specifies the resource record type to use for the key. rrtype must
174 be either DNSKEY or KEY. The default is DNSKEY when using a DNSSEC
175 algorithm, but it can be overridden to KEY for use with SIG(0).
176 Using any TSIG algorithm (HMAC-* or DH) forces this option to KEY.
177
178 -t type
179 Indicates the use of the key, for use with -T KEY. type must be
180 one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default is
181 AUTHCONF. AUTH refers to the ability to authenticate data, and CONF
182 the ability to encrypt data.
183
184 -V
185 Prints version information.
186
187 -v level
188 Sets the debugging level.
189
191 Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the
192 argument begins with a '+' or '-', it is interpreted as an offset from
193 the present time. For convenience, if such an offset is followed by one
194 of the suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the offset is
195 computed in years (defined as 365 24-hour days, ignoring leap years),
196 months (defined as 30 24-hour days), weeks, days, hours, or minutes,
197 respectively. Without a suffix, the offset is computed in seconds. To
198 explicitly prevent a date from being set, use 'none' or 'never'.
199
200 -P date/offset
201 Sets the date on which a key is to be published to the zone. After
202 that date, the key will be included in the zone but will not be
203 used to sign it. If not set, and if the -G option has not been
204 used, the default is "now".
205
206 -P sync date/offset
207 Sets the date on which CDS and CDNSKEY records that match this key
208 are to be published to the zone.
209
210 -A date/offset
211 Sets the date on which the key is to be activated. After that date,
212 the key will be included in the zone and used to sign it. If not
213 set, and if the -G option has not been used, the default is "now".
214 If set, if and -P is not set, then the publication date will be set
215 to the activation date minus the prepublication interval.
216
217 -R date/offset
218 Sets the date on which the key is to be revoked. After that date,
219 the key will be flagged as revoked. It will be included in the zone
220 and will be used to sign it.
221
222 -I date/offset
223 Sets the date on which the key is to be retired. After that date,
224 the key will still be included in the zone, but it will not be used
225 to sign it.
226
227 -D date/offset
228 Sets the date on which the key is to be deleted. After that date,
229 the key will no longer be included in the zone. (It may remain in
230 the key repository, however.)
231
232 -D sync date/offset
233 Sets the date on which the CDS and CDNSKEY records that match this
234 key are to be deleted.
235
236 -i interval
237 Sets the prepublication interval for a key. If set, then the
238 publication and activation dates must be separated by at least this
239 much time. If the activation date is specified but the publication
240 date isn't, then the publication date will default to this much
241 time before the activation date; conversely, if the publication
242 date is specified but activation date isn't, then activation will
243 be set to this much time after publication.
244
245 If the key is being created as an explicit successor to another
246 key, then the default prepublication interval is 30 days; otherwise
247 it is zero.
248
249 As with date offsets, if the argument is followed by one of the
250 suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the interval is
251 measured in years, months, weeks, days, hours, or minutes,
252 respectively. Without a suffix, the interval is measured in
253 seconds.
254
256 When dnssec-keygen completes successfully, it prints a string of the
257 form Knnnn.+aaa+iiiii to the standard output. This is an identification
258 string for the key it has generated.
259
260 · nnnn is the key name.
261
262 · aaa is the numeric representation of the algorithm.
263
264 · iiiii is the key identifier (or footprint).
265
266 dnssec-keygen creates two files, with names based on the printed
267 string. Knnnn.+aaa+iiiii.key contains the public key, and
268 Knnnn.+aaa+iiiii.private contains the private key.
269
270 The .key file contains a DNS KEY record that can be inserted into a
271 zone file (directly or with a $INCLUDE statement).
272
273 The .private file contains algorithm-specific fields. For obvious
274 security reasons, this file does not have general read permission.
275
276 Both .key and .private files are generated for symmetric cryptography
277 algorithms such as HMAC-MD5, even though the public and private key are
278 equivalent.
279
281 To generate a 768-bit DSA key for the domain example.com, the following
282 command would be issued:
283
284 dnssec-keygen -a DSA -b 768 -n ZONE example.com
285
286 The command would print a string of the form:
287
288 Kexample.com.+003+26160
289
290 In this example, dnssec-keygen creates the files
291 Kexample.com.+003+26160.key and Kexample.com.+003+26160.private.
292
293 To generate a matching key-signing key, issue the command:
294
295 dnssec-keygen -a DSA -b 768 -n ZONE -f KSK example.com
296
298 dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539,
299 RFC 2845, RFC 4034.
300
302 Internet Systems Consortium, Inc.
303
305 Copyright © 2000-2005, 2007-2012, 2014-2021 Internet Systems
306 Consortium, Inc. ("ISC")
307
308
309
310ISC August 21, 2015 DNSSEC-KEYGEN(8)