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                     [-D sync date/offset] [-E engine] [-f flag] [-G]
12                     [-g generator] [-h] [-I date/offset] [-i interval]
13                     [-K directory] [-k] [-L ttl] [-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] [-z] {name}
17

DESCRIPTION

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

OPTIONS

29       -a algorithm
30           Selects the cryptographic algorithm. For DNSSEC keys, the value of
31           algorithm must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1,
32           NSEC3DSA, RSASHA256, RSASHA512, ECCGOST, ECDSAP256SHA256,
33           ECDSAP384SHA384, ED25519 or ED448. For TSIG/TKEY, the value must be
34           DH (Diffie Hellman), HMAC-MD5, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
35           HMAC-SHA384, or HMAC-SHA512. These values are case insensitive.
36
37           If no algorithm is specified, then RSASHA1 will be used by default,
38           unless the -3 option is specified, in which case NSEC3RSASHA1 will
39           be used instead. (If -3 is used and an algorithm is specified, that
40           algorithm will be checked for compatibility with NSEC3.)
41
42           Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
43           algorithm, and DSA is recommended. For TSIG, HMAC-MD5 is mandatory.
44
45           Note 2: DH, HMAC-MD5, and HMAC-SHA1 through HMAC-SHA512
46           automatically set the -T KEY option.
47
48       -b keysize
49           Specifies the number of bits in the key. The choice of key size
50           depends on the algorithm used. RSA keys must be between 512 and
51           2048 bits. Diffie Hellman keys must be between 128 and 4096 bits.
52           DSA keys must be between 512 and 1024 bits and an exact multiple of
53           64. HMAC keys must be between 1 and 512 bits. Elliptic curve
54           algorithms don't need this parameter.
55
56           The key size does not need to be specified if using a default
57           algorithm. The default key size is 1024 bits for zone signing keys
58           (ZSKs) and 2048 bits for key signing keys (KSKs, generated with -f
59           KSK). However, if an algorithm is explicitly specified with the -a,
60           then there is no default key size, and the -b must be used.
61
62       -n nametype
63           Specifies the owner type of the key. The value of nametype must
64           either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY
65           (for a key associated with a host (KEY)), USER (for a key
66           associated with a user(KEY)) or OTHER (DNSKEY). These values are
67           case insensitive. Defaults to ZONE for DNSKEY generation.
68
69       -3
70           Use an NSEC3-capable algorithm to generate a DNSSEC key. If this
71           option is used and no algorithm is explicitly set on the command
72           line, NSEC3RSASHA1 will be used by default. Note that RSASHA256,
73           RSASHA512, ECCGOST, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 and
74           ED448 algorithms are NSEC3-capable.
75
76       -C
77           Compatibility mode: generates an old-style key, without any
78           metadata. By default, dnssec-keygen will include the key's creation
79           date in the metadata stored with the private key, and other dates
80           may be set there as well (publication date, activation date, etc).
81           Keys that include this data may be incompatible with older versions
82           of BIND; the -C option suppresses them.
83
84       -c class
85           Indicates that the DNS record containing the key should have the
86           specified class. If not specified, class IN is used.
87
88       -E engine
89           Specifies the cryptographic hardware to use, when applicable.
90
91           When BIND is built with OpenSSL PKCS#11 support, this defaults to
92           the string "pkcs11", which identifies an OpenSSL engine that can
93           drive a cryptographic accelerator or hardware service module. When
94           BIND is built with native PKCS#11 cryptography
95           (--enable-native-pkcs11), it defaults to the path of the PKCS#11
96           provider library specified via "--with-pkcs11".
97
98       -f flag
99           Set the specified flag in the flag field of the KEY/DNSKEY record.
100           The only recognized flags are KSK (Key Signing Key) and REVOKE.
101
102       -G
103           Generate a key, but do not publish it or sign with it. This option
104           is incompatible with -P and -A.
105
106       -g generator
107           If generating a Diffie Hellman key, use this generator. Allowed
108           values are 2 and 5. If no generator is specified, a known prime
109           from RFC 2539 will be used if possible; otherwise the default is 2.
110
111       -h
112           Prints a short summary of the options and arguments to
113           dnssec-keygen.
114
115       -K directory
116           Sets the directory in which the key files are to be written.
117
118       -k
119           Deprecated in favor of -T KEY.
120
121       -L ttl
122           Sets the default TTL to use for this key when it is converted into
123           a DNSKEY RR. If the key is imported into a zone, this is the TTL
124           that will be used for it, unless there was already a DNSKEY RRset
125           in place, in which case the existing TTL would take precedence. If
126           this value is not set and there is no existing DNSKEY RRset, the
127           TTL will default to the SOA TTL. Setting the default TTL to 0 or
128           none is the same as leaving it unset.
129
130       -p protocol
131           Sets the protocol value for the generated key. The protocol is a
132           number between 0 and 255. The default is 3 (DNSSEC). Other possible
133           values for this argument are listed in RFC 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.  type must be one of AUTHCONF,
180           NOAUTHCONF, NOAUTH, or NOCONF. The default is AUTHCONF. AUTH refers
181           to the ability to authenticate data, and CONF the ability to
182           encrypt data.
183
184       -v level
185           Sets the debugging level.
186
187       -V
188           Prints version information.
189

TIMING OPTIONS

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

GENERATED KEYS

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

EXAMPLE

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

SEE ALSO

294       dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539,
295       RFC 2845, RFC 4034.
296

AUTHOR

298       Internet Systems Consortium, Inc.
299
301       Copyright © 2000-2005, 2007-2012, 2014-2019 Internet Systems
302       Consortium, Inc. ("ISC")
303
304
305
306ISC                             August 21, 2015               DNSSEC-KEYGEN(8)
Impressum