Sub topic 13
DNSSEC signing and chain of trust
DNS answers are not authenticated by default. A resolver that receives an answer cannot tell whether the authoritative server sent it or an attacker forged it. DNSSEC (DNS Security Extensions) adds digital signatures to DNS data so a validating resolver can detect tampering. This chapter explains how the chain of trust works, how to enable DNSSEC signing for a public hosted zone in Route 53, and how to avoid the failure modes that take a domain offline.
Prerequisites
This chapter assumes you have read the earlier chapters on hosted zones, delegation, and record types. You should know what an NS record is, how a registrar passes name servers to the parent zone, and how to use dig. You also need an AWS account with permission to manage Route 53 and AWS KMS (Key Management Service).
What DNSSEC protects, and what it does not
DNSSEC provides two guarantees:
- Data origin authentication. The answer came from the zone owner's key.
- Data integrity. The answer was not changed in transit.
It does not encrypt queries or answers. Anyone on the network path can still read them. It also does not protect the connection to your web server. For that you still need TLS. DNSSEC only protects the lookup, for example against cache poisoning, where a forged answer is placed into a resolver's cache.
DNSSEC also protects only what a resolver validates. If a user's resolver does not validate, a forged answer is accepted as before. Validation is a property of the resolver, not of your zone.
How the chain of trust works
DNSSEC uses public-key cryptography. The zone owner signs each set of records with a private key. Resolvers check the signature with the matching public key, which is published in the zone.
Three record types carry this information:
| Record | Where it lives | Purpose |
|---|---|---|
| DNSKEY | In your zone | Holds the public keys used to verify signatures |
| RRSIG | In your zone | A signature over one record set (all records with the same name and type) |
| DS | In the parent zone | A hash of your zone's key-signing key, which links the parent to your zone |
Most DNSSEC setups use two kinds of keys:
- A key-signing key (KSK) signs only the DNSKEY record set. Its hash is published as the DS record in the parent zone.
- A zone-signing key (ZSK) signs all the other record sets in the zone.
Splitting the keys lets the ZSK be rotated often without touching the parent zone. Only a KSK change requires a new DS record at the parent.
The trust starts at the DNS root, whose key is built into validating resolvers. The root signs a DS record for each top-level domain such as .com. The .com zone signs a DS record for example.com. Your zone's KSK matches that DS record, and your ZSK signs the actual answers.
A validating resolver follows the chain upward. If any link is missing or wrong, validation fails.
The important consequence is this: if the parent zone publishes a DS record that does not match any key in your zone, validating resolvers return SERVFAIL for your domain. They do not fall back to unsigned answers. Your domain becomes unreachable for every user behind a validating resolver, including large public resolvers. This is the most common and most serious DNSSEC mistake.
How a validating resolver checks an answer
When a validating resolver looks up www.example.com, it asks for the A record and also for the RRSIG that covers it. It then:
- Fetches the DNSKEY set for
example.comand verifies the RRSIG over the A record using the ZSK. - Verifies the RRSIG over the DNSKEY set using the KSK.
- Asks the
.comzone for the DS record ofexample.comand checks that it matches the KSK's hash. - Repeats the process up to the root, which it trusts by configuration.
If the zone has no DS record at the parent, the resolver treats the zone as unsigned and accepts its answers without validation. That is why a signed zone with no DS record is safe but gives no protection.
For names that do not exist, DNSSEC must also prove that absence. Route 53 uses NSEC records, which list the next existing name in the zone. A signed NSEC record lets the resolver verify that a name is really missing.
DNSSEC signing in Route 53
Route 53 supports DNSSEC signing for public hosted zones. It manages the ZSK itself, and you supply the KSK through AWS KMS.
The KMS key has strict requirements:
- It must be an asymmetric key with the key spec
ECC_NIST_P256, and its usage must be signing and verification. - It must be in the US East (N. Virginia)
us-east-1Region, regardless of where your other resources are. - Its key policy must allow the Route 53 DNSSEC service principal (
dnssec-route53.amazonaws.com) to use it.
Route 53 then creates the KSK from this key, signs the zone, and publishes the DNSKEY and RRSIG records. You do not manage the ZSK or its rotation.
Step 1: Create the KMS key
Create the key in us-east-1. The key policy must let Route 53 DNSSEC call DescribeKey, GetPublicKey, and Sign, and create grants. Because the policy is long and error-prone, the console's "Create KSK" flow can create a suitable key for you. If you create the key yourself, copy the policy from the Route 53 documentation.
aws kms create-key \
--region us-east-1 \
--key-spec ECC_NIST_P256 \
--key-usage SIGN_VERIFY \
--description "Route 53 DNSSEC KSK for example.com"The command returns a key ARN. Keep it for the next step. You should also add an alias so the key is easy to find:
aws kms create-alias \
--region us-east-1 \
--alias-name alias/example-com-ksk \
--target-key-id KEY_IDStep 2: Create the key-signing key in Route 53
aws route53 create-key-signing-key \
--hosted-zone-id ZONE_ID \
--key-management-service-arn KMS_KEY_ARN \
--name example-com-ksk \
--status ACTIVE \
--caller-reference "$(date +%s)"The --name value identifies the KSK inside Route 53. The status ACTIVE means the key can be used once signing is enabled.
Step 3: Enable signing
aws route53 enable-hosted-zone-dnssec \
--hosted-zone-id ZONE_IDThe command returns a change ID. Signing is not instant. Check the change with get-change and wait for it to reach INSYNC before moving on.
Step 4: Get the DS record data
aws route53 get-dnssec \
--hosted-zone-id ZONE_IDThe output lists the KSK and includes fields such as DSRecord, DNSKEYRecord, KeyTag, SigningAlgorithmType, DigestAlgorithmType, and DigestValue. You need these values for the parent zone. Route 53 uses algorithm 13 (ECDSA P-256 with SHA-256) and digest type 2 (SHA-256).
Step 5: Publish the DS record at the parent
The last step happens outside your hosted zone. The DS record must exist in the parent zone, which is controlled through your registrar.
- If the domain is registered with Route 53, add the DS information to the domain's registration settings, for example with
aws route53domains associate-delegation-signer-to-domain. Route 53 Domains sends it to the registry. - If the domain is registered elsewhere, open your registrar's DNSSEC settings and enter the key tag, algorithm, digest type, and digest value, or the public key, as the registrar requires.
If the registrar and the TLD registry do not support DNSSEC, you cannot complete the chain. Not every TLD does.
Order matters: avoid an outage
The order of steps protects you. Two rules keep the zone reachable:
- Sign the zone before publishing the DS record. A DS record at the parent for an unsigned zone breaks validation.
- Remove the DS record before disabling signing. If you turn signing off while the DS record is still published, validating resolvers fail the domain.
Caching adds a delay to both directions. Resolvers cache DS records at the parent for the TTL set there, and that TTL is not under your control. When you add or remove a DS record, wait for the parent's TTL, often 24 hours or more for a TLD, before you take the next step. Also lower the TTL on your own records before starting. Route 53 recommends a maximum TTL for the zone's records, and a short TTL helps recovery if something goes wrong.
Route 53 also lets you monitor DNSSEC. It can raise a CloudWatch alarm when it detects a problem that could make the zone fail validation, for example DNSSECInternalFailure and DNSSECKeySigningKeysNeedingAction. Set alarms on these metrics.
Disabling DNSSEC safely
To turn DNSSEC off:
- Remove the DS record at the registrar (or with
disassociate-delegation-signer-from-domainfor Route 53 registered domains). - Wait longer than the parent's DS TTL.
- Disable signing in Route 53.
- Delete the key-signing key if you no longer need it.
aws route53 disable-hosted-zone-dnssec \
--hosted-zone-id ZONE_ID
aws route53 delete-key-signing-key \
--hosted-zone-id ZONE_ID \
--name example-com-kskDo not delete or disable the KMS key while the zone is signed. If Route 53 cannot use the key, it cannot sign, and the zone fails validation once cached signatures expire. A KMS key with a pending deletion or a changed key policy causes this.
Verifying with dig
Use dig with the +dnssec option to ask for signatures:
dig www.example.com A +dnssec
dig example.com DNSKEY +dnssec +short
dig example.com DS +shortIn the first answer, a validating resolver sets the ad (authenticated data) flag in the header when the answer passed validation. You will also see an RRSIG record next to the A record. Querying the DS record shows what the parent publishes. If you compare its key tag and digest with the output of get-dnssec, you can confirm that the parent and your zone agree.
To bypass validation while testing, add +cd (checking disabled). If a query returns SERVFAIL normally but succeeds with +cd, the data is reachable but validation is failing, which points to a DNSSEC problem and not to a missing record.
dig www.example.com A @8.8.8.8
dig www.example.com A @8.8.8.8 +cdCommon problems
| Symptom | Likely cause | Fix |
|---|---|---|
| SERVFAIL for the domain, works with `+cd` | DS at parent does not match the KSK | Correct or remove the DS record at the registrar |
| SERVFAIL after disabling signing | DS record still published | Restore signing or remove DS, then wait for the TTL |
| `ad` flag never appears | Resolver does not validate, or no DS at parent | Test with a validating resolver; check the DS record |
| Cannot create KSK | KMS key in wrong Region, wrong key spec, or bad policy | Recreate in `us-east-1` as `ECC_NIST_P256` with the Route 53 policy |
| Registrar rejects the DS | TLD or registrar lacks DNSSEC support | Use a supported TLD or registrar |
| Failure after moving DNS provider | Old DS still at the parent | Remove the DS before the move |
Moving a signed domain to another DNS provider is a special case. Remove the DS record, wait for its TTL, move the zone, and only then re-enable DNSSEC at the new provider.
When to use DNSSEC
DNSSEC is worth the added operational care when integrity of DNS answers matters, for example for financial or government domains, or when a policy requires it. The costs are real:
- An extra KMS key, billed monthly, plus charges for the signing requests.
- Larger DNS responses, which can matter for resolvers with limited UDP packet sizes.
- A new way to cause a total outage if the chain breaks.
Alias records work with DNSSEC, and Route 53 signs the answers it returns. Private hosted zones are different: DNSSEC signing applies only to public hosted zones.
Exercise
You enabled DNSSEC signing on a Route 53 public hosted zone and published the DS record at your registrar. Some users now get SERVFAIL for your domain, and dig www.example.com A @8.8.8.8 +cd returns the correct address. What does this tell you, and what should you check first?
Show answer
The records are present and correct, but validation fails. The usual cause is a mismatch between the DS record at the parent and the key-signing key in your zone. Run aws route53 get-dnssec to get the key tag and digest, compare them with dig example.com DS +short, and fix or remove the DS record at the registrar. Also confirm that the KMS key is still enabled.
Exercise
A team wants to move a signed domain from Route 53 to another DNS provider. In what order should they remove the DS record, move the zone, and wait for the TTL, and why?
Show answer
Remove the DS record first, then wait longer than the parent's DS TTL, then move the zone. If the zone moves while the old DS is still cached or published, validating resolvers look for a signature from a key the new provider does not have and return SERVFAIL. DNSSEC can be enabled again at the new provider after the move.