dnssec-signzone Command

Purpose

Domain name system security extensions (DNSSEC) zone signing tool.

Syntax

dnssec-signzone [-3 salt] [-A] [-a] [-c class] [-d directory] [-D][-E engine] [-e end-time] [-f output-file] [-g] [-H iterations] [-h] [-i interval] [-I input-format] [-j jitter] [-K directory] [-k key] [-L serial] [-M maxttl] [-N soa-serial-format] [-o origin] [-O output-format] [-P] [-Q] [-q] [-R] [-s start-time] [-T ttl] [-t] [-u] [-V] [-v level] [-X extended end-time] [-x] [-z] zonefile [key...]

Description

The dnssec-signzone command signs a zone. It generates NSEC and RRSIG records and produces a signed version of the zone. The presence or absence of a key set file for each child zone determines the security status of delegations from the signed zone (that is, whether the child zones are secure or not).

Flags

Item Description
-3 salt Generates an NSEC3 chain with the specified hex-encoded salt. A dash (-) can be used to indicate that no salt must be used when generating the NSEC3 chain.

The salt parameter can be random data that hashes data, a password, or passphrase. Salts are used to safeguard passwords.

-A

Indicates that, when generating an NSEC3 chain, BIND 9 should set the OPTOUT flag on all NSEC3 records and should not generate NSEC3 records for insecure delegations.

Using this option twice (that is, -AA) turns off the OPTOUT flag for all records. This is useful when using the -u option to modify an NSEC3 chain on which the OPTOUT flag was set.

-a Verifies all generated signatures.
-C Sets compatibility mode, in which a keyset-zonename file is generated in addition to dsset-zonename file when signing a zone. These files are used by older versions of the dnssec-signzone command.
-c class Specifies the DNS class of the zone.
-D Indicates that only record types that are automatically managed by the dnssec-signzone command, that is, RRSIG, NSEC, NSEC3 and NSEC3PARAM records, should be included in the output. If smart signing (-S) is used, DNSKEY records are also included. The resulting file can be included in the original zone file with $INCLUDE. This option cannot be combined with -O raw, -O map, or serial-number update operations.
-d directory Looks for key set files in the directory that is specified by the directory argument.
-E engine

Specifies the hardware to use for cryptographic operations, such as a secure key store that is used for signing, when applicable.

When BIND 9 is built with OpenSSL, this flag needs to be set to the OpenSSL engine identifier that drives the cryptographic accelerator or hardware service module (usually pkcs11). When BIND is built with native PKCS#11 cryptography (--enable-native-pkcs11), it defaults to the path of the PKCS#11 provider library specified via --with-pkcs11.

