Sub topic 13
DNSSEC signing and chain of trust
This chapter assumes you can create a public hosted zone, delegate a domain to its name servers, and use dig. You also need basic familiarity with the AWS CLI and with AWS KMS keys.
What DNSSEC adds
Plain DNS answers are not authenticated. A resolver cannot tell whether a response came from the real authoritative server or from an attacker who forged it. DNSSEC (DNS Security Extensions) adds digital signatures to DNS data. A validating resolver checks those signatures and returns SERVFAIL when they do not verify.
DNSSEC does not encrypt queries. It proves that the data is authentic and unmodified.
The chain of trust
Each zone signs its records with a private key and publishes the matching public key as a DNSKEY record. Two key roles are involved:
- The zone-signing key (ZSK) signs the records in the zone. Route 53 creates and rotates it for you.
- The key-signing key (KSK) signs the DNSKEY set. You supply it, backed by a KMS key.
The parent zone holds a DS (delegation signer) record, which is a hash of your KSK's public key. A resolver follows this chain from the root down. Each level vouches for the next.
If the DS record in the parent does not match your KSK, the chain breaks and validating resolvers reject every answer for the domain.
Enabling DNSSEC in Route 53
DNSSEC signing works only on public hosted zones. The KMS key must be an asymmetric key in us-east-1, with the key spec ECC_NIST_P256 and the usage SIGN_VERIFY. Its key policy must allow the service principal dnssec-route53.amazonaws.com to use it, including kms:DescribeKey, kms:GetPublicKey, kms:Sign and kms:CreateGrant. The console adds this policy for you. With the CLI you must write it yourself.
aws kms create-key \
--region us-east-1 \
--key-spec ECC_NIST_P256 \
--key-usage SIGN_VERIFY
aws route53 create-key-signing-key \
--hosted-zone-id ZONE_ID \
--key-management-service-arn arn:aws:kms:us-east-1:111122223333:key/KEY_ID \
--name example-ksk \
--status ACTIVE \
--caller-reference "$(date +%s)"
aws route53 enable-hosted-zone-dnssec --hosted-zone-id ZONE_IDThen fetch the DS record to publish in the parent:
aws route53 get-dnssec --hosted-zone-id ZONE_IDThe output lists each key-signing key with its DSRecord, DNSKEYRecord, key tag and algorithm. Add the DS record at the parent. If the domain is registered with Route 53, add it through the registered domain's DNSSEC settings. If it is registered elsewhere, add it at that registrar. For a subdomain such as app.example.com, add it as a DS record in the parent hosted zone.
Verify the result:
dig DS example.com +short
dig example.com A +dnssecA validating resolver sets the ad (authenticated data) flag in the response header. The second command also shows RRSIG signature records alongside the answer.
Order of operations and common errors
The order matters because a mismatch between the parent and the zone causes an outage.
- Lower the TTL on your records and on the DS record at the parent, if you control it, and wait out the old TTL. This limits how long a mistake stays cached.
- Enable signing in Route 53.
- Add the DS record at the parent.
- Test with
digagainst a validating resolver.
To turn DNSSEC off, reverse the order:
- Remove the DS record at the parent.
- Wait for the DS TTL to expire.
- Disable signing in the hosted zone.
Disabling signing while the DS record is still published makes the domain fail validation.
Other common errors:
- SERVFAIL after enabling: The DS record at the parent does not match the KSK, or it was added before signing was active.
- KSK status goes to ACTION_NEEDED: Route 53 cannot use the KMS key. The key policy may be wrong, or the key may be disabled or deleted. Fix the key and reactivate the KSK.
- Transferring DNS to another provider: Remove the DS record first. Otherwise the new provider's unsigned zone fails validation.
Exercise
You enabled DNSSEC signing on example.com and published the DS record. Later you want to move the zone to another DNS provider. What should you do first, and why?
Show answer
Remove the DS record from the parent zone or registrar and wait for its TTL to expire. If the DS record stays published, the new provider's unsigned zone does not match it. Validating resolvers then return SERVFAIL for the domain.