AWS · Networking

Route 53

Route 53 is AWS’s DNS service. It connects your domain name to your load balancers, CloudFront distributions and other endpoints.

Intermediate 5 min Lesson 12 of 30
Before you start:Introduction to AWS
0/30 in AWS
On this page · 5 min · Intermediate

Learning objectives#

  • Create a hosted zone
  • Add common record types
  • Use alias records for AWS resources
  • Understand routing policies and health checks

Explanation#

A hosted zone holds the DNS records for a domain. Point your registrar’s name servers to the four Route 53 name servers.

Common records: A (IPv4), AAAA (IPv6), CNAME (alias to another name, not allowed at the zone apex), MX (mail), TXT (verification, SPF).

Alias records are a Route 53 feature that can point the apex (techiebabaji.com) at CloudFront, a load balancer or S3, and queries to AWS resources are free.

Routing policies: simple, weighted, latency-based, failover (with health checks), geolocation and more.

Code example: Alias the apex domain to CloudFront#

JSONchange.json Illustrative
{
  "Changes": [{
    "Action": "UPSERT",
    "ResourceRecordSet": {
      "Name": "techiebabaji.com",
      "Type": "A",
      "AliasTarget": {
        "HostedZoneId": "Z2FDTNDATAQYW2",
        "DNSName": "d1234abcd.cloudfront.net",
        "EvaluateTargetHealth": false
      }
    }
  }]
}
// aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://change.json
Expected output
{ "ChangeInfo": { "Status": "PENDING" } } — after propagation, techiebabaji.com resolves to the CloudFront distribution.

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. UPSERT creates the record or updates it if it exists.
  2. An A record with AliasTarget works at the zone apex, where CNAME is not allowed.
  3. Z2FDTNDATAQYW2 is the fixed hosted zone ID AWS uses for all CloudFront aliases.

Real-world use case#

techiebabaji.com and www point to CloudFront for the React site; api.techiebabaji.com points to a load balancer.

Common mistakes#

CNAME at the zone apex

DNS forbids it. Use an alias A/AAAA record.

Forgetting to update name servers at the registrar

Records in Route 53 do nothing until the domain uses Route 53’s name servers.

Best practices#

  • Use alias records for AWS endpoints
  • Keep TTLs low before migrations
  • Use health checks with failover routing for critical sites
  • Enable DNSSEC where appropriate

Remember this#

Hosted zone = the domain’s record book.

Apex → alias record, never CNAME.

Routing policies: simple, weighted, latency, failover, geo.

Practice exercise#

Your task: Which record type would you add to verify domain ownership for an email provider?

Show solution
Text Illustrative
A TXT record containing the verification string the provider gives you.

Mini quiz#

Route 53 quizMultiple choice Question 1 of 1

Which record lets the apex domain point to a load balancer?

Score so far: 0/0

Want more? Practise all AWS MCQs · AWS interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.