Interview Prep/Networking/Cloud networking: VPC, firewalls, NAT, VPN and proxies

You created an interface VPC endpoint for Secrets Manager, but `dig secretsmanager.ap-south-1.amazonaws.com` still returns public IPs from the instance.

IntermediateTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer

Likely causes → Private DNS isn't enabled on the endpoint, the VPC lacks enableDnsSupport/enableDnsHostnames, or the instance uses a custom DNS server that doesn't forward to the VPC resolver (169.254.169.253 / VPC+2), so the private hosted zone the endpoint creates is never consulted.

Diagnose →

aws ec2 describe-vpc-endpoints --vpc-endpoint-ids <vpce> --query 'VpcEndpoints[0].PrivateDnsEnabled'
aws ec2 describe-vpc-attribute --vpc-id <vpc> --attribute enableDnsHostnames
cat /etc/resolv.conf
dig +short secretsmanager.ap-south-1.amazonaws.com @169.254.169.253

Fix → Enable private DNS on the endpoint and the VPC DNS attributes, and forward AWS service domains from custom resolvers to the VPC resolver (or Route 53 Resolver inbound endpoint for on-prem).

Prevent → Make endpoints with private_dns_enabled = true in Terraform, and verify resolution as part of the rollout.

All Networking questions Roadmap: Networking for DevOps

More on Cloud networking: VPC, firewalls, NAT, VPN and proxies