In this guide, I will show you to create a subdomain in Amazon Route53.
An example of how this is useful could be adding api onto your existing domain. You can redirect "api.yourwebsite.com" to an EC2 instance or a load balancer for instance.
You will need an AWS account for this.
You will start and end this guide in Route53.
- If you haven't already, create a hosted zone for your original domain. (example.com)
- Create a new hosted zone for your subdomain by clicking on "Create Hosted Zone" and entering the following:
Domain Name: api.example.com (or whatever you want your subdomain to be)
Comment: This can be anything
Type: Public Hosted Zone
- Click "Create"
- Click into your hosted zone, and select the record set with type "NS"
- Copy the nameservers in the "value" box on the right.
- Return to your original hosted zone. (example.com)
- Click "Create Record Set" and enter the following:
Name: api.example.com (or whatever your subdomain hosted zone is called)
Type: NS - Name Server
Value: Paste in those nameservers you copied.
- Click "Create"
- Return to the hosted zone for your subdomain and click "Create Record Set"
- You can redirect your subdomain to anything you want now. You can use an "A" record with a blank "Name" field and enter in an IP address. You can click "Yes" next to an alias and then click in the "Alias Target" box to select which AWS service to resolve to. When you are done click "Create"
In 1-2 minutes, open up a new tab and enter your new subdomain. It should resolve. If it does not, check that you completed the steps correctly. If it still does not resolve, leave a comment below the post.
I hope this helps anyone who was looking for an easy way to create a subdomain in Route53.