-e end-time Specifies the date and time when the generated RRSIG records expire. As with the start-time argument, an absolute time is indicated in YYYYMMDDHHMMSS notation. A time relative to the start time is indicated with +N, which is N seconds from the start time. A time relative to the current time is indicated with now+N. If you do not specify the end-time argument, the command uses 30 days from the start time as a default.
-f output-file Specifies the name of the output file that contains the signed zone. The default is to append .signed to the input file name.
-g Generates DS records for child zones from key set files. This flag removes existing DS records.
-h Prints a short summary of the options and arguments of the dnssec-signzone command.
-H iterations Indicates that, when generating an NSEC3 chain, BIND 9 must use the specified number of iterations. The default value is 10.
-I input-format Specifies the format of the input zone file. Possible formats are text (default) and raw. This option is primarily intended to be used for dynamic signed zones, so that the dumped zone file in a non-text format containing updates can be signed directly. This option is not useful for non-dynamic zones.
-i interval When a previously signed zone is passed as input, records might be resigned. The interval option specifies the cycle interval as an offset from the current time (in seconds). If an RRSIG record expires after the cycle interval, it is retained. Otherwise, it is considered to be expiring soon, and it is then replaced. The default cycle interval is one quarter of the difference between the signature end and start times. If you specify neither the end-time argument or the start-time argument, the dnssec-signzone command generates signatures that are valid for 30 days, with a cycle interval of 7.5 days. Therefore, if any existing RRSIG records are due to expire in less than 7.5 days, they are replaced.
-j jitter When you sign a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expire simultaneously. If the zone is incrementally signed, for example, a previously signed zone is passed as input to the signer and all expired signatures must be regenerated at about the same time. The jitter argument specifies a jitter window that is used to randomize the signature expire time, thus spreading incremental signature regeneration over time. Signature lifetime jitter can also benefit validators and servers by spreading out cache expiration. For example, if large numbers of RRSIGs do not expire at the same time from all caches, there is less congestion than if all validators must refetch at mostly the same time.
-K directory start of changeSpecifies the directory to search for DNSSEC keys. If not specified, it defaults to the current directory.end of change
-k key Treats the specified key as a key-signing key ignoring any key flags. You can specify this option multiple times.
-L serial start of changeWhen writing a signed zone to raw or map format, this option sets the source serial value in the header to the specified serial number. (This flag is expected to be used primarily for testing purposes).end of change
-M maxttl start of changeSets the maximum TTL for the signed zone. Any TTL higher than maxttl in the input zone is reduced to maxttl in the output. This provides certainty as to the largest possible TTL in the signed zone, which is useful to know when rolling keys. The maxttl is the longest possible time before signatures, which are retrieved by resolvers, expire from resolver caches. Zones that are signed with this option should be configured to use a matching max-zone-ttl in named.conf.
Note: This option is incompatible with -D, because it modifies non-DNSSEC data in the output zone.
end of change
-N soa-serial-format Specifies the SOA serial number format of the signed zone. The soa-serial-format argument can be one of the following values:
keep
Does not modify the SOA serial number. It is the default value.
increment
Increases the SOA serial number by using RFC 1982 arithmetic.
unixtime
Sets the SOA serial number to the number of seconds since epoch.
date
Sets the SOA serial number to today’s date, in YYYYMMDDNN format, unless the serial number is already greater than or equal to that value, in which case it is simply incremented by one.
-n ncpus Specifies the number of threads to use. By default, the command starts one thread for each detected processor.
-O output-format Specifies the format of the output file that contains the signed zone. Possible formats are text (the default), which is the standard textual representation of the zone; full, which is text output in a format suitable for processing by external scripts; and map, raw, and raw=N, which store the zone in binary formats for rapid loading by named command. raw=N specifies the format version of the raw zone file: if N is 0, the raw file can be read by any version of named command; if N is 1, the file can be read by release 9.9.0, or later. The default value is 1.
-o origin Specifies the zone origin. If not specified, the name of the zone file is assumed to be the origin.
-P

Disables post-sign verification tests.

The post-sign verification tests ensure that at least one non-revoked self-signed KSK key exist for each algorithm, that all revoked KSK keys are self-signed, and that all records in the zone are signed by the algorithm. This option skips these tests.

start of change-Qend of change start of change

Removes signatures from keys that are no longer active.

Typically, when a previously signed zone is passed as input to the signer, and a DNSKEY record has been removed and replaced with a new record, signatures from the old key that are still within their validity period are retained. This allows the zone to continue to validate with cached copies of the old DNSKEY RRset. The -Q option forces dnssec-signzone command to remove signatures from keys that are no longer active. This enables ZSK rollover using the procedure described in RFC 4641#4.2.1.1 (“Pre-Publish Key Rollover”).

end of change
start of change-qend of change start of changeEnables quiet mode, which suppresses unnecessary output. Without this option, when dnssec-signzone command is run, it prints the following information to standard output: the number of keys in use; the algorithms used to verify whether the zone was signed correctly and other status information; and the filename containing the signed zone. If you use this option, the output is suppressed and only the filename is retained.end of change
start of change-Rend of change start of change

Removes signatures from keys that are no longer published.

This option is similar to -Q, except that it forces dnssec-signzone command to remove signatures from keys that are no longer published. This enables ZSK rollover using the procedure described in RFC 4641#4.2.1.2 (“Double Signature Zone Signing Key Rollover”).

end of change
start of change-Send of change start of change

Enables smart signing, which instructs dnssec-signzone command to search the key repository for keys that match the zone being signed, and to include them in the zone if appropriate.

