How can I use Route 53 to access an internal version of my website using the same domain name which is also used publicly?

2 minuto de leitura
1

How can I use Amazon Route 53 to access an internal version of my website using the same domain name that is used publicly?

Short description

You can use Route 53 to configure split-view DNS, also known as split-horizon DNS. You can use this feature when you want to maintain internal and external versions of the same website or application.

Resolution

You can maintain both a private and public hosted zone with the same domain name for split-view DNS with Route 53. The following instructions assume you already own a domain and have the rights to make changes to the NS records for that domain. Route 53 private hosted zones require DNS queries sourced from the Amazon Virtual Private Cloud (Amazon VPC) DNS server rather than a custom DNS server.

  1. Make sure that DNS resolution and DNS hostnames are turned on for the source Amazon VPC.
    Note: DNS hostnames are turned on for default VPCs and VPCs that you create using the VPC wizard in the VPC console.
  2. Create a public hosted zone that matches the name of the domain that you purchased.
  3. Populate the public hosted zone with the required records.
  4. Update your registrar's NS records with the name servers provided in your public hosted zone.
  5. Create a private hosted zone that matches the name of the public hosted zone. Attach the private hosted zone to the Amazon VPC where you want to resolve the domain internally.
    Note: The private zone lookup takes place within the VPC.
  6. Populate the private hosted zone with the required records.
    Note: The public zone isn't queried if a record doesn't exist in the private zone.

DNS queries respond with answers based on the source of the request. From within the Amazon VPC, answers come from the private hosted zone, while public queries return answers from the public hosted zone.


Related information

Configuring Amazon Route 53 as your DNS service

AWS OFICIAL
AWS OFICIALAtualizada há 2 anos
4 Comentários

Is there any way to get around this note? "Note: The public zone isn't queried if a record doesn't exist in the private zone."

Alan
respondeu há um ano

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERADOR
respondeu há um ano

Any updates about question from Alan? This behavior is extremely inconvenient for cases where you want to use both types of the same domain. It seems to me that there should be another way when using AWS built-in DNS server, for example:

  • A request to a private hosted zone -> getting a record value from a private hosted zone
  • If there is no domain/record in private hosted zone -> a request to a public hosted zone -> getting a record from a public hosted zone
Sasha
respondeu há 9 meses

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERADOR
respondeu há 9 meses