Cross-Peer DNS

Cross-Peer DNS

ℹ️ Information: Cross-Peer DNS allows instances in peered VPCs to resolve DNS hostnames to private IP addresses. This section guides you through enabling and testing Cross-Peer DNS.

💡 Pro Tip: Enabling Cross-Peer DNS can simplify network management by allowing you to use DNS hostnames instead of IP addresses.

Implementation Steps

  1. Access VPC Management Console
    • Select VPCs from the left sidebar
    • Select My VPC

VPC Console

  1. Enable DNS Hostnames
    • Click the Actions button
    • Select Edit DNS hostnames
    • Enable DNS hostnames
    • Click Save

Enable DNS Hostnames

  1. Repeat for HG VPC
    • Select HG VPC
    • Enable DNS hostnames

Enable DNS for HG VPC

  1. Test DNS Resolution
    • From an EC2 instance in My VPC, use the nslookup command to resolve the DNS hostname of an instance in HG VPC
    • Verify that the private IP address is returned

Test DNS Resolution

  1. Verify Connectivity
    • Use the resolved DNS hostname to ping the instance in HG VPC
    • Ensure successful communication

Verify Connectivity

🔒 Security Note: Ensure that your security groups and network ACLs allow DNS traffic (UDP port 53) between the peered VPCs.

⚠️ Warning: DNS resolution must be enabled on both VPCs for Cross-Peer DNS to work. Ensure both VPCs have DNS hostnames enabled.

💡 Pro Tip: Use DNS hostnames instead of IP addresses in your applications to make them more resilient to IP address changes.