</>
Skip to content
AWS lessons (27/47)

AWS — Route 53

What is Route 53?

Scalable DNS web service for domain registration and routing.

Create hosted zone

aws route53 create-hosted-zone \
  --name example.com \
  --caller-reference $(date +%s)

Create record

aws route53 change-resource-record-sets \
  --hosted-zone-id Z1234567890 \
  --change-batch '{
    "Changes": [{
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "www.example.com",
        "Type": "A",
        "TTL": 300,
        "ResourceRecords": [{"Value": "1.2.3.4"}]
      }
    }]
  }'

Record types

TypePurpose
AIPv4 address
AAAAIPv6 address
CNAMEAlias to another name
MXMail exchange
TXTText record
AliasAWS resource alias

Health checks

aws route53 create-health-check \
  --caller-reference $(date +%s) \
  --health-check-config \
    IPAddress=1.2.3.4,Port=80,Type=HTTP,ResourcePath=/

Failover routing

{
  "Changes": [{
    "Action": "CREATE",
    "ResourceRecordSet": {
      "Name": "www.example.com",
      "Type": "A",
      "SetIdentifier": "primary",
      "Failover": "PRIMARY",
      "AliasTarget": {
        "HostedZoneId": "Z1234567890",
        "DNSName": "elb.amazonaws.com",
        "EvaluateTargetHealth": true
      }
    }
  }]
}

Domain registration

aws route53 domains register-domain \
  --domain-name example.com \
  --duration-in-years 1 \
  --admin-contact ...

Best practices

  1. Use health checks
  2. Set appropriate TTL
  3. Use alias records for AWS resources
  4. Enable DNSSEC

Mini Practice

  1. Create a hosted zone
  2. Add an A record
  3. Set up health checks
  4. Configure failover routing

Up Next

Continue with ECS - Container Service.

Related Topics

Frequently Asked Questions about Route 53

What is Route 53 in AWS?

Route 53 is a fundamental concept in AWS. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Route 53?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Route 53.

Why is Route 53 important in AWS?

Route 53 is essential for AWS development. Understanding this concept will help you write better code and solve real-world problems more effectively.