How do I create a subdomain for my domain hosted through Amazon Route 53?

If you have an existing domain and hosted zone, and you want to create subdomain records, you can:

  • Add subdomains to your existing hosted zone. This method requires fewer hosted zones and results 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.

Important: Be sure to create a private hosted zone or public hosted zone for your domain before proceeding.  

Add subdomains to your existing hosted zone

  1. Sign in to the Route 53 console.
  2. Choose Hosted Zones on the navigation pane.
  3. Select the hosted zone for your domain.
  4. Choose Create Record Set.
    For Name, enter your preferred subdomain name (such as subdomain.example.com).
    For Type, choose A - IPv4 address.
    For Value, add the IPv4 address of the target.
    Keep all other values as their defaults.
  5. Choose Create to add the record to the hosted zone.

Create a new hosted zone and delegation set for your subdomain

  1. Sign in to the Route 53 console.
  2. Choose Hosted Zones on the navigation pane.
  3. Choose Create Hosted Zone.
    For Domain Name, enter your subdomain name (such as subdomain.example.com).
    For Comment, enter a description for the hosted zone.
    For Type, choose Public.
  4. Choose Create.
  5. Find the NS type record in the newly created hosted zone. Note the four assigned hostnames.
  6. Choose Create Record Set.
    For Name, enter a preferred record set name or keep the field blank to have Route 53 create a record name.
    For Type, choose A - IPv4 address.
    For Value, add the IPv4 address of the target.
    Keep all other values as their defaults.
  7. Choose Create.
  8. Choose Hosted Zones from the navigation pane.
  9. Select the parent hosted zone of your apex domain.
  10. Choose Create Record Set.
    For Name, enter your preferred subdomain name.
    For Type, choose NS – Name Server.
    For TTL, choose the 1d preset button.
    For Value, enter the four name server hostnames (noted above) on separate lines.
    Keep all other values as their defaults.
  11. Choose Create to commit the record to the hosted zone.

Test the new delegated zone by querying for the NS record you created. In a terminal, use the following commands with your subdomain name:

For Windows use nslookup:

nslookup subdomain.example.com

For Linux or macOS use dig:

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: 2018-08-15