User Agents

Web browsers and everyday web tech, explained

AWS DNS Error: What to Check and How to Fix It

· 6 min read · How the Web Works

In this article
  1. How to Work Through an AWS DNS Error
  2. Which Kind of DNS Failure Are You Seeing?
  3. Quick Checks Before Anything Deeper
  4. Deeper Fixes for Route 53 and VPC DNS
  5. Preventing AWS DNS Errors Going Forward
  6. Questions That Come Up With AWS DNS Errors

An AWS DNS error usually means one of three things: Route 53 can't resolve your domain, your EC2 instance's internal DNS isn't working, or your domain's delegation is broken. The fastest split is to test from inside the VPC first, then from the public internet — that tells you which side owns the problem.

Time 30 min · Steps 8 · Level Medium

How to Work Through an AWS DNS Error

  1. Test resolution from inside the VPC. SSH into an EC2 instance in the same VPC and run a lookup against the VPC DNS resolver at 169.254.169.253 (for example, using nslookup). If this works but public lookups fail, the problem is public-side, not your VPC.
  2. Test the same name from the public internet. From your laptop or an online lookup tool, query the domain. A public failure with a working internal lookup points at Route 53 hosted zones, delegation, or registrar settings.
  3. Check the Route 53 hosted zone. In the Route 53 console, open Hosted zones, select your zone, and confirm a record exists for the exact name and type being queried (an A or AAAA record for the hostname, a CNAME or alias for the alias name).
  4. Confirm the domain's nameservers match the zone. Open the hosted zone's detail page and note the four assigned nameservers, then check the registrar's DNS settings for the domain. All four must match exactly; a single mismatch breaks resolution.
  5. Check the VPC DNS settings. In the VPC console, open the VPC's details and confirm enableDnsSupport and enableDnsHostnames are both on. If either is off, private DNS and the amazonaws.com hostnames stop resolving.
  6. Check the security group and route table. DNS is UDP and TCP port 53. If you're forwarding DNS to an instance running BIND or a resolver, its security group must allow inbound port 53 from the VPC CIDR on both protocols, and the route table must send that traffic somewhere valid.
  7. Check the resolver rule if you use one. In the Route 53 Resolver console, review inbound and outbound rules and the endpoints. A rule forwarding the wrong domain, or an endpoint with no attached security group allowing port 53, produces silent lookup failures.
  8. Query the record type you actually asked for. A lookup for an A record on a name that only has a CNAME returns an error even though the zone is healthy. Match the record type in your test to the record type in the zone.

Which Kind of DNS Failure Are You Seeing?

The symptom that splits the causes is where the failure happens. If lookups fail only from inside the VPC, the cause is almost always the VPC DNS settings, a Resolver rule, or a security group blocking port 53. If lookups fail everywhere, including from your phone on mobile data, the cause is in Route 53 itself or at the registrar: a missing record, a wrong nameserver delegation, an expired domain, or a typo in the record name.

One more split worth making: does the error mention a specific name, like an amazonaws.com hostname for a load balancer or an RDS endpoint? Those names are created by AWS and resolve through the VPC resolver, so a failure there points back to VPC DNS settings rather than your own zone.

Quick Checks Before Anything Deeper

  • Confirm the domain hasn't expired — an expired domain fails everywhere, and the registrar's status page shows it.
  • Check for typos in the record name, including a stray trailing dot or a missing subdomain label.
  • Query the four Route 53 nameservers directly (nslookup with the server set to one of them). If they answer correctly, Route 53 is fine and the problem is delegation or caching.
  • Remember DNS caching: after a fix, stale answers can persist for the record's TTL. A short TTL of 60 seconds clears in a minute; a 48-hour TTL can take up to two days.
  • If the error appears in an application log rather than a manual lookup, rerun the lookup from the same machine the application runs on — the app may be using a different resolver than your terminal.

Deeper Fixes for Route 53 and VPC DNS

Fixing a broken delegation

If the registrar's nameservers don't match the hosted zone's, update them at the registrar to the four values shown in Route 53. Propagation of a nameserver change typically completes within a few hours but can take up to two days. Until then, some resolvers answer with the old delegation.

Fixing VPC DNS settings

Turn on enableDnsSupport and enableDnsHostnames in the VPC details page. Instances pick this up without a reboot for new lookups, but restart any long-running resolver or application that caches negative answers. Note that a VPC that was peered or attached via a transit gateway only resolves the peer's private names if Resolver rules are configured — peering alone doesn't extend DNS resolution across VPCs.

Fixing port 53 blocking

If you run your own resolver on EC2, its security group needs inbound UDP 53 and TCP 53 from the subnets that query it, and the instances querying it need their resolver configuration pointed at that instance's private IP. Check the resolver's own logs to confirm queries are arriving; queries that never arrive are a network or security-group problem, not a DNS software problem.

When it stops being a DIY fix

If the four Route 53 nameservers themselves fail to answer a direct query, or the hosted zone shows a state you can't change, open a case with AWS Support from the Support Center in the console. That's an AWS-side fault, and no amount of registrar or VPC adjusting will fix it.

Preventing AWS DNS Errors Going Forward

Set short TTLs (60 to 300 seconds) on records you change often, so mistakes clear quickly instead of lingering for a day. Keep the registrar's nameserver list and the hosted zone's list in one place you can compare at a glance. Turn on health checks for records that back production endpoints, so a failing target is visible in the console rather than surfacing as a DNS error in an application log. And when you create a new VPC, check both DNS settings before launching instances into it — they're on by default in the standard console flow, but templates and infrastructure-as-code can leave them off.

Questions That Come Up With AWS DNS Errors

Why does DNS work from my instance but not from the internet?

Your instance uses the VPC resolver at 169.254.169.253, which answers from Route 53 and VPC-generated names. The public internet resolves your domain through the registrar's delegation. If the nameservers at the registrar don't match the hosted zone, public lookups fail while internal ones succeed.

Can a security group really cause a DNS error?

Yes, when DNS traffic flows to an instance you run yourself. Security groups are stateful, so return traffic is allowed, but the inbound rule for UDP 53 and TCP 53 from your query sources must exist. This only affects resolvers you host; it doesn't apply to the VPC resolver or Route 53's public nameservers.

How long do I wait after fixing a record?

As long as the record's TTL. Route 53 answers authoritatively right away, but resolvers in between keep their cached answer until the TTL expires. Query one of the zone's nameservers directly to confirm the new value is live, then wait out the TTL on the caching side.

What does an NXDOMAIN versus SERVFAIL response tell me?

NXDOMAIN means the name genuinely doesn't exist — usually a missing record or a typo in the query. SERVFAIL means the resolver couldn't complete the lookup — usually delegation problems, an unreachable nameserver, or DNSSEC validation failing. That one distinction narrows the cause considerably.