Menu: runbooks, process, how-to, NIS2, wireless

How-to H8

Status
Published
Last reviewed
Written

Export a DNS zone and check DS records

Keep a copy of your zone where you can reach it when the domain is broken, and check that the DNSSEC delegation at the parent matches the zone's keys.

Before you start

  • Where your zone is hosted, and whether your provider offers a zone file export in its console. Most hosted DNS providers do. Use that first.
  • A place to keep the copy that does not depend on the domain: not a mailbox or a share on that same domain. A printed copy in the binder and a file on an offline USB stick both work.
  • A Linux or macOS machine with dig and delv (BIND tools), or a Windows machine with them installed.
  • Your registrar login, which is where the DS record is set. Check that someone other than you can sign in to it.

Steps

1. Export the zone from your provider

Use the provider’s export function and save the file with the date in its name. This is the best copy, because it includes every record, not only the ones you remember.

2. On a Windows DNS server (Active Directory integrated zone)

Export-DnsServerZone -Name "<yourdomain>" -FileName "<yourdomain>-export.dns"

Source: Export-DnsServerZone, Microsoft Learn

Microsoft: the file goes to C:\Windows\System32\dns by default, and “is not in the same format as a file-backed zonefile”. It is for your records and troubleshooting, not for loading into another provider unchanged.

3. If your own primary allows zone transfers to your address

dig AXFR <yourdomain> @<your-primary-name-server>

Source: dig, BIND 9 manual pages

Most providers refuse zone transfers to the public. A refusal is correct, not a fault. Use step 1 instead.

4. Read the DS record at the parent and the keys in the zone

dig +short DS <yourdomain>
dig +multiline DNSKEY <yourdomain>

Source: dig, BIND 9 manual pages

The DS record shows a key tag, an algorithm number and a digest. The multi-line DNSKEY output shows each key’s key tag in a comment. The DS key tag should match one of the keys, usually the key signing key.

5. Work out the DS the keys should produce, and compare

dig dnskey <yourdomain> | dnssec-dsfromkey -f - <yourdomain>

Source: dnssec-dsfromkey, BIND 9 manual pages (this exact pipeline is the manual’s own example)

One of the lines printed should be identical to the DS record from step 4.

6. Check that validation works end to end

delv <yourdomain> SOA

Source: delv, BIND 9 manual pages

The manual: records returned by delv “are either fully validated or were not signed. If validation fails, an explanation of the failure is included in the output.”

What good and bad look like

  • Good: you have a dated export stored off the domain; the DS at the parent matches one of the zone’s keys; delv reports the answer as fully validated.
  • Fine: no DS record and the zone is not signed. DNSSEC is simply not in use. That is a decision, not a fault.
  • Bad, act now: a DS record at the parent that matches no key in the zone, or delv reporting a validation failure. Validating resolvers will treat the domain as broken. Go to R5 DNS or domain broken.

Traps

  • Changing DNS provider with DNSSEC on. If the parent still points (DS) at the old provider’s keys when the new provider starts answering, validation fails for everyone who validates. RFC 6781 describes how to change DNS operators with DNSSEC; agree the order with both providers before you start.
  • The registrar is not the DNS host. The DS record lives at the registrar; the keys live at the DNS host. A change at one needs a matching change at the other.
  • An export saved only in your mailbox on the same domain, which you cannot reach when the domain is broken.
  • Old exports. An export from last year is missing last month’s records. Export after every change and at least once a quarter.

Undo

Steps 1 to 6 only read. There is nothing to undo.

Record it

Example included. The row marked Example is made up to show the format. Delete it and add your own rows.

Date Zone Export stored where DS present? DS matches a key? delv result Initials
Example: 2026-12-07 example.com Binder and offline USB stick Yes Yes, key tag matches Fully validated AB

Sources

Was this useful?

Esc
↑ ↓ moveEnter openEsc close