Skip to content

Working with Private Hosted Zones

Application Based Stickyness in ALB in AWS

private hosted zone is a container that holds information about how you want Amazon Route 53 to respond to DNS queries for a domain and its subdomains within one or more VPCs that you create with the Amazon VPC service. Here’s how private hosted zones work:

  • You create a private hosted zone, such as example.com, and specify the VPC that you want to associate with the hosted zone. After you create the hosted zone you can associate more VPCs with it.
  • You create records in the hosted zone that determine how Route 53 responds to DNS queries for your domain and subdomains within and among your VPCs. For example, suppose you have a database server that runs on an EC2 instance in the VPC that you associated with your private hosted zone. You create an A or AAAA record, such as db.example.com, and you specify the IP address of the database server.
  • When an application submits a DNS query for db.example.com, Route 53 returns the corresponding IP address. To get an answer from a private hosted zone you also have to be running an EC2 instance in one of the associated VPCs.
  • If you try to query a private hosted zone from outside the VPCs or your hybrid setup, the query will be recursively resolved on the internet.
  • The application uses the IP address that it got from Route 53 to establish a connection with the database server.

When you create a private hosted zone, the following name servers are used:

  • ns-0.awsdns-00.com
  • ns-512.awsdns-00.net
  • ns-1024.awsdns-00.org
  • ns-1536.awsdns-00.co.uk