When a key is found, its timing metadata is examined to determine how it should be used, according to the following rules. Each successive rule takes priority over the prior rules:
  • If no timing metadata has been set for the key, the key is published in the zone and is used to sign the zone.
  • If the key’s publication date is set and is in the past, the key is published in the zone.
  • If the key’s activation date is set and is in the past, the key is published (regardless of publication date) and used to sign the zone.
  • If the key’s revocation date is set and is in the past, and the key is published, then the key is revoked, and the revoked key is used to sign the zone.
  • If either the key’s unpublication or deletion date is set and in the past, the key is NOT published or used to sign the zone, regardless of any other metadata.
  • If the key’s sync publication date is set and is in the past, synchronization records (type CDS and/or CDNSKEY) are created.
  • If the key’s sync deletion date is set and is in the past, synchronization records (type CDS and/or CDNSKEY) are removed.
end of change
-s start-time Specifies the date and time when the generated RRSIG records become valid. It can be either an absolute or relative time. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000. A relative start time is indicated by +N, which is N seconds from the current time. If you do not specify the start-time argument, the command uses the current time minus 1 hour (to allow for clock skew).
start of change-T ttlend of change start of changeSpecifies a TTL to be used for new DNSKEY records that are imported into the zone from the key repository. If ttl is not specified, the TTL value from the zone’s SOA record is used by default. This option is ignored when signing without -S, since DNSKEY records are not imported from the key repository in that case. It is also ignored if any pre-existing DNSKEY records exists at the zone apex, in which case new records’ TTL values are set to match them, or if any of the imported DNSKEY records had a default TTL value. In the event of a conflict between TTL values in imported keys, the shortest value is used.end of change
-t Prints statistics at completion.
start of change-uend of change start of changeUpdates the NSEC/NSEC3 chain when re-signing a previously signed zone. With this option, a zone signed with NSEC can be switched to NSEC3, or a zone signed with NSEC3 can be switched to NSEC or to NSEC3 with different parameters. Without this option, dnssec-signzone command retains the existing chain when re-signing.end of change
start of change-Vend of change start of changePrints version information.end of change
-v level Sets the debugging level.
start of change-X extended end-timeend of change start of change

Specifies the date and time when the generated RRSIG records for the DNSKEY RRset expire. This is to be used in cases when the DNSKEY signatures need to persist longer than signatures on other records. For example, when the private component of the KSK is kept offline and the KSK signature must be refreshed manually.

Similar to the end-time, an absolute time is indicated in YYYYMMDDHHMMSS notation. A time relative to the start time is indicated with +N, which is N seconds from the start time. A time relative to the current time is indicated with now+N. If no extended end-time is specified, the value of end-time is used by default. (end-time, in turn, defaults to 30 days from the start time.) extended end-time must be later than start-time.

end of change
start of change-xend of change start of changeIndicates that BIND 9 should only sign the DNSKEY, CDNSKEY, and CDS RRsets with key-signing keys, and should omit signatures from zone-signing keys. (This is similar to the second-dnskey-kskonly yes; zone option in named command.end of change
-z Ignores KSK flag on key when you determine what to sign.

Parameters

Item Description
zonefile The file that contains the zone to be signed.
key The keys that are used to sign the key set. If no keys are specified, the defaults are all zone keys that have private key files in the current directory.

Examples

The following command signs the example.com zone with the ECDSAP256SHA256 key generated by dnssec-keygen command (Kexample.com.+013+17247). Because the -S option is not used, the zone’s keys must exist in the master file (db.example.com). This invocation looks for dsset files in the current directory, so that DS records can be imported from them (-g).
% dnssec-signzone -g -o example.com db.example.com \
Kexample.com.+013+17247
db.example.com.signed
%

In the preceding example, dnssec-signzone command creates the file db.example.com.signed. This file should be referenced in a zone statement in the named.conf file.

This example re-signs a previously signed zone with default parameters. The private keys are assumed to be present in the current directory.
% cp db.example.com.signed db.example.com
% dnssec-signzone -o example.com db.example.com
db.example.com.signed
%