Multi Account Subdomain Setup and Route53 (web server)
Say you have a production account acme.com in one AWS account and you want to set up Route 53 to manage your dev account (dev.acme.com). For example an “A” record for the load balancer. You could create an entry in the acme.com Route 53 Hosted zone for the ALB. but you would have to copy and paste the ALB DNS name from the dev account because the ALB name does not show up in the drop-down list when selecting an alias record.
That’s because your acme.com Hosted Zone knows nothing about your dev.acme.com sub-domain. Here is a solution that is clean and can scale if you have many accounts and sub-domain.
In the dev account.
- Create a hosted zone for dev.acme.com
- AWS will create an SOA and NS record for that sub-domain.
- Copy the newly created NS record values
In the prod account
- In acme.com hosted zone create an NS record and paste the values from the dev account
- go back to the dev account Route 53
In the dev account.
- Create the ALB if not already created
- Create an A record alias and you should be able to select your ALB from the drop-down list now,
Wait a few minutes for things to propagate and you should be able to access your dev.acme.com web server from the internet. The nice thing about this is you can segregate your sub-domain entries from the master or production domain. Yet can see how many sub-domains you have from the master domain.
Here is the link to the AWS documentation but this should be easier to follow and less wordy. dns-routing-traffic-for-subdomains.html