Friday, January 18, 2013

Using Amazon Route 53 to map a subdomain to an instance

In the AWS Management Console, go to the Route 53 page.

Click Create Hosted Zone. Fill in the domain name (subdomain in this case) and the comment.

Click Go To Record Sets on the top left navbar.
Do not create additional name serve (NS) or start of authority (SOA) records in the Route 53 hosted zone, or delete the existing records.
Click on Create Record Set.

For the purpose of this demo, we will map the subdomain to a EC2 instance

Select A record for Type.

Put the IP of the EC2 instance as value. If you don't have an Elastic IP, allocate one for your instance.

Click Create Record Type.

Take note of the four NS records.

In your DNS registrar, add the four NS records above to the subdomain.
Do not add a start of authority (SOA) record to the zone file for the parent domain. Because the subdomain will use Route 53, the DNS service for the parent domain is not the authority for the subdomain. 
If your DNS service automatically added an SOA record for the subdomain, delete the record for the subdomain. However, do not delete the SOA record for the parent domain.
Wait until the DNS is progagate.

Use ping to check the IP the subdomain is mapping to.

2 comments: