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 the source of randomness. If the operating system does
147           not provide a /dev/random or equivalent device, the default source
148           of randomness is keyboard input.  randomdev specifies the name of a
149           character device or file containing random data to be used instead
150           of the default. The special value keyboard indicates that keyboard
151           input should be used.
152
153       -S key
154           Create a new key which is an explicit successor to an existing key.
155           The name, algorithm, size, and type of the key will be set to match
156           the existing key. The activation date of the new key will be set to
157           the inactivation date of the existing one. The publication date
158           will be set to the activation date minus the prepublication
159           interval, which defaults to 30 days.
160
161       -s strength
162           Specifies the strength value of the key. The strength is a number
163           between 0 and 15, and currently has no defined purpose in DNSSEC.
164
165       -T rrtype
166           Specifies the resource record type to use for the key.  rrtype must
167           be either DNSKEY or KEY. The default is DNSKEY when using a DNSSEC
168           algorithm, but it can be overridden to KEY for use with SIG(0).
169           Using any TSIG algorithm (HMAC-* or DH) forces this option to KEY.
170
171       -t type
172           Indicates the use of the key.  type must be one of AUTHCONF,
173           NOAUTHCONF, NOAUTH, or NOCONF. The default is AUTHCONF. AUTH refers
174           to the ability to authenticate data, and CONF the ability to
175           encrypt data.
176
177       -v level
178           Sets the debugging level.
179
180       -V
181           Prints version information.
182

TIMING OPTIONS

184       Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the
185       argument begins with a '+' or '-', it is interpreted as an offset from
186       the present time. For convenience, if such an offset is followed by one
187       of the suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the offset is
188       computed in years (defined as 365 24-hour days, ignoring leap years),
189       months (defined as 30 24-hour days), weeks, days, hours, or minutes,
190       respectively. Without a suffix, the offset is computed in seconds. To
191       explicitly prevent a date from being set, use 'none' or 'never'.
192
193       -P date/offset
194           Sets the date on which a key is to be published to the zone. After
195           that date, the key will be included in the zone but will not be
196           used to sign it. If not set, and if the -G option has not been
197           used, the default is "now".
198
199       -P sync date/offset
200           Sets the date on which CDS and CDNSKEY records that match this key
201           are to be published to the zone.
202
203       -A date/offset
204           Sets the date on which the key is to be activated. After that date,
205           the key will be included in the zone and used to sign it. If not
206           set, and if the -G option has not been used, the default is "now".
207           If set, if and -P is not set, then the publication date will be set
208           to the activation date minus the prepublication interval.
209
210       -R date/offset
211           Sets the date on which the key is to be revoked. After that date,
212           the key will be flagged as revoked. It will be included in the zone
213           and will be used to sign it.
214
215       -I date/offset
216           Sets the date on which the key is to be retired. After that date,
217           the key will still be included in the zone, but it will not be used
218           to sign it.
219
220       -D date/offset
221           Sets the date on which the key is to be deleted. After that date,
222           the key will no longer be included in the zone. (It may remain in
223           the key repository, however.)
224
225       -D sync date/offset
226           Sets the date on which the CDS and CDNSKEY records that match this
227           key are to be deleted.
228
229       -i interval
230           Sets the prepublication interval for a key. If set, then the
231           publication and activation dates must be separated by at least this
232           much time. If the activation date is specified but the publication
233           date isn't, then the publication date will default to this much
234           time before the activation date; conversely, if the publication
235           date is specified but activation date isn't, then activation will
236           be set to this much time after publication.
237
238           If the key is being created as an explicit successor to another
239           key, then the default prepublication interval is 30 days; otherwise
240           it is zero.
241
242           As with date offsets, if the argument is followed by one of the
243           suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the interval is
244           measured in years, months, weeks, days, hours, or minutes,
245           respectively. Without a suffix, the interval is measured in
246           seconds.
247

GENERATED KEYS

249       When dnssec-keygen completes successfully, it prints a string of the
250       form Knnnn.+aaa+iiiii to the standard output. This is an identification
251       string for the key it has generated.
252
253       ·   nnnn is the key name.
254
255       ·   aaa is the numeric representation of the algorithm.
256
257       ·   iiiii is the key identifier (or footprint).
258
259       dnssec-keygen creates two files, with names based on the printed
260       string.  Knnnn.+aaa+iiiii.key contains the public key, and
261       Knnnn.+aaa+iiiii.private contains the private key.
262
263       The .key file contains a DNS KEY record that can be inserted into a
264       zone file (directly or with a $INCLUDE statement).
265
266       The .private file contains algorithm-specific fields. For obvious
267       security reasons, this file does not have general read permission.
268
269       Both .key and .private files are generated for symmetric cryptography
270       algorithms such as HMAC-MD5, even though the public and private key are
271       equivalent.
272

EXAMPLE

274       To generate a 768-bit DSA key for the domain example.com, the following
275       command would be issued:
276
277       dnssec-keygen -a DSA -b 768 -n ZONE example.com
278
279       The command would print a string of the form:
280
281       Kexample.com.+003+26160
282
283       In this example, dnssec-keygen creates the files
284       Kexample.com.+003+26160.key and Kexample.com.+003+26160.private.
285

SEE ALSO

287       dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539,
288       RFC 2845, RFC 4034.
289

AUTHOR

291       Internet Systems Consortium, Inc.
292
294       Copyright © 2000-2005, 2007-2012, 2014-2018 Internet Systems
295       Consortium, Inc. ("ISC")
296
297
298
299ISC                             August 21, 2015               DNSSEC-KEYGEN(8)
Impressum