AWS Route 53 Subdomain Deletegation

Here is a step-by-step guide to set up subdomain delegation using AWS Route 53:

🔧 Scenario

You're delegating a subdomain (e.g. dev.example.com) to a different set of name servers than the parent domain (example.com). This is useful for separating DNS management responsibilities or pointing to resources in another AWS account.

✅ Prerequisites

  • You own the parent domain (e.g., example.com) in Route 53.
  • You want to delegate a subdomain (e.g., dev.example.com).
  • Optionally: A second Route 53 hosted zone created for the subdomain (in the same or different AWS account).

🧭 Step-by-Step Instructions

Step 1: Create a Hosted Zone for the Subdomain

  1. Go to AWS Route 53 console.
  2. Choose "Hosted zones" > "Create hosted zone".
  3. Enter:
    • Domain name: dev.example.com
    • Type: Public hosted zone (unless you want a private one for VPC)
  4. Click "Create hosted zone".

📌 This creates a new zone with its own NS and SOA records. Note the 4 Name Servers in the NS record — you'll need these later.

Step 2: Delegate the Subdomain in the Parent Zone

Now, inform the parent zone (example.com) that dev.example.com is managed by the new name servers.

  1. Go to the hosted zone for example.com.
  2. Click “Create record”.
  3. Record settings:
    • Record name: dev
    • Record type: NS - Name servers for a hosted zone
    • Value: Enter the 4 name servers from the dev.example.com zone (Step 1).
  4. Click “Create records”.

📌 Now DNS queries for dev.example.com will be handled by the delegated zone.

Step 3: (Optional) Add Records to the Subdomain Zone

Now you can manage the subdomain’s DNS records independently:

  1. Go to the dev.example.com hosted zone.
  2. Add records like:
    • A or CNAME for sub-subdomains (e.g., api.dev.example.com)
    • MX, TXT, etc., as needed

🧪 Step 4: Test Your Setup

You can test your delegation using tools like:

Make sure:

  • You see the subdomain’s name servers.
  • Queries like api.dev.example.com resolve properly (after propagation).

🔁 Optional: Delegate Across AWS Accounts

If the subdomain is in a different AWS account:

  • Same process applies.
  • Just copy the subdomain NS records and add them to the parent zone in your original account.

🛠️ Tips & Troubleshooting

  • Propagation: NS changes may take a few minutes to hours to propagate.
  • Match NS records: Ensure all 4 name servers from the subdomain zone are added to the parent zone.
  • Don’t delete the NS record in the subdomain zone — it's required.