Interview Prep/Networking/DNS resolution failures

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.

All Networking questions Roadmap: Networking for DevOps

More on DNS resolution failures