4

I have two public hosted zones in Amazon Route 53 for the same domain name (which has Route 53 as registrar), for the reason that Route 53 automatically created one when I registered the domain name and that the second one was created by Terraform.

As far as I can tell, DNS record sets in the second zone aren't applied, i.e. they're not returned for queries to the domain. Do I have to delete the first zone in order for record sets in the second zone to be active?

3 Answers 3

2

Following is an extract from the AWS Route 53 FAQ

Q. Can I create multiple hosted zones for the same domain name? 

Yes. Creating multiple hosted zones allows you to verify your DNS setting in a “test” environment, and then replicate those settings on a “production” hosted zone. For example, hosted zone Z1234 might be your test version of example.com, hosted on name servers ns-1, ns-2, ns-3, and ns-4. Similarly, hosted zone Z5678 might be your production version of example.com, hosted on ns-5, ns-6, ns-7, and ns-8. Since each hosted zone has a virtual set of name servers associated with that zone, Route 53 will answer DNS queries for example.com differently depending on which name server you send the DNS query to.

Click here for more details

Sign up to request clarification or add additional context in comments.

3 Comments

This doesn't answer how DNS record sets in different zones are exposed from what I can tell. Maybe I'm missing something, but I still don't understand if zone 2 will be active so long as zone 1 exists.
Both zones are active, both are exposed, just through different name servers. Depending on which name server you query, you will get the different answer.
@DusanBajic I think you're missing what I mean by exposed. Only the first zone is exposed via the domain name.
2

As far as I can tell, which hosted zone is active, meaning that its record sets are returned for queries to the domain, depends on the name servers registered with the domain. So, in order to make my second zone active I have to update the domain's name servers, in Route 53, to correspond to those of the desired hosted zone.

3 Comments

You are using the word "active" in an ambiguous way. The Internet only knows how to query your authoritative nameservers, so any other hosted zones would not be "active" in the sense of the Internet seeing it, true. But from Route 53's perspective, the second hosted zone is not genuinely inactive -- the records are available, but nobody is asking for any of them... the Internet doesn't know to send queries to those different nameservers.
@Michael-sqlbot I think I've made it as clear as I can now (edited the answer a tiny bit). I'm asking for something very specific, i.e. how a zone is linked to the domain in question, other technical aspects aren't that relevant.
Hi @aknuds1, can I check if I understood you correctly. You use the same name servers for both the hosted zones and the records in both hosted zone are working? or did you change to set the record to listen to the name servers in your second hosted zone and none from the first? (I am also starting on Terraform and thinking of provisioning a cloudfront, acm, and a separate hosted zone so that it is decoupled from other aspects of the project)
1

How is Domain-Name, Namespaces, and Hosted-Zone connected?

Imagine you bought a new name from GoDaddy - example.com. Then you setup your website in your EC2 machine which has IP 100.0.0.10. To point example.com to your webserver, you will need to first choose a DNS resolver. AWS provides one - Route53. A DNS resolver translates names like example.com to IP address like 100.0.0.10.

AWS Route53 has a concept of Hosted Zones. You will need to create a hosted zone for example.com. Route53 will then give you nameservers (bunch of different URLs, AWS gives you 4). You will take these nameservers and go back to GoDaddy and there is a section to put those nameservers. This tells GoDaddy where to send the request to.

Why did we do above ^^^ ? When you purchased the name from GoDaddy, GoDaddy became your registrator i.e. it registered your name with the DNS authorities. So whenever someone requests example.com to the DNS authorities, they will forward the request to GoDaddy. So GoDaddy needs to know where to send the request to. These nameservers tells GoDaddy that exact information.

After the request reaches AWS Route53, it knows that this domain name example.com needs to go to 100.0.0.10.

What if I create 2 Hosted Zones with the same domain name example.com?

A hosted-zone is nothing but Route53's way to define a set of route rules for a domain. If you have 2 hosted-zone with the same domain name, you will have 2 sets of namespaces. For AWS, each set has 4 namespace, so total of 8 namespaces).

So now it depends which namespaces you give to GoDaddy. You can give it set A, in which case your second hosted-zone will not receive any traffic. You can give it set B, in which case your first hosted-zone will not receive any traffic. Or, you can give it a mixture of both set A and set B, in which case GoDaddy will send some requests to set A and some to set B, not both though.

3 Comments

is there a limit of mixture we can send to? i.e. if we put all 8 of them. This is what i tried - I had an old hosted zone with NS1-4, added to my domain provider NS. Another new hosted zone with NS5-8, which i continue to add new one under NS1-4. But until now, the domain is not working. ERR_NAME_NOT_RESOLVED so i think none of the requests are being sent to set B.
how does the domain provider determine requests sending to which from the mixture? I thought they will send one by one, if one doesn't have the records, to the others until they get the one who responded. Sorry if question seems to be basic here, relatively new to this.
@unacorn I don't think the requests gets send one by one until a response is received. GoDaddy will choose a namespace URL and will send the request to it. After that GoDaddy is not involved and does not care if the request got fulfilled or not. For this reason, ALL your nameservers must be working at all times.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.