Monday, 8 July 2019

AWS DNS Route 53 delegating responsibility of subdomain without migrating parent domain

AWS DNS Route 53 delegating responsibility of subdomain without migrating parent domain


Feb 2022 - this post is permanently moved to https://architectfwd.com, my new site, and can be found here  - https://architectfwd.com/architecture/cloud/amazon-web-services-aws/dns-domains-route-53/2022/01/23/aws-dns-route-53-delegating-responsibility-of-subdomain/ please go and bookmark that site for all of my future content.


When you have a domain hosted at a register or other DNS service and want to create a subdomain hosted in Route 53 but do not want to move the parent domain then do the following.

AWS Route 53


In this example, I assume you have a domain, e.g. lovescatsnotarealdomain.com and you do not want to transfer it to Route 53. All you want to do is create a subdomain e.g. mysubdomain.lovescatsnotarealdomain.com hosted and registered within Route 53.

In Route 53, create a new hosted zone mysubdomain.lovescatsnotarealdomain.com. You will be provided a SOA record and NS records in this hosted zone. Create a further subdomain record set in this domain if you so choose at a later time.

Do not create a hosted zone for lovescatsnotarealdomain.com in Route 53 for this scenario.

Update DNS Service


Copy the 4 nameservers from the record created above. At your domain register / DNS Service proceed to create 4 NS records for the subdomain - do not create a CNAME at the DNS Service, only NS records.

Wait. For DNS that is.

In the meanwhile create either an A record or an Alias in the Route 53 hosted zone for the domain. That is,
a) create an EC2 and assign the A to the IP address or
b) map an ELB via an Alias.

Wait. For DNS.

DNS...


At some point running a DIG NS mysubdomain.lovescatsnotarealdomain.com will result in NXDOMAIN error, but eventually you will get a full result showing the resulting NS changes.

Open mysubdomain.lovescatsnotarealdomain.com in a browser and you should be greeted with the service you configured against the subdomain in an earlier step.

This makes it really easy and no need to migrate the entire domain zone to Route 53. A really flexible option.


Cheers
Quintes

Quintes van Aswegen Togaf 9 Certified Architect, Professional Scrum Master I (PSM I) Certified

Connect with me on LinkedIn or Twitter