Interview Prep/Real-World Interview/DNS, TLS and certificates

EC2 instances in a newly created VPC can't resolve `db.internal.example.com`; instances in the old VPC can.

IntermediateTroubleshootingDNS, TLS and certificates
Answer

Likely causes → The Route 53 private hosted zone is associated only with the old VPC, or the new VPC has enableDnsSupport/enableDnsHostnames turned off. If the zone lives in another account, the cross-account association was never authorized.

Diagnose →

aws route53 get-hosted-zone --id $ZONE_ID --query 'VPCs'
aws ec2 describe-vpc-attribute --vpc-id $VPC --attribute enableDnsSupport
dig db.internal.example.com @169.254.169.253

Fix →

aws route53 associate-vpc-with-hosted-zone --hosted-zone-id $ZONE_ID \
  --vpc VPCRegion=ap-south-1,VPCId=$NEW_VPC

Turn on both DNS attributes on the VPC. For cross-account, run create-vpc-association-authorization in the zone's account first.

Prevent → Make zone association part of the VPC Terraform module, or use Route 53 Resolver rules shared through RAM so every new VPC gets internal DNS automatically.

All Real-World Interview questions Roadmap: Interview readiness

More on DNS, TLS and certificates