XiaTools

How to Verify DNSSEC Chain of Trust Using Advanced Command Line Tools

Updated 09 Oct 2026

Verifying the Domain Name System Security Extensions (DNSSEC) chain of trust via the command line requires querying cryptographic resource records—such as RRSIG, DNSKEY, and DS—and validating them step by step from the root zone down to your target domain. This process ensures that DNS responses have not been tampered with and originate from an authoritative source. In this guide, you will learn how to use native command-line utilities to manually inspect every link in the cryptographic chain.

Before diving into complex cryptographic validation, you can perform quick, everyday lookups and check basic record configurations using tools like the NS Lookup utility, which helps you quickly inspect standard resource records before verifying their cryptographic signatures.

Understanding the DNSSEC Validation Path

DNSSEC does not encrypt DNS traffic; instead, it provides origin authentication and data integrity through public-key cryptography. Every zone in the hierarchy signs its DNS records with a Zone Signing Key (ZSK) and signs those keys using a Key Signing Key (KSK).

The chain of trust operates on a parent-child relationship:

  1. Root Zone (.): The anchor of trust.
  2. Top-Level Domain (TLD, e.g., .com): The root zone holds a DS record pointing to the TLD's public key.
  3. Second-Level Domain (e.g., example.com): The TLD zone holds a DS record pointing to example.com's public key.

If any signature along this path fails validation, the resolver treats the domain as insecure or bogus, blocking the traffic to protect users from cache poisoning.

Step-by-Step Command Line Verification Using Dig

The dig utility is the most powerful tool for DNSSEC inspection because it allows you to request DNSSEC records explicitly and trace delegation paths.

Step 1: Query with the DNSSEC OK Flag

To verify if a domain supports DNSSEC and returns the necessary cryptographic signatures, send a query with the +dnssec flag enabled.

dig example.com SOA +dnssec

Examine the output section. Look for the RRSIG record associated with the SOA (Start of Authority) record.

;; ANSWER SECTION:
example.com.        3600    IN      SOA     ns1.example.com. hostmaster.example.com. (
                                2023100101 ; serial
                                7200       ; refresh
                                3600       ; retry
                                1209600    ; expire
                                3600 )     ; minimum
example.com.        3600    IN      RRSIG   SOA 8 2 3600 (
                                20231101000000 20231001000000 12345 example.com. (
                                ...signature data... )

If the RRSIG record appears, the domain is actively signing its zone data.

Step 2: Retrieve the Zone Keys (DNSKEY)

Next, query the DNSKEY records for the domain to inspect the public keys used to generate those signatures.

dig example.com DNSKEY +dnssec

Look for flags in the answer section:

  • Flag 256: Zone Signing Key (ZSK), used to sign zone records.
  • Flag 257: Key Signing Key (KSK), used to sign the DNSKEY RRset and establish trust with the parent zone.

Step 3: Check the Delegation Signer (DS) Record in the Parent

To complete the chain of trust, the parent zone (for instance, .com) must contain a DS (Delegation Signer) record that matches the KSK of the child zone (example.com). Query the parent zone directly.

dig ds example.com +trace

Compare the key tag, algorithm, and digest type in the DS record returned by the parent with the calculated hash of the child's KSK.

Automated Validation with Delv

If manual inspection using dig is too tedious, the delv (Domain Lookup and Validation) utility—part of the BIND package—automatically performs full DNSSEC validation and reports the results.

delv example.com

Sample successful output:

;;, validating example.com/A/IN:
;; resolution success:, source 192.0.2.1#53
example.com.        3600    IN      A       192.0.2.5
example.com.        3600    IN      RRSIG   A 8 2 3600 (...) 

If validation fails, delv explicitly prints an error message indicating a broken trust anchor or an expired signature.

Comparison of DNSSEC Verification Tools

Tool Primary Purpose Supports Automatic Validation Best Used For
dig General DNS querying Manual only Inspecting specific records, signatures, and key flags
delv DNSSEC-aware resolution Fully Automated End-to-end validation testing and debugging
nslookup Basic DNS queries No Quick operational checks and IP resolution
OpenSSL Cryptographic hashing Manual calculation Verifying DS record digests against KSK outputs

Common DNSSEC Mistakes and How to Fix Them

Even experienced engineers encounter cryptographic failures due to subtle configuration errors. Here are the most frequent pitfalls:

  • Expired Signatures: RRSIG records have strict validity windows. If your clock is out of sync or your automated signing daemon (like dnssec-signzone or BIND inline signing) fails to refresh signatures, valid lookups will fail. Fix this by checking NTP synchronization and reviewing zone-signing logs.
  • Algorithm Mismatch: The hashing algorithm used in the DS record (e.g., SHA-256) must match the algorithm used to generate the KSK. Update your registrar records if you recently upgraded your cryptographic suite.
  • Parent-Child Key Mismatch: If you rotate your KSK without submitting the new DS record to your domain registrar, the chain of trust breaks immediately. Always upload the new DS record to your registrar before retiring the old KSK.

Quick DNSSEC Verification Checklist

Use this operational checklist when auditing your zone's security posture:

  • Confirm RRSIG records are present for all standard resource types (A, AAAA, MX, TXT).
  • Verify that both ZSK (256) and KSK (257) keys exist in the DNSKEY query output.
  • Ensure the parent zone's DS record perfectly matches the hash of your domain's KSK.
  • Test the domain using delv or an online validator to ensure no validation errors occur.
  • Monitor signature expiration dates to prevent sudden outages.

By systematically querying keys, signatures, and delegation records using command-line tools, you can isolate misconfigurations, verify cryptographic integrity, and maintain a robust, secure DNS infrastructure.

Frequently asked questions

What is the difference between a ZSK and a KSK in DNSSEC?

The Zone Signing Key (ZSK) signs the everyday resource records within a zone, such as A and MX records. The Key Signing Key (KSK) signs the DNSKEY record set itself, creating the secure link between the child zone and the parent zone's DS record.

Why does my dig query return an RRSIG record but delv reports validation failure?

An RRSIG record's presence only proves the zone is signed, not that the signature is valid. Validation failure typically occurs due to an expired signature, a mismatch between the child's KSK and the parent's DS record, or a missing trust anchor.

How often do DNSSEC signatures need to be refreshed?

Signature validity periods vary based on administrator policy, but they usually last between one to four weeks. Automated zone signers should refresh and re-sign records well before the expiration window closes to prevent validation failures.

Can I use standard public resolvers like 8.8.8.8 to test DNSSEC validation?

Yes, public recursive resolvers perform validation automatically. If a domain has a broken DNSSEC chain, querying a validating resolver will return a SERVFAIL error instead of the IP address.

What should I do if my registrar does not support my preferred DNSSEC algorithm?

You must use an algorithm supported by both your DNS hosting provider and your domain registrar. Most modern registries and registrars fully support algorithm 13 (ECDSA P-256 with SHA-256) and algorithm 8 (RSA/SHA-256).

Related articles

Free tools