53

I have foo.com as a Hosted Zone with an A, NS, SOA, TXT and MX Record Sets. It works fine. Now I want a separate test.foo.com with an A entry but I want it in a separate Hosted Zone. Is it possible?

If I put an A record in foo.com's Hosted Zone with the value test.foo.com it works but I want it in a separate Hosted Zone.

I want it like so in order to have a clear separation between the test and prod. This way I can break the test but the prod is still up.

Thank you!

ddreian
  • 1,766
  • 5
  • 21
  • 29

1 Answers1

106

Create a hosted zone for test.example.com.

Note the 4 name servers that Route 53 assigns to it the new hosted zone.

Back in the master zone, create a new resource record, with hostname "test" using record type NS, and enter the 4 name servers that Route 53 assigned, in the box below.

You just delegated the "test.example.com" subdomain, and any hosts and subdomains in it, to a different hosted zone, which you can now break to your heart's content, without impacting the production records.

The hosted zone for the subdomain can be in the same account or a different account.

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427
  • 1
    Do you know why people downvoted this? It has a -1 rating now and I searched for similar questions before posting it but I did not find any. Did I break any StackOverflow rules or people are just mean? :) – ddreian Mar 04 '16 at 17:25
  • 4
    Your question, to me, doesn't qualify as [an egregiously sloppy, no-effort-expended post](http://stackoverflow.com/help/privileges/vote-down), and you only got 1 of them, so I wouldn't worry a great deal about it at this point. Sometimes the downvoter lacks the knowledge they think they have, and on that basis, they assume there's a defect that isn't there. Perhaps they assumed the answer was intuitively obvious, but if that's the case, it seems like a comment would have been in order. With no comment made by the person casting the vote, you can really only speculate. – Michael - sqlbot Mar 04 '16 at 19:37
  • Do you need to delete the automatically created SOA record in the subdomain? The AWS doco suggests you should https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingNewSubdomain.html#decide-procedure-create-subdomain – Ben Incani Aug 04 '19 at 05:48
  • 1
    @BenIncani I see why you get that impression, but no, don't delete it. *"If your DNS service automatically added an SOA record for the subdomain, delete the record for the subdomain"* refers to a third party DNS provider of the parent zone incorrectly adding a SOA record for the subdomain inside the parent zone when you add the subdomain NS records to the parent zone, which would be wrong. Some other DNS hosting providers do some nonsensical things under the guise of being "helpful" and this would be an example of undoing that behavior. Not applicable to Route 53-only scenarios. – Michael - sqlbot Aug 04 '19 at 13:09
  • 1
    @Michael-sqlbot I think I understand this...I have a similar issue, i have my main prod account, in the hosted zone "example.com" and it has it's own NS, SOA, etc. records. I want to create a second AWS account that will use the domain "dev.example.com". So for my prod account, I would have two NS records in my "example.com" hosted zone. one for the "example.com" and the other for "dev.example.com"??? I was not sure you could have multiple NS records in one hosted zone...I am sort of new at this, so I might need to be educated on that... – Dubl1n Dec 12 '19 at 13:43
  • 1
    @Dubl1n that's correct -- you'd need a "dev.example.com" NS record (with 4 values) in the parent zone for the subdomain. That's valid/allowed. – Michael - sqlbot Dec 12 '19 at 17:53