| 1 |
.\" Man page generated from reStructuredText |
| 2 |
.\" by the Docutils 0.22.4 manpage writer. |
| 3 |
. |
| 4 |
. |
| 5 |
.nr rst2man-indent-level 0 |
| 6 |
. |
| 7 |
.de1 rstReportMargin |
| 8 |
\\$1 \\n[an-margin] |
| 9 |
level \\n[rst2man-indent-level] |
| 10 |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 11 |
- |
| 12 |
\\n[rst2man-indent0] |
| 13 |
\\n[rst2man-indent1] |
| 14 |
\\n[rst2man-indent2] |
| 15 |
.. |
| 16 |
.de1 INDENT |
| 17 |
.\" .rstReportMargin pre: |
| 18 |
. RS \\$1 |
| 19 |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| 20 |
. nr rst2man-indent-level +1 |
| 21 |
.\" .rstReportMargin post: |
| 22 |
.. |
| 23 |
.de UNINDENT |
| 24 |
. RE |
| 25 |
.\" indent \\n[an-margin] |
| 26 |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 27 |
.nr rst2man-indent-level -1 |
| 28 |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 29 |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| 30 |
.. |
| 31 |
.TH "DNSSEC-KEYGEN" "1" "@RELEASE_DATE@" "@PACKAGE_VERSION@" "BIND 9" |
| 32 |
.SH NAME |
| 33 |
dnssec-keygen \- DNSSEC key generation tool |
| 34 |
.SH SYNOPSIS |
| 35 |
.sp |
| 36 |
\fBdnssec\-keygen\fP [\fB\-3\fP] [\fB\-A\fP date/offset] [\fB\-a\fP algorithm] [\fB\-b\fP keysize] [\fB\-C\fP] [\fB\-c\fP class] [\fB\-D\fP date/offset] [\fB\-d\fP bits] [\fB\-D\fP sync date/offset] [\fB\-E\fP engine] [\fB\-f\fP flag] [\fB\-F\fP] [\fB\-G\fP] [\fB\-h\fP] [\fB\-I\fP date/offset] [\fB\-i\fP interval] [\fB\-K\fP directory] [\fB\-k\fP policy] [\fB\-L\fP ttl] [\fB\-l\fP file] [\fB\-n\fP nametype] [\fB\-M\fP tag_min:tag_max] [\fB\-P\fP date/offset] [\fB\-P\fP sync date/offset] [\fB\-p\fP protocol] [\fB\-q\fP] [\fB\-R\fP date/offset] [\fB\-S\fP key] [\fB\-s\fP strength] [\fB\-T\fP rrtype] [\fB\-t\fP type] [\fB\-V\fP] [\fB\-v\fP level] {name} |
| 37 |
.SH DESCRIPTION |
| 38 |
.sp |
| 39 |
\fBdnssec\-keygen\fP generates keys for DNSSEC (Secure DNS), as defined in |
| 40 |
\fBRFC 2535\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc2535\:.html> and \fBRFC 4034\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc4034\:.html>\&. |
| 41 |
.sp |
| 42 |
The \fBname\fP of the key is specified on the command line. For DNSSEC |
| 43 |
keys, this must match the name of the zone for which the key is being |
| 44 |
generated. |
| 45 |
.SH OPTIONS |
| 46 |
.INDENT 0.0 |
| 47 |
.TP |
| 48 |
.B \-3 |
| 49 |
This option uses an NSEC3\-capable algorithm to generate a DNSSEC |
| 50 |
key. If this option is used with an algorithm that has both NSEC |
| 51 |
and NSEC3 versions, then the NSEC3 version is selected; for |
| 52 |
example, \fBdnssec\-keygen \-3 \-a RSASHA1\fP specifies the NSEC3RSASHA1 |
| 53 |
(deprecated) algorithm. |
| 54 |
.UNINDENT |
| 55 |
.INDENT 0.0 |
| 56 |
.TP |
| 57 |
.B \-a algorithm |
| 58 |
This option selects the cryptographic algorithm. For DNSSEC keys, |
| 59 |
the value of \fBalgorithm\fP must be one of RSASHA1 (deprecated), |
| 60 |
NSEC3RSASHA1 (deprecated), RSASHA256, RSASHA512, ECDSAP256SHA256, |
| 61 |
ECDSAP384SHA384, ED25519, or ED448. |
| 62 |
.sp |
| 63 |
These values are case\-insensitive. In some cases, abbreviations |
| 64 |
are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 |
| 65 |
for ECDSAP384SHA384. If RSASHA1 (deprecated) is specified along |
| 66 |
with the \fB\-3\fP option, NSEC3RSASHA1 (deprecated) is used |
| 67 |
instead. |
| 68 |
.sp |
| 69 |
This parameter \fImust\fP be specified except when using the \fB\-S\fP |
| 70 |
option, which copies the algorithm from the predecessor key. |
| 71 |
.sp |
| 72 |
In prior releases, HMAC algorithms could be generated for use as TSIG |
| 73 |
keys, but that feature was removed in BIND 9.13.0. Use |
| 74 |
\fBtsig\-keygen\fP \%<#\:std-iscman-tsig-keygen> to generate TSIG keys. |
| 75 |
.UNINDENT |
| 76 |
.INDENT 0.0 |
| 77 |
.TP |
| 78 |
.B \-b keysize |
| 79 |
This option specifies the number of bits in the key. The choice of key size |
| 80 |
depends on the algorithm used: RSA keys must be between 1024 and 4096 |
| 81 |
bits; Diffie\-Hellman keys must be between 128 and 4096 bits. Elliptic |
| 82 |
curve algorithms do not need this parameter. |
| 83 |
.sp |
| 84 |
If the key size is not specified, some algorithms have pre\-defined |
| 85 |
defaults. For example, RSA keys for use as DNSSEC zone\-signing keys |
| 86 |
have a default size of 1024 bits; RSA keys for use as key\-signing |
| 87 |
keys (KSKs, generated with \fB\-f KSK\fP) default to 2048 bits. |
| 88 |
.UNINDENT |
| 89 |
.INDENT 0.0 |
| 90 |
.TP |
| 91 |
.B \-C |
| 92 |
This option enables compatibility mode, which generates an old\-style key, without any timing |
| 93 |
metadata. By default, \fBdnssec\-keygen\fP includes the key\(aqs |
| 94 |
creation date in the metadata stored with the private key; other |
| 95 |
dates may be set there as well, including publication date, activation date, |
| 96 |
etc. Keys that include this data may be incompatible with older |
| 97 |
versions of BIND; the \fB\-C\fP option suppresses them. |
| 98 |
.UNINDENT |
| 99 |
.INDENT 0.0 |
| 100 |
.TP |
| 101 |
.B \-c class |
| 102 |
This option indicates that the DNS record containing the key should have the |
| 103 |
specified class. If not specified, class IN is used. |
| 104 |
.UNINDENT |
| 105 |
.INDENT 0.0 |
| 106 |
.TP |
| 107 |
.B \-d bits |
| 108 |
This option specifies the key size in bits. For the algorithms RSASHA1, NSEC3RSASA1, RSASHA256, and |
| 109 |
RSASHA512 the key size must be between 1024 and 4096 bits; DH size is between 128 |
| 110 |
and 4096 bits. This option is ignored for algorithms ECDSAP256SHA256, |
| 111 |
ECDSAP384SHA384, ED25519, and ED448. |
| 112 |
.UNINDENT |
| 113 |
.INDENT 0.0 |
| 114 |
.TP |
| 115 |
.B \-E engine |
| 116 |
This option specifies the cryptographic hardware to use, when applicable. |
| 117 |
.sp |
| 118 |
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL |
| 119 |
engine identifier that drives the cryptographic accelerator or |
| 120 |
hardware service module (usually \fBpkcs11\fP). |
| 121 |
.UNINDENT |
| 122 |
.INDENT 0.0 |
| 123 |
.TP |
| 124 |
.B \-f flag |
| 125 |
This option sets the specified flag in the flag field of the KEY/DNSKEY record. |
| 126 |
The only recognized flags are ZSK (Zone\-Signing Key), KSK (Key\-Signing Key) |
| 127 |
and REVOKE. |
| 128 |
.sp |
| 129 |
Note that ZSK is not a physical flag in the DNSKEY record, it is merely used |
| 130 |
to explicitly tell that you want to create a ZSK. Setting \fB\-f\fP in |
| 131 |
conjunction with \fB\-k\fP will result in generating keys that only |
| 132 |
match the given role set with this option. |
| 133 |
.UNINDENT |
| 134 |
.INDENT 0.0 |
| 135 |
.TP |
| 136 |
.B \-F |
| 137 |
This options turns on FIPS (US Federal Information Processing Standards) |
| 138 |
mode if the underlying crytographic library supports running in FIPS |
| 139 |
mode. |
| 140 |
.UNINDENT |
| 141 |
.INDENT 0.0 |
| 142 |
.TP |
| 143 |
.B \-G |
| 144 |
This option generates a key, but does not publish it or sign with it. This option is |
| 145 |
incompatible with \fB\-P\fP and \fB\-A\fP\&. |
| 146 |
.UNINDENT |
| 147 |
.INDENT 0.0 |
| 148 |
.TP |
| 149 |
.B \-h |
| 150 |
This option prints a short summary of the options and arguments to |
| 151 |
\fBdnssec\-keygen\fP\&. |
| 152 |
.UNINDENT |
| 153 |
.INDENT 0.0 |
| 154 |
.TP |
| 155 |
.B \-K directory |
| 156 |
This option sets the directory in which the key files are to be written. |
| 157 |
.UNINDENT |
| 158 |
.INDENT 0.0 |
| 159 |
.TP |
| 160 |
.B \-k policy |
| 161 |
This option creates keys for a specific \fBdnssec\-policy\fP\&. If a policy uses multiple keys, |
| 162 |
\fBdnssec\-keygen\fP generates multiple keys. This also |
| 163 |
creates a \(dq.state\(dq file to keep track of the key state. |
| 164 |
.sp |
| 165 |
This option creates keys according to the \fBdnssec\-policy\fP configuration, hence |
| 166 |
it cannot be used at the same time as many of the other options that |
| 167 |
\fBdnssec\-keygen\fP provides. |
| 168 |
.UNINDENT |
| 169 |
.INDENT 0.0 |
| 170 |
.TP |
| 171 |
.B \-L ttl |
| 172 |
This option sets the default TTL to use for this key when it is converted into a |
| 173 |
DNSKEY RR. This is the TTL used when the key is imported into a zone, |
| 174 |
unless there was already a DNSKEY RRset in |
| 175 |
place, in which case the existing TTL takes precedence. If this |
| 176 |
value is not set and there is no existing DNSKEY RRset, the TTL |
| 177 |
defaults to the SOA TTL. Setting the default TTL to \fB0\fP or \fBnone\fP |
| 178 |
is the same as leaving it unset. |
| 179 |
.UNINDENT |
| 180 |
.INDENT 0.0 |
| 181 |
.TP |
| 182 |
.B \-l file |
| 183 |
This option provides a configuration file that contains a \fBdnssec\-policy\fP statement |
| 184 |
(matching the policy set with \fB\-k\fP). |
| 185 |
.UNINDENT |
| 186 |
.INDENT 0.0 |
| 187 |
.TP |
| 188 |
.B \-M tag_min:tag_max |
| 189 |
This option sets the range of acceptable key tag values that \fBdnssec\-keygen\fP |
| 190 |
will produce. If the key tag of the new key or the key tag of |
| 191 |
the revoked version of the new key is outside this range, |
| 192 |
the new key will be rejected and another new key will be generated. |
| 193 |
This is designed to be used when generating keys in a multi\-signer |
| 194 |
scenario, where each operator is given a range of key tags to |
| 195 |
prevent collisions among different operators. The valid values |
| 196 |
for \fBtag_min\fP and \fBtag_max\fP are [0..65535]. The default allows all |
| 197 |
key tag values to be produced. This option is ignored when \fB\-k policy\fP |
| 198 |
is specified. |
| 199 |
.UNINDENT |
| 200 |
.INDENT 0.0 |
| 201 |
.TP |
| 202 |
.B \-n nametype |
| 203 |
This option specifies the owner type of the key. The value of \fBnametype\fP must |
| 204 |
either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY |
| 205 |
(for a key associated with a host (KEY)), USER (for a key associated |
| 206 |
with a user (KEY)), or OTHER (DNSKEY). These values are |
| 207 |
case\-insensitive. The default is ZONE for DNSKEY generation. |
| 208 |
.UNINDENT |
| 209 |
.INDENT 0.0 |
| 210 |
.TP |
| 211 |
.B \-p protocol |
| 212 |
This option sets the protocol value for the generated key, for use with |
| 213 |
\fB\-T KEY\fP\&. The protocol is a number between 0 and 255. The default |
| 214 |
is 3 (DNSSEC). Other possible values for this argument are listed in |
| 215 |
\fBRFC 2535\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc2535\:.html> and its successors. |
| 216 |
.UNINDENT |
| 217 |
.INDENT 0.0 |
| 218 |
.TP |
| 219 |
.B \-q |
| 220 |
This option sets quiet mode, which suppresses unnecessary output, including progress |
| 221 |
indication. Without this option, when \fBdnssec\-keygen\fP is run |
| 222 |
interactively to generate an RSA or DSA key pair, it prints a |
| 223 |
string of symbols to \fBstderr\fP indicating the progress of the key |
| 224 |
generation. A \fB\&.\fP indicates that a random number has been found which |
| 225 |
passed an initial sieve test; \fB+\fP means a number has passed a single |
| 226 |
round of the Miller\-Rabin primality test; and a space ( ) means that the |
| 227 |
number has passed all the tests and is a satisfactory key. |
| 228 |
.UNINDENT |
| 229 |
.INDENT 0.0 |
| 230 |
.TP |
| 231 |
.B \-S key |
| 232 |
This option creates a new key which is an explicit successor to an existing key. |
| 233 |
The name, algorithm, size, and type of the key are set to match |
| 234 |
the existing key. The activation date of the new key is set to |
| 235 |
the inactivation date of the existing one. The publication date is |
| 236 |
set to the activation date minus the prepublication interval, |
| 237 |
which defaults to 30 days. |
| 238 |
.UNINDENT |
| 239 |
.INDENT 0.0 |
| 240 |
.TP |
| 241 |
.B \-s strength |
| 242 |
This option specifies the strength value of the key. The strength is a number |
| 243 |
between 0 and 15, and currently has no defined purpose in DNSSEC. |
| 244 |
.UNINDENT |
| 245 |
.INDENT 0.0 |
| 246 |
.TP |
| 247 |
.B \-T rrtype |
| 248 |
This option specifies the resource record type to use for the key. \fBrrtype\fP |
| 249 |
must be either DNSKEY or KEY. The default is DNSKEY when using a |
| 250 |
DNSSEC algorithm, but it can be overridden to KEY for use with |
| 251 |
SIG(0). |
| 252 |
.UNINDENT |
| 253 |
.INDENT 0.0 |
| 254 |
.TP |
| 255 |
.B \-t type |
| 256 |
This option indicates the type of the key for use with \fB\-T KEY\fP\&. \fBtype\fP |
| 257 |
must be one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default |
| 258 |
is AUTHCONF. AUTH refers to the ability to authenticate data, and |
| 259 |
CONF to the ability to encrypt data. |
| 260 |
.UNINDENT |
| 261 |
.INDENT 0.0 |
| 262 |
.TP |
| 263 |
.B \-V |
| 264 |
This option prints version information. |
| 265 |
.UNINDENT |
| 266 |
.INDENT 0.0 |
| 267 |
.TP |
| 268 |
.B \-v level |
| 269 |
This option sets the debugging level. |
| 270 |
.UNINDENT |
| 271 |
.SH TIMING OPTIONS |
| 272 |
.sp |
| 273 |
Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS |
| 274 |
(which is the format used inside key files), |
| 275 |
or \(aqDay Mon DD HH:MM:SS YYYY\(aq (as printed by \fBdnssec\-settime \-p\fP), |
| 276 |
or UNIX epoch time (as printed by \fBdnssec\-settime \-up\fP), |
| 277 |
or the literal \fBnow\fP\&. |
| 278 |
.sp |
| 279 |
The argument can be followed by \fB+\fP or \fB\-\fP and an offset from the |
| 280 |
given time. The literal \fBnow\fP can be omitted before an offset. The |
| 281 |
offset can be followed by one of the suffixes \fBy\fP, \fBmo\fP, \fBw\fP, |
| 282 |
\fBd\fP, \fBh\fP, or \fBmi\fP, so that it is computed in years (defined as |
| 283 |
365 24\-hour days, ignoring leap years), months (defined as 30 24\-hour |
| 284 |
days), weeks, days, hours, or minutes, respectively. Without a suffix, |
| 285 |
the offset is computed in seconds. |
| 286 |
.sp |
| 287 |
To unset a date, use \fBnone\fP, \fBnever\fP, or \fBunset\fP\&. |
| 288 |
.INDENT 0.0 |
| 289 |
.TP |
| 290 |
.B \-P date/offset |
| 291 |
This option sets the date on which a key is to be published to the zone. After |
| 292 |
that date, the key is included in the zone but is not used |
| 293 |
to sign it. If not set, and if the \fB\-G\fP option has not been used, the |
| 294 |
default is the current date. |
| 295 |
.INDENT 7.0 |
| 296 |
.TP |
| 297 |
.B sync date/offset |
| 298 |
This option sets the date on which CDS and CDNSKEY records that match this key |
| 299 |
are to be published to the zone. |
| 300 |
.UNINDENT |
| 301 |
.UNINDENT |
| 302 |
.INDENT 0.0 |
| 303 |
.TP |
| 304 |
.B \-A date/offset |
| 305 |
This option sets the date on which the key is to be activated. After that date, |
| 306 |
the key is included in the zone and used to sign it. If not set, |
| 307 |
and if the \fB\-G\fP option has not been used, the default is the current date. If set, |
| 308 |
and \fB\-P\fP is not set, the publication date is set to the |
| 309 |
activation date minus the prepublication interval. |
| 310 |
.UNINDENT |
| 311 |
.INDENT 0.0 |
| 312 |
.TP |
| 313 |
.B \-R date/offset |
| 314 |
This option sets the date on which the key is to be revoked. After that date, the |
| 315 |
key is flagged as revoked. It is included in the zone and |
| 316 |
is used to sign it. |
| 317 |
.UNINDENT |
| 318 |
.INDENT 0.0 |
| 319 |
.TP |
| 320 |
.B \-I date/offset |
| 321 |
This option sets the date on which the key is to be retired. After that date, the |
| 322 |
key is still included in the zone, but it is not used to |
| 323 |
sign it. |
| 324 |
.UNINDENT |
| 325 |
.INDENT 0.0 |
| 326 |
.TP |
| 327 |
.B \-D date/offset |
| 328 |
This option sets the date on which the key is to be deleted. After that date, the |
| 329 |
key is no longer included in the zone. (However, it may remain in the key |
| 330 |
repository.) |
| 331 |
.INDENT 7.0 |
| 332 |
.TP |
| 333 |
.B sync date/offset |
| 334 |
This option sets the date on which the CDS and CDNSKEY records that match this |
| 335 |
key are to be deleted. |
| 336 |
.UNINDENT |
| 337 |
.UNINDENT |
| 338 |
.INDENT 0.0 |
| 339 |
.TP |
| 340 |
.B \-i interval |
| 341 |
This option sets the prepublication interval for a key. If set, then the |
| 342 |
publication and activation dates must be separated by at least this |
| 343 |
much time. If the activation date is specified but the publication |
| 344 |
date is not, the publication date defaults to this much time |
| 345 |
before the activation date; conversely, if the publication date is |
| 346 |
specified but not the activation date, activation is set to |
| 347 |
this much time after publication. |
| 348 |
.sp |
| 349 |
If the key is being created as an explicit successor to another key, |
| 350 |
then the default prepublication interval is 30 days; otherwise it is |
| 351 |
zero. |
| 352 |
.sp |
| 353 |
As with date offsets, if the argument is followed by one of the |
| 354 |
suffixes \fBy\fP, \fBmo\fP, \fBw\fP, \fBd\fP, \fBh\fP, or \fBmi\fP, the interval is |
| 355 |
measured in years, months, weeks, days, hours, or minutes, |
| 356 |
respectively. Without a suffix, the interval is measured in seconds. |
| 357 |
.UNINDENT |
| 358 |
.SH GENERATED KEYS |
| 359 |
.sp |
| 360 |
When \fBdnssec\-keygen\fP completes successfully, it prints a string of the |
| 361 |
form \fBKnnnn.+aaa+iiiii\fP to the standard output. This is an |
| 362 |
identification string for the key it has generated. |
| 363 |
.INDENT 0.0 |
| 364 |
.IP \(bu 2 |
| 365 |
\fBnnnn\fP is the key name. |
| 366 |
.IP \(bu 2 |
| 367 |
\fBaaa\fP is the numeric representation of the algorithm. |
| 368 |
.IP \(bu 2 |
| 369 |
\fBiiiii\fP is the key identifier (or footprint). |
| 370 |
.UNINDENT |
| 371 |
.sp |
| 372 |
\fBdnssec\-keygen\fP creates two files, with names based on the printed |
| 373 |
string. \fBKnnnn.+aaa+iiiii.key\fP contains the public key, and |
| 374 |
\fBKnnnn.+aaa+iiiii.private\fP contains the private key. |
| 375 |
.sp |
| 376 |
The \fB\&.key\fP file contains a DNSKEY or KEY record. When a zone is being |
| 377 |
signed by \fBnamed\fP \%<#\:std-iscman-named> or \fBdnssec\-signzone \-S\fP \%<#\:cmdoption-dnssec-signzone-S>, DNSKEY records are |
| 378 |
included automatically. In other cases, the \fB\&.key\fP file can be |
| 379 |
inserted into a zone file manually or with an \fB$INCLUDE\fP statement. |
| 380 |
.sp |
| 381 |
The \fB\&.private\fP file contains algorithm\-specific fields. For obvious |
| 382 |
security reasons, this file does not have general read permission. |
| 383 |
.SH EXAMPLE |
| 384 |
.sp |
| 385 |
To generate an ECDSAP256SHA256 zone\-signing key for the zone |
| 386 |
\fBexample.com\fP, issue the command: |
| 387 |
.sp |
| 388 |
\fBdnssec\-keygen \-a ECDSAP256SHA256 example.com\fP |
| 389 |
.sp |
| 390 |
The command prints a string of the form: |
| 391 |
.sp |
| 392 |
\fBKexample.com.+013+26160\fP |
| 393 |
.sp |
| 394 |
In this example, \fBdnssec\-keygen\fP creates the files |
| 395 |
\fBKexample.com.+013+26160.key\fP and \fBKexample.com.+013+26160.private\fP\&. |
| 396 |
.sp |
| 397 |
To generate a matching key\-signing key, issue the command: |
| 398 |
.sp |
| 399 |
\fBdnssec\-keygen \-a ECDSAP256SHA256 \-f KSK example.com\fP |
| 400 |
.SH SEE ALSO |
| 401 |
.sp |
| 402 |
\fBdnssec\-signzone(8)\fP \%<#\:std-iscman-dnssec-signzone>, BIND 9 Administrator Reference Manual, \fBRFC 2539\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc2539\:.html>, |
| 403 |
\fBRFC 2845\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc2845\:.html>, \fBRFC 4034\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc4034\:.html>\&. |
| 404 |
.SH Author |
| 405 |
Internet Systems Consortium |
| 406 |
.SH Copyright |
| 407 |
2026, Internet Systems Consortium |
| 408 |
.\" End of generated man page. |