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