Route 53 private hosted zone records return NXDOMAIN from an EC2 instance.
IntermediateTroubleshootingDNS resolution failures
Answer
Likely causes → The PHZ isn't associated with this VPC, enableDnsHostnames/enableDnsSupport is off, the instance uses a custom resolver instead of the VPC resolver (VPC CIDR base + 2), or a public zone with the same name shadows it.
Diagnose →
cat /etc/resolv.conf
dig @169.254.169.253 db.internal.example.com
aws route53 get-hosted-zone --id Z123 --query 'VPCs'
aws ec2 describe-vpc-attribute --vpc-id vpc-abc --attribute enableDnsSupport
Fix → Associate the zone with the VPC (cross-account needs authorization + association), enable DNS attributes, or forward the domain from the custom resolver to the VPC resolver.
Prevent → Associate PHZs in the same Terraform module that creates VPCs.
More on DNS resolution failures
`dig app.example.com` returns `status: NXDOMAIN`.Beginner`dig` returns `status: SERVFAIL` for one domain while other domains resolve fine.Intermediate`curl: (6) Could not resolve host: api.example.com` inside a container but it resolves on the host.BeginnerA DNS change was made 2 hours ago, but some users still reach the old IP.BeginnerJava service keeps connecting to an old IP long after the DNS record changed.IntermediateIn Kubernetes, external lookups from pods are slow and CoreDNS logs show many NXDOMAIN queries like `api.stripe.com.default.svc.cluster.local`.Intermediate