Monday, August 24, 2020

Adding DNS entries in a sub-domain

I was setting up a training environment for one of our customers where they would regularly build and destroy VMs on AWS. 

Our AWS infrastructure sits under the example.com (name changed for confidentiality) domain. So all servers that are created have a name resembling server1.example.com, server2.example.com etc. For the training environment though, I wanted them to be under a different sub-domain, e.g. training.example.com

This would allow to have more meaningful names for the training environments and prevent accidental modification of servers in the main domain, e.g. server1.training.example.com and server2.training.example.com.

At first, I thought just creating another hosted zone (training.example.com) under route53 will solve the problem but it did not. I would get 

** server can't find server1.training.example.com: NXDOMAIN

To get around this problem, I had to do the following:

  1. Find the Name Server (NS) of training.example.com. This information is available when you click on the hosted zone.
  2. Add a new entry of type (NS) under example.com, the entry should resemble:
training.example.com NS <value of NS from #1>

Now I could play around with the training environments without having to worry about accidentally destroying any entry in the main domain (example.com)


No comments:

Post a Comment