dnssec-signzone Command

Purpose

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

Syntax

dnssec-signzone [-a] [-c class] [-d directory] [-D] [-E engine] [-e end-time] [-f output-file] [-g] [-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] [-s start-time] [-T ttl] [-t] [-u] [-v level] [-V] [-X extended end-time] [-x] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

Description

The dnssec-signzone command signs a zone. It generates next secure record (NSEC) and resource record signature (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.

Flags

Item Description
-3 salt Generates an NSEC3 chain with the specified hex-encoded salt. A dash (-) is used to indicate that no salt must be used to generate the NSEC3 chain.
Note: It is recommended to use the -3 option without any arguments. Adding salt provides no practical benefits.
-A
Indicates that to generate an NSEC3 chain, BIND 9 must set the OPTOUT flag on all NSEC3 records and must not generate NSEC3 records for insecure delegations.
Note: You can use this option once you understand the implications completely. This option is intended only for large zones (comparable to com.) with sparse secure delegations.

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

-a Verifies the generated signatures.
-C Sets a compatibility mode, in which a keyset-zonename file is generated in addition to the dsset-zonename file when signing a zone. These files are used by the older versions of the dnssec-signzone command.
-c class Specifies the Domain Name System (DNS) class of the zone.
-D Indicates that only the record types that are automatically managed by the dnssec-signzone command, such as RRSIG, NSEC, NSEC3, and NSEC3PARAM records, must be included in the output. If smart signing (-S flag) is used, the 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 or serial-number update operations.
-d directory Indicates the directory where BIND 9 must look for dsset- or keyset- files.
-E engine

Specifies the hardware that must be used for cryptographic operations, such as a secure keystore 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).

-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. If the output-file is set to -, the signed zone is written to the standard output, with a default output format of full.
-g Generates DS records for child zones from dsset- or keyset- files. This flag removes existing DS records.
-h Prints a short summary of the options and arguments to the dnssec-signzone command.
-H iterations Indicates that to generate an NSEC3 chain, BIND 9 must use the specified number of iterations. The default value is 10.
Note: Values greater than 0 cause interoperability issues and also increase the risk of CPU-exhausting DoS attacks.
-I input-format Specifies the format of the input zone file. Possible formats are text (default) and raw. This option is used for dynamic signed zones so that the dumped zone files in a non-text format with updates are signed directly. This option is not useful for nondynamic zones.
-i interval Indicates that, 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, the RRSIG record is retained. Otherwise, the RRSIG record is considered to be expiring soon, and is replaced.

The default cycle interval is one quarter of the difference between the signature end and start times. If you specify 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, any existing RRSIG records that expire in less than 7.5 days 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 benefits validators and servers by spreading out the cache expiration. For example, if large numbers of RRSIG records do not expire at the same time from all caches, congestion is reduced compared to when all validators must refetch at the same time.

-K directory Specifies the directory to search for the DNSSEC keys. If not specified, it defaults to the current directory.
-k key Treats the specified key as a key-signing key, ignoring any key flags. You can specify this option multiple times.
-L serial When you write a signed zone to the raw format or map format, this option sets the source serial value in the header to the specified serial number. This flag is used primarily for testing purposes.
-M maxttl Sets the maximum time-to-live (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 is retrieved by resolvers, expire from resolver caches. Zones that are signed with this option must be configured to use a matching max-zone-ttl in the named.conf file.
Note: This option is incompatible with the -D flag as it modifies non-DNSSEC data in the output zone.
-N soa-serial-format Specifies the State of Authority (SOA) serial number format of the signed zone. The soa-serial-format argument takes one of the following values:
keep
Do 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 the beginning of the Unix epoch, unless the serial number is already greater than or equal to that value, in which case it is increased by one.
date
Sets the SOA serial number to the current date, in YYYYMMDDNN format, unless the serial number is greater than or equal to that value, in which case it is increased by one.
-n ncpus Specifies the number of threads to use. By default, the command starts one thread for each detected CPU.
-O output-format Specifies the format of the output file that contains the signed zone. The following values are the possible formats:
  • text (the default), which is the standard textual representation of the zone.
  • full, which is text output in a format suitable to be processed by external scripts.
  • raw, and raw=N, which store the zone in binary formats for rapid loading by named command. The raw=N option specifies the format version of the raw zone file. If N is 0, the raw file is read by any version of named command. If N is 1, the file is 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 nonrevoked self-signed key-signing keys (KSKs) exists for each algorithm. It also ensures that all the revoked KSK keys are self-signed, and records in the zone are signed by the algorithm. This option skips these tests.

-Q

Removes signatures from keys that are no longer active.

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

-q Enables quiet mode, which suppresses unnecessary output. Without this option, when the dnssec-signzone command is run, it prints the following three pieces 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.
  • The file name with the signed zone.
If you use this option, the output is suppressed and only the file name is retained.
-R

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 by using the procedure that is described in RFC 4641#4.2.1.2 (Double Signature Zone Signing Key Rollover).

-S

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

When a key is found, its timing metadata is examined to determine how it must be used, according to the following rules:
  • If no timing metadata is set for the key, the key is published in the zone and is used to sign the zone.
  • If the publication date of the key is set and is in the past, the key is published in the zone.
  • If the activation date of the key is set and is in the past, the key is published (regardless of publication date) and used to sign the zone.
  • If the revocation date of the key is set and is in the past, and the key is published, the key is revoked and is used to sign the zone.
  • If the unpublication or deletion date of the key is set and in the past, the key is not published or used to sign the zone, regardless of any other metadata.
  • If the sync publication date of the key is set and is in the past, synchronization records (type CDS or CDNSKEY or both) are created.
  • If the sync deletion date of the key is set and is in the past, synchronization records (type CDS or CDNSKEY or both) are removed.
Each successive rule takes priority over the prior rules.
-s start-time Specifies the date and time when the generated RRSIG records become valid. It is either an absolute or relative time.
  • An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation. For example, 20000530144500 denotes 14:45:00 UTC on 30 May 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 dnssec-signzone command uses the current time minus 1 hour (to allow for clock skew).
-T ttl Specifies 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 SOA record of the zone is used by default. This option is ignored during the following scenarios:
  • When you sign without -S option, as DNSKEY records are not imported from the key repository in that case.
  • If any pre-existing DNSKEY records exist at the zone apex, in which case the TTL values of the new records are set to match them.
  • If any of the imported DNSKEY records had a default TTL value. If there is a conflict between TTL values in imported keys, the shortest value is used.
-t Prints statistics at completion.
-u Updates the NSEC or NSEC3 chain when a previously signed zone is re-signed. With this option, a zone that is signed with NSEC can be switched to NSEC3, or a zone that is signed with NSEC3 can be switched to NSEC or to NSEC3 with different parameters. Without this option, the dnssec-signzone command retains the existing chain when re-signing.
-V Prints the version information.
-v level Sets the debugging level.
-X extended end-time

Specifies the date and time when the generated RRSIG records for the DNSKEY RR set 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. The end-time, in turn, defaults to 30 days from the start time. The extended end-time must be later than start-time.

-x Indicates that only BIND 9 must sign the DNSKEY, CDNSKEY, and CDS RR sets with key-signing keys, and must omit signatures from the zone-signing keys.
-z Indicates that the BIND 9 must ignore the KSK flag on the keys when you determine what to sign. This causes KSK-flagged keys to sign all records, not just the DNSKEY RR set.

Parameters

Item Description
zonefile Sets the file that contains the zone to be signed.
key Specifies the keys that are used to sign the zone. If no keys are specified, the zone is examined for DNSKEY records at the zone apex. If the DNSKEY records are found, the matching private keys in the current directory are used for signing.

Examples

  1. To sign the example.com zone with the ECDSAP256SHA256 key that is generated by the dnssec-keygen command (Kexample.com.+013+17247), enter the following command:

    % dnssec-signzone -g -o example.com db.example.com \
    Kexample.com.+013+17247
    db.example.com.signed
    %
    
    As the -S option is not used, the keys of the zone must exist in the primary file (db.example.com). This invocation looks for dsset files in the current directory so that the DS records can be imported from the dsset files (-g flag).

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

  2. To re-sign a previously signed zone with the default parameter, enter the following command:
    % cp db.example.com.signed db.example.com
    % dnssec-signzone -o example.com db.example.com
    db.example.com.signed
    %
    The private keys are assumed to be present in the current directory.