DNS & Domain Names

DNSSEC Explained

Learn how DNSSEC signs DNS records, how the chain of trust works, what it protects against and how to run it safely.

Key takeaways

  • DNSSEC lets resolvers check that DNS data is authentic and unchanged, using public-key signatures.
  • Trust flows from the root zone downward, with each parent vouching for its child through a DS record.
  • It provides no privacy, since queries and answers remain readable unless you also encrypt the transport.
  • A mismatch between the DS record and your zone's keys makes the whole domain fail for validating resolvers.

DNSSEC, short for DNS Security Extensions, adds digital signatures to DNS so a resolver can verify that an answer really came from the domain's owner and wasn't altered on the way. If the check fails, a validating resolver refuses to hand out the answer.

It protects against forged records. It doesn't encrypt anything, hide what you look up or tell you whether a website is honest. The core specifications are RFC 4033, 4034 and 4035.

The problem it solves

Original DNS was designed without any way to prove an answer's origin. A resolver sends a question, usually over UDP, and accepts a reply that appears to match. Anyone who can forge a convincing reply, or tamper with traffic along the path, can send users to a different address.

Defenses such as randomized query IDs and source ports make blind forgery much harder, but they don't prove anything about the data. DNS spoofing and cache poisoning explains the threat. DNSSEC answers it with cryptography: the data itself carries proof.

How signing works

The zone owner holds a private key. For each set of records, such as all the A records at one name, the signing system computes a signature and publishes it alongside. Anyone with the matching public key can check it. Changing even one byte of the records breaks the verification.

DNSSEC introduces several record types.

Record Holds Role
RRSIG A signature over one record set Proves the records are intact
DNSKEY The zone's public keys Used to check signatures
DS A digest of a child zone's key Lives in the parent and links the two
NSEC or NSEC3 Information about gaps in the zone Proves a name or type does not exist

Signatures have start and expiry times. A signed zone has to be re-signed regularly, which is why automation matters.

Many zones use two kinds of key. A zone signing key signs the ordinary records. A key signing key signs the DNSKEY set and is the one the parent's DS record refers to. This split lets you rotate the everyday key without involving the parent. Some setups use a single combined key instead.

The chain of trust

A signature is only useful if you can trust the key. DNSSEC solves this by following the DNS hierarchy.

A validating resolver ships with one thing it trusts in advance: the key of the root zone, called the trust anchor. The root zone publishes a signed DS record for .com. That DS record matches a key in .com, which in turn publishes a signed DS record for example.com. That one matches a key in your zone, which signs your records.

The chain of trust for www.example.com
Trust anchor The resolver already holds the root zone's key. Root zone Signs a DS record that vouches for the .com key. .com zone Signs a DS record that vouches for the example.com key. example.com zone Its DNSKEY records sign the zone's own data. The answer The A record arrives with an RRSIG the resolver can verify. Trust anchor The resolver already holds the root zone's key. Root zone Signs a DS record that vouches for the .com key. .com zone Signs a DS record that vouches for the example.com key. example.com zone Its DNSKEY records sign the zone's own data. The answer The A record arrives with an RRSIG the resolver can verify.

If any link is missing in a deliberate, provable way, for instance the parent securely states that there's no DS record, the child is treated as unsigned and answers are accepted as before. If a link exists but doesn't verify, the answer is treated as bogus.

What happens during validation

Validation normally happens in the recursive resolver. It fetches your records, their signatures and the keys up the chain, then checks each step. Keys and DS records are cached, so the extra work is modest after the first lookup.

  • Secure: the chain verifies. The resolver returns the data and can set the AD, or "authentic data", flag.
  • Insecure: the zone is provably unsigned. Data is returned without that flag.
  • Bogus: verification fails. The resolver returns SERVFAIL.

Your device usually trusts the resolver's verdict. That means the link between you and the resolver is not covered by DNSSEC itself. Using a resolver you trust over an encrypted connection, as described in DNS over HTTPS and DNS over TLS, closes that gap. Some systems can also validate locally.

Proving that something doesn't exist

Forging a "no such name" reply is also an attack, so denials need signatures too. DNSSEC can't sign every possible nonexistent name in advance. Instead, NSEC records list the next existing name in order, proving that nothing lies between two entries.

A side effect is that someone can walk the NSEC chain and list the names in a zone. NSEC3 uses hashed names to make that harder, though guessable names can still be recovered with effort. Some providers generate narrow denial records on the fly. Either way, don't treat unlisted hostnames as secrets.

Checking a domain

On macOS or Linux, dig shows the pieces.

dig example.com DS +short
dig example.com DNSKEY +short
dig @1.1.1.1 example.com A +dnssec

In the last output, look for RRSIG records in the answer and for ad among the flags. To test whether a failure is DNSSEC related, add +cd to disable checking for one query. If the plain query returns SERVFAIL and the +cd version succeeds, validation is the problem. NXDOMAIN, SERVFAIL and other errors covers that diagnosis.

Reading a DNSSEC check
Does a normal query fail with SERVFAIL but succeed with +cd? YES Validation is failing. Compare the DS record with the zone's keys and signature dates. 1 NO Is there no DS record in the parent zone? YES The domain is unsigned as far as resolvers are concerned. 2 NO Does the answer carry the ad flag? YES Your resolver validated the chain successfully. 3 NO Check the resolver It may not validate. Try one that is documented to perform DNSSEC validation. Does a normal query fail with SERVFAIL but succeed with +cd? 1 IF YES Validation is failing. Compare the DS record with the zone's keys and signature dates. NO Is there no DS record in the parent zone? 2 IF YES The domain is unsigned as far as resolvers are concerned. NO Does the answer carry the ad flag? 3 IF YES Your resolver validated the chain successfully. NO Check the resolver It may not validate. Try one that is documented to perform DNSSEC validation.

Turning it on

With a managed DNS provider, enabling DNSSEC is often short.

  1. Turn on signing at your DNS host.
  2. The host shows DS record details: a key tag, an algorithm number, a digest type and a digest.
  3. Enter them at your registrar, which passes them to the registry. If the same company provides both, this may happen automatically.
  4. Verify with a validating resolver once caches update.

Order matters. Sign the zone first, publish the DS record second. To turn DNSSEC off, reverse it: remove the DS record, wait out its TTL, then stop signing.

Some registries and DNS hosts can synchronize keys automatically using CDS and CDNSKEY records, defined in RFC 7344 and related documents. Support varies, so check both sides.

Changing keys safely

Keys are replaced from time to time, either on a schedule, after a suspected exposure or when moving to a newer algorithm. This is called a rollover. The difficulty is caching: resolvers may hold old keys and old signatures while fetching new ones, and every combination they can assemble has to verify.

The usual technique is overlap. For a zone signing key, publish the new public key first, wait until caches have it, start signing with it, then remove the old key after old signatures have expired from caches. For a key signing key, the parent's DS record also has to change. You add the new key, add or swap the DS record at the registrar, wait out the DS TTL and only then retire the old key.

Managed providers handle zone key rollovers silently. Ask how yours handles the key that requires a DS change, since that step sometimes needs you. Algorithm changes are the most delicate kind and are best left to software that supports them explicitly.

Common algorithms include RSA with SHA-256 and elliptic curve signatures using the P-256 curve. The elliptic curve option produces much smaller keys and signatures, which keeps responses compact. Use what your provider and registry support, and avoid choosing algorithms that current guidance has retired.

Signing when you run your own servers

If you operate authoritative servers yourself, use the automated signing features of your DNS software instead of hand-run scripts. Modern packages can generate keys, sign, re-sign before expiry and schedule rollovers from a policy you define.

Check that secondaries receive the signed zone, that private keys are readable only by the signing process and backed up securely, and that server clocks are synchronized. NTP keeps those clocks honest.

What can go wrong

  • Expired signatures. Automation stops and signatures age out.
  • Stale DS record. You change DNS providers or roll keys without updating the parent.
  • Unsupported algorithm or typo when copying DS details by hand.
  • Clock errors on a validating system, which make good signatures look expired or not yet valid.
  • Large responses. Signatures make answers bigger, and networks that block DNS over TCP can cause failures.

Because a mistake takes the domain offline for many users, monitor signature expiry and validation from outside your network. Plan provider moves carefully, as laid out in migrating DNS without downtime.

Is it worth it?

The case for it is strong where forged DNS would be costly: financial services, government, mail infrastructure and any zone publishing security data. DNSSEC is also required for DANE, which uses DNS to publish certificate information, notably for mail transport.

The case against rests on operational risk and limited coverage. Not every resolver validates, HTTPS already stops many impersonation attempts against websites and a botched key change causes a real outage. With a provider that automates signing and DS updates, the risk drops considerably. If you'd have to manage keys by hand without monitoring, weigh that honestly.

What it does not do

DNSSEC doesn't encrypt queries, stop a thief who controls your registrar account, block phishing domains that are validly signed or defend against denial-of-service attacks. An attacker who takes over your registrar login can replace both name servers and DS records, so account protection still comes first. Domain hijacking covers that side.

Common questions

Do I need to do anything as an ordinary user?

Mostly you benefit by using a resolver that validates. Many large public resolvers do, and their documentation says so.

Does DNSSEC slow down browsing?

It adds some lookups and larger responses. Caching absorbs most of the cost, so it's rarely noticeable.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in DNS & Domain Names →

Latest news on this topic