I want to create a subdomain for my domain hosted through Amazon Route 53. How do I do that?

If you have an existing domain and hosted zone, and you want to create subdomain records, you can do either of the following:

  • Add subdomains to your existing hosted zone. This method requires fewer hosted zones and will result in fewer queries to your hosted zones.
  • Create a new hosted zone to hold the records associated with your subdomain, as well as a delegation set in the parent hosted zone that refers clients to the subdomain hosted zone. This method offers more flexibility when managing the hosted zones (for example, restricting who can edit the zones). This method can be used only for public hosted zones, because adding NS records to private hosted zones is not currently supported.

Note: Both methods require you to first create a hosted zone for your domain. "example.com" is used as the domain in the following instructions. Replace "example.com" with your domain when you perform these steps.

To add subdomains to your existing hosted zone

  1. Sign in to the Route 53 console, and select Hosted Zones from the navigation pane on the left.
  2. Select the hosted zone for your domain.
  3. Choose Create Record Set and enter the following values:
    For Name, type your preferred subdomain name. For example, if the subdomain you’re attempting to create is "subdomain.example.com", type "subdomain".
    For Type, choose A - IPv4 address.
    For Value, add the IPv4 address of the target EC2 instance.
    Leave all other values as their defaults.
  4. Choose Create to add the record to the hosted zone.

To create a new hosted zone and delegation set for your subdomain

  1. Sign in to the Route 53 console, and select Hosted Zones from the navigation pane on the left.
  2. Choose Create Hosted Zone.
  3. Enter the following information into the corresponding fields:
    For Domain Name, type your domain name. For example, "subdomain.example.com".
    For Comment, type a description for the zone.
    For Type, choose Public.
  4. Choose Create. Find the NS type record in the newly created zone, and note the four assigned hostnames.
  5. Select Create Record Set and enter the following values:
    For Name, type in a preferred name, or leave it blank to create a record for the subdomain.
    For Type, choose A - IPv4 address.
    For Value, add the IPv4 address of the target EC2 instance.
    Leave all other values as their defaults.
  6. Choose Create.
  7. Select Hosted Zones from the navigation pane on the left, and select the "example.com" parent hosted zone.
  8. Choose Create Record Set, and enter the following information:
    For Name, type your preferred subdomain name. For example, if the subdomain you want to create is "subdomain.example.com", type "subdomain".
    For Type, choose NS – Name Server.
    For TTL, select the 1d preset button.
    For Value, type the four name server hostnames (noted above) on separate lines.
    Leave all other values as their defaults.
  9. Choose Create to commit the record to the hosted zone.

To test the new delegated zone by querying for the record created in Step 6, open a terminal window and enter the following command, replacing subdomain and example.com with your subdomain and domain):

Windows

nslookup subdomain.example.com

Linux or Mac

dig subdomain.example.com
dig +trace subdomain.example.com

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-10-31

Updated: 2017-12-20