Support Library
Troubleshooting DNS on AWS Route 53
Fix the common DNS problems on AWS Route 53: name servers that do not match the hosted zone, alias versus CNAME at the apex, private and public hosted zones that disagree, subdomain delegation, and DNSSEC key signing keys that need action.
The short answer
Route 53 is two services that are easy to confuse: a registrar (Registered domains), which tells the parent zone which name servers to use, and an authoritative DNS host (Hosted zones), which answers queries from four name servers assigned to each zone. Most broken setups are a disagreement between the two, a hosted zone that only some clients can see, or a DNSSEC chain that no longer matches. Match the symptom first:
| Symptom | Usually means | Section |
|---|---|---|
| Records look right in the console but the domain does not resolve, or resolves to old values | The registered domain lists different name servers from the hosted zone, often after the zone was deleted and recreated | Name servers |
| Two hosted zones with the same name, and edits seem to do nothing | You are editing the zone the domain is not delegated to | Name servers |
| Cannot create a CNAME for example.com | CNAME is not allowed at the zone apex; use an alias record | Alias vs CNAME |
| Site works over IPv4 but not IPv6 | Only an A alias exists; CloudFront with IPv6 needs an AAAA alias too | Alias vs CNAME |
| A name resolves on the internet but returns NXDOMAIN inside a VPC | A private hosted zone with the same name is associated with the VPC and lacks that record | Private and public zones |
| Subdomain answers inconsistently | Records for it exist in both the parent zone and a delegated child zone | Subdomains |
| SERVFAIL from validating resolvers, or a KSK shows Action needed | The DS record does not match, or Route 53 lost access to the KMS key behind the key signing key | DNSSEC |
Step 1: make the registered domain and the hosted zone agree
When you create a public hosted zone, Route 53 assigns it a delegation set of four name servers, spread across different top-level domains (for example one ending in .com, one in .net, one in .org and one in .co.uk). The domain only works when the registrar publishes exactly those four as the domain's NS records in the parent zone. This is the most common Route 53 failure, and it happens in a few predictable ways:
- The hosted zone was deleted and recreated. A new zone gets another set of four name servers, and AWS notes that typically none of them match the old ones. Registering a domain with Route 53 creates a hosted zone for you; delete it and recreate it, and the registered domain still points at the old, now unused, servers.
- There are two hosted zones with the same name. Route 53 lets you create more than one public hosted zone for the same domain, each with its own name servers. Only the one the registrar points at is live; the other is a silent copy.
- Someone edited the zone's NS record instead of the domain. The NS record inside the hosted zone should list the zone's own delegation set. Changing it to match the registrar does not move the delegation; it only makes the zone describe itself wrongly.
- The domain is registered elsewhere. If the registrar is not Route 53, the four name servers must be entered at that registrar. Nothing in the Route 53 console changes the parent zone.
To compare the two in the console, open Hosted zones, select the zone and read Name servers in the details pane; then open Registered domains, select the domain and read the name servers under Details. To fix a mismatch, choose Actions > Edit name servers on the registered domain and paste in the hosted zone's four names. From the command line:
| Check | Command |
|---|---|
| Find every hosted zone with this name and its ID | aws route53 list-hosted-zones-by-name --dns-name example.com |
| The four name servers of one hosted zone (field DelegationSet.NameServers) | aws route53 get-hosted-zone --id Z0123456789EXAMPLE |
| The name servers the registered domain uses (runs only in us-east-1) | aws route53domains get-domain-detail --region us-east-1 --domain-name example.com |
| Point the registered domain at the hosted zone | aws route53domains update-domain-nameservers --region us-east-1 --domain-name example.com --nameservers Name=ns-2048.awsdns-64.com Name=ns-2049.awsdns-65.net Name=ns-2050.awsdns-66.org Name=ns-2051.awsdns-67.co.uk |
Then confirm what the rest of the internet sees, from outside AWS:
| Check | macOS or Linux | Windows PowerShell |
|---|---|---|
| Delegation the parent publishes (ask a .com server directly; use your TLD's servers from dig NS com) | dig NS example.com @a.gtld-servers.net +norecurse | Resolve-DnsName example.com -Type NS -Server a.gtld-servers.net -NoRecursion |
| What a recursive resolver returns (may show the zone's own NS records instead of the parent's) | dig NS example.com +short | Resolve-DnsName example.com -Type NS |
| Full path from the root | dig example.com +trace | No built-in trace: query each level yourself with -Server and -NoRecursion, as in the parent row |
| Ask one of the zone's own servers directly | dig @ns-2048.awsdns-64.com example.com SOA | Resolve-DnsName example.com -Type SOA -Server ns-2048.awsdns-64.com |
Compare the parent's answer with the hosted zone's four names: a recursive lookup can return the NS records inside the zone, which hides exactly the mismatch you are looking for. A parent that lists name servers which do not host the zone is a lame delegation. Name server changes can take up to two days to settle because the parent's NS records carry long TTLs. If the domain is DNSSEC signed, replacing the hosted zone also replaces its keys, so remove the DS record first (see Step 5). For a clean move between zones or providers, follow moving DNS providers without downtime.
Step 2: alias records vs CNAME at the apex
A CNAME cannot sit at the zone apex next to the NS and SOA records every zone needs (see CNAME at the zone apex). Route 53 solves this with alias records: an A or AAAA record whose answer Route 53 looks up from an AWS resource at query time. The differences matter when debugging:
| Alias record | CNAME record | |
|---|---|---|
| Zone apex (example.com) | Allowed | Not allowed |
| What resolvers see | A or AAAA addresses, with no CNAME in the answer | A CNAME, then the target's records |
| Targets | CloudFront, Elastic Load Balancing, API Gateway, S3 website endpoints, Elastic Beanstalk, Global Accelerator, App Runner, VPC interface endpoints, another record in the same zone, and more | Any host name, inside or outside AWS |
| TTL | Set by the target, not by you | Set by you |
| Query charges | No charge for alias queries to AWS resources | Charged like other queries |
Problems that come up again and again:
- Pointing the apex at an outside service. An alias can only target AWS resources or records in the same zone. For a host outside AWS, use the A records that service publishes, or put the site on www with a CNAME and redirect the apex.
- IPv6 missing. For a CloudFront distribution with IPv6 enabled, AWS says to create two alias records, an A and an AAAA. With only the A, IPv6 clients get no address.
- Hard-coded load balancer addresses. Load balancer and CloudFront addresses change. An A record holding today's addresses breaks later; an alias follows them.
- Evaluate target health set but nothing fails over. With simple routing the setting has no effect. It only steers traffic away from unhealthy targets in failover, weighted, latency and other routing policies, and only for targets such as Elastic Load Balancing and Elastic Beanstalk that report health.
| Check | macOS or Linux | Windows PowerShell |
|---|---|---|
| Apex addresses | dig A example.com +short | Resolve-DnsName example.com -Type A |
| Apex IPv6 addresses | dig AAAA example.com +short | Resolve-DnsName example.com -Type AAAA |
| Subdomain target | dig CNAME www.example.com +short | Resolve-DnsName www.example.com -Type CNAME |
Step 3: private and public hosted zones (split horizon)
A private hosted zone answers only for the VPCs associated with it. Giving it the same name as a public zone is a common way to run split-horizon DNS, and it is where most "works outside, fails inside" reports come from. The rules that explain them:
- The private zone wins inside the VPC, with no fallback by default. If a name exists in the public zone but not in the private one, the VPC Resolver returns NXDOMAIN and does not retry against public DNS. Copy every record VPC clients need into the private zone. Route 53 also offers an opt-in public DNS fallback setting on private hosted zones (Edit hosted zone > Enable public DNS fallback, available on the zone's advanced tier); it does not apply to the zone apex, wildcard matches or delegated subdomains.
- The VPC must have DNS turned on. Both enableDnsSupport and enableDnsHostnames must be true for private hosted zones to work.
- Clients must use the VPC Resolver. It listens at the base of the VPC range plus two (for 10.0.0.0/16, that is 10.0.0.2). An instance configured to use a public resolver or an on-premises server never sees the private zone.
- Overlapping private zones use the most specific match. With private zones for example.com and dev.example.com on the same VPC, queries under dev.example.com only ever look in the second one.
- Resolver forwarding rules beat private zones for the same name. If a VPC Resolver rule forwards example.com to your data center and a private zone for example.com is also associated, queries go to the data center and the private zone is ignored.
- Other accounts need an authorization. To associate a VPC in another account, the zone owner authorizes it, the VPC owner associates it, and the zone owner can then delete the authorization (commands below). The console cannot do the first step.
Test from an instance inside the VPC and compare with a public resolver:
| Check | Linux instance | Windows instance |
|---|---|---|
| Answer from the VPC Resolver | dig @10.0.0.2 app.example.com | Resolve-DnsName app.example.com -Server 10.0.0.2 |
| Answer the internet sees | dig @1.1.1.1 app.example.com | Resolve-DnsName app.example.com -Server 1.1.1.1 |
| Which resolver the instance uses | resolvectl status | Get-DnsClientServerAddress |
| Cross-account step | Run by | Command |
|---|---|---|
| 1. Authorize the VPC | Zone owner | aws route53 create-vpc-association-authorization --hosted-zone-id Z0123456789EXAMPLE --vpc VPCRegion=us-east-1,VPCId=vpc-0abc1234 |
| 2. Associate the VPC | VPC owner | aws route53 associate-vpc-with-hosted-zone --hosted-zone-id Z0123456789EXAMPLE --vpc VPCRegion=us-east-1,VPCId=vpc-0abc1234 |
| 3. Remove the authorization (the association stays) | Zone owner | aws route53 delete-vpc-association-authorization --hosted-zone-id Z0123456789EXAMPLE --vpc VPCRegion=us-east-1,VPCId=vpc-0abc1234 |
An NXDOMAIN inside and an answer outside points at a private zone that lacks the record. Remember that resolvers cache NXDOMAIN for the SOA negative TTL, so a record added a moment ago may still fail briefly (see negative caching).
Step 4: delegating a subdomain to another hosted zone
To hand dev.example.com to another team or account, create a public hosted zone named dev.example.com, then in the parent zone create an NS record named dev whose values are the child zone's four name servers. AWS suggests a TTL of 172800 seconds for that NS record. Then:
- Remove the subdomain's records from the parent. AWS warns that keeping records for the subdomain in both zones makes DNS behavior inconsistent. After delegation, the parent should hold only the NS record (and a DS record if the child is signed).
- Copy the child's real name servers. Pasting the parent's own four name servers into the delegation sends resolvers back to the parent, which answers with the same referral again; most resolvers give up with SERVFAIL.
- Delete the delegation when you delete the child zone. An NS record pointing at name servers that no longer host the zone is a dangling delegation, and someone else may be able to create a zone there. See dangling DNS and subdomain takeover.
| Check | macOS or Linux | Windows PowerShell |
|---|---|---|
| Referral the parent zone gives (should list the child's four servers) | dig NS dev.example.com @ns-2048.awsdns-64.com +norecurse | Resolve-DnsName dev.example.com -Type NS -Server ns-2048.awsdns-64.com -NoRecursion |
| Full path from the root | dig NS dev.example.com +trace | No built-in trace: query each level yourself with -Server and -NoRecursion, as in the parent row |
Here ns-2048.awsdns-64.com stands for one of the parent zone's name servers. More background in delegation and glue records.
Step 5: DNSSEC signing, KSKs and ZSKs
Route 53 can sign public hosted zones (not private ones). You manage the key signing key (KSK), which is backed by a customer managed AWS KMS key; Route 53 manages the zone signing key (ZSK) and rotates it for you. The KMS key must be in US East (N. Virginia), asymmetric with the ECC_NIST_P256 key spec, used for sign and verify, and its key policy must let the dnssec-route53.amazonaws.com service call DescribeKey, GetPublicKey and Sign. A zone can have up to two KSKs, which is what makes a KSK rollover possible.
| Status | Where you see it | What to do |
|---|---|---|
| SIGNING / NOT_SIGNING | Hosted zone signing status | Normal states. A zone that is signing but has no DS record at the parent is signed but not validated |
| ACTIVE / INACTIVE | Key signing key | Normal. An inactive KSK no longer signs the DNSKEY set; its DS record must not be the only one at the parent |
| ACTION_NEEDED | Zone or KSK | Route 53 lost access to the KMS key, usually a changed key policy or a disabled or scheduled-for-deletion key. Restore access before the zone's signatures expire, or validating resolvers will return SERVFAIL |
| INTERNAL_FAILURE | Zone or KSK | You cannot change other DNSSEC settings until it clears. Retry activating or deactivating the KSK |
| DELETING | Zone or KSK | A deletion is in progress |
Watch the CloudWatch metrics DNSSECKeySigningKeysNeedingAction and DNSSECInternalFailure (namespace AWS/Route53, read in us-east-1) and alarm on any value above zero. Check the zone's signing status and KSKs with the get-dnssec command in the table below.
Enabling safely. AWS's order is: lower the zone's highest TTL to one hour and lower the SOA TTL and minimum, enable signing, wait at least the old highest TTL, watch for errors (AWS suggests up to two weeks), and only then add the DS record at the parent. For a domain registered with Route 53 you add the key under Registered domains > DNSSEC keys; for another registrar, give it the DS values from the KSK's View information to create DS record panel.
Disabling safely. Reverse it: remove the DS record from the parent first, wait for the DS TTL to expire, then disable signing and deactivate the KSK. Disabling signing while the DS is still published, deleting the KMS key, or replacing the hosted zone of a signed domain all break the chain of trust and take the domain offline for every validating resolver.
| Check | Command |
|---|---|
| Signing status and KSK states | aws route53 get-dnssec --region us-east-1 --hosted-zone-id Z0123456789EXAMPLE |
| DS record at the parent | dig DS example.com +short |
| DNSKEY set the zone serves | dig DNSKEY example.com +multiline |
| Is validation the cause? (an answer only with +cd means yes) | dig example.com A @1.1.1.1 +cd |
| Windows equivalent with DNSSEC records | Resolve-DnsName example.com -Type DS -DnssecOk |
See debugging DNSSEC validation errors, DNSSEC key rollovers and broken vs missing DNSSEC.
How DNS Panopticon helps
Run Domain Visualizer to see the name servers and records the public sees for the domain, which quickly shows whether they are the hosted zone's four. Website Recon names the registrar and DNS provider behind a domain. DNSSEC Chain Validator walks the chain from the root to your zone and shows where a DS and DNSKEY stop matching, and Security Posture grades DNSSEC, CAA, TLS and mail settings, with each finding linking to the article that explains it.
FAQ
Why does my Route 53 domain not resolve when the records look correct?
Usually the registered domain lists different name servers from the hosted zone, often because the zone was deleted and recreated, or because a second hosted zone with the same name exists. Compare the four name servers on the hosted zone with the ones under Registered domains, and update the domain to match the zone.
Can I use a CNAME at the apex of a Route 53 hosted zone?
No. DNS does not allow a CNAME at the zone apex. Use an alias record, which can point the apex at CloudFront, a load balancer, an S3 website endpoint, API Gateway and other AWS resources, or at another record in the same zone.
Why does a name resolve on the internet but return NXDOMAIN inside my VPC?
A private hosted zone with the same name is associated with the VPC and does not contain that record. Inside the VPC the private zone takes precedence and Route 53 does not fall back to public DNS unless public DNS fallback is enabled on the zone. Add the record to the private zone.
What does Action needed mean on a Route 53 key signing key?
Route 53 can no longer use the AWS KMS key behind the key signing key, usually because the key policy changed or the key was disabled or scheduled for deletion. Restore access to the key quickly, because once the zone signatures expire validating resolvers return SERVFAIL for the domain.
Sources and further reading
- AWS: My domain is unavailable on the internet: registered domain and hosted zone name servers
- AWS: Replacing the hosted zone for a domain registered with Route 53
- AWS: Adding or changing name servers and glue records for a domain
- AWS: Choosing between alias and non-alias records
- AWS: Values for alias records: including Evaluate target health
- AWS: Routing traffic to a CloudFront distribution: A and AAAA alias records
- AWS: Considerations when working with a private hosted zone
- AWS: Public DNS fallback for private hosted zones
- AWS: Associating a VPC and a private hosted zone created with different accounts
- AWS: Routing traffic for subdomains
- AWS: Configuring DNSSEC signing in Amazon Route 53
- AWS: Enabling DNSSEC signing and establishing a chain of trust
- AWS: Disabling DNSSEC signing
- AWS: Working with customer managed keys for DNSSEC
- AWS: Troubleshooting DNSSEC signing
- AWS API Reference: DNSSECStatus: hosted zone signing status values
- AWS API Reference: KeySigningKey: KSK status values
- RFC 9364: DNS Security Extensions (DNSSEC)