Course contentsShow
← Cloud and Infrastructure
Lesson 223 of 2,9894. Cloud Networking BasicsFree lesson

DNS Resolution in VPCs

Learn how DNS works within virtual networks and how instances resolve domain names.

DNS Resolution in VPCs

What you'll learn: How virtual networks handle domain name lookups so your cloud instances can find each other and external services by name instead of IP address.

What Is DNS Resolution in a VPC?

When you launch instances in a virtual network, they need to translate human-friendly domain names (like api-server.mycompany.com or www.google.com) into IP addresses. DNS (Domain Name System) resolution is the process that makes this translation happen. In a VPC, this service is automatically provided—you don't need to configure DNS servers manually.

How It Works

Think of DNS resolution like a phone book for your network. When an instance needs to contact another resource by name, it asks the VPC's built-in DNS resolver, which lives at a special IP address (typically the second IP in your VPC's CIDR range, like 10.0.0.2).

The resolver handles two types of lookups:

  • Internal names: Instances within your VPC can resolve each other's private DNS names (like ip-10-0-1-45.ec2.internal) to their private IP addresses
  • External names: Public domain names are forwarded to public DNS servers on the internet (if your subnet has internet connectivity via an Internet Gateway or NAT Gateway)

Why This Matters

Instead of hardcoding IP addresses in your application configurations, you can use DNS names. If an instance's IP changes, the DNS name automatically resolves to the new address. This makes your infrastructure more flexible and easier to maintain.

Key Takeaway: VPCs provide automatic DNS resolution so instances can find each other using names instead of IP addresses, with built-in support for both internal private names and external public domains.