Private Hosted Zones
What you'll learn: How to create internal DNS namespaces so your cloud resources can find each other by name instead of IP addresses—without exposing those names to the public internet.
What Are Private Hosted Zones?
A Private Hosted Zone is like an internal phone book that only works inside your virtual network. Just as employees in a company might use internal extensions to call each other instead of full phone numbers, your cloud resources can use friendly DNS names (like database.internal or api.myapp.local) to communicate—names that don't exist or resolve outside your VPC.
Why Use Them?
Remember how DNS resolution in VPCs (lesson 223) lets resources look up names? Private Hosted Zones take that further by letting you define your own custom domain names for internal use. Instead of connecting to 10.0.5.42, your application server can connect to db.internal, making configurations easier to read and manage.
How They Work
When you create a Private Hosted Zone, you:
- Choose a domain name (like
mycompany.internal) - Associate it with one or more VPCs where it should be visible
- Add DNS records mapping names to private IP addresses
Only resources inside the associated VPCs can resolve these names. The public internet never sees them, adding a layer of security.
Common Use Cases
- Database endpoints:
primary-db.internal,replica-db.internal - Internal APIs:
user-service.internal,payment-api.internal - Development/testing environments with environment-specific names
Key Takeaway: Private Hosted Zones let you create custom, internal-only DNS namespaces within your virtual networks, making resource discovery easier and more secure without exposing internal architecture to the internet.