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

Last updated: 2021-04-19

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

Short description

Using a separate hosted zone to route internet traffic for a subdomain is known as delegating responsibility for a subdomain to a hosted zone. It might also be referred to as subdomain delegation through name servers. Before creating a subdomain, review the following prerequisites:

  • A valid registered domain (regardless of the registrar)
  • A hosted zone for the registered domain in Route 53

Resolution

Create a hosted zone for the subdomain in Route 53

Create a hosted zone with the same name as the subdomain that you want to route traffic for, such as acme.example.com. To do this:

  1. Open the Route 53 console.
  2. In the navigation pane, choose Hosted zones.
  3. Choose Create hosted zone.
  4. In the right pane, enter the name of the subdomain (such as some.example.com).
    Note: For more information, see DNS domain name format.
  5. For Type, accept the default value of Public hosted zone.
  6. Choose Create hosted zone.

Find the name servers that were assigned to the new hosted zone

When you create a hosted zone, Route 53 automatically assigns four name servers to the zone. To start using the records in the hosted zone for the subdomain, create a new name server (NS) record in the hosted zone for the domain (example.com). The name of the NS record must be the same as the name of the subdomain (acme.example.com).

After creating the hosted zone for the subdomain, expand the Hosted zone details dropdown list for the subdomain in the hosted zone (acme.example.com). In the right pane, copy the names of the four servers listed as the Name servers under Hosted zone details.

Add NS records to route traffic to your subdomain

  1. Select the hosted zone for the domain (example.com). Be sure not to select the name of the subdomain (some.example.com).
  2. In the hosted zone for the domain, choose Create record.
  3. For Name, enter the name of the subdomain.
  4. For Value, enter the names of the name servers.
  5. For Record type, choose NS - Name servers for a hosted zone.
  6. For TTL (Seconds), select a more common value for an NS record, such as 172,800 seconds.
  7. For Route Policy, choose Simple routing.
  8. Choose Create Records.

Note: The previous steps also apply for cross-account scenarios where the hosted zone for the domain and the subdomain are in different accounts.


Did this article help?


Do you need billing or technical support?