1️⃣ What is Route 53?

  • Amazon Route 53 is a scalable DNS (Domain Name System) service

  • It translates:

    google.com β†’ 142.250.xxx.xxx (IP address)
    
  • Named Route 53 because:

    • β€œRoute” β†’ traffic routing
    • β€œ53” β†’ DNS uses port 53


2️⃣ Core Functions of Route 53

πŸ“Œ 1. Domain Registration

  • Buy and manage domain names
    • Example: om-mapari.com (btw i use cloudflare for dns)

πŸ“Œ 2. DNS Routing

  • Maps domain β†’ IP / resource
  • Works with:
    • EC2
    • S3
    • Load Balancer
    • CloudFront

πŸ“Œ 3. Health Checking

  • Monitors endpoints
  • Routes traffic only to healthy resources

3️⃣ Key Components

πŸ“Œ Hosted Zones

  • A container for DNS records
  • Types:
    • Public Hosted Zone β†’ internet-facing 🌍
      • Accessible over internet
      • Used for Websites
    • Private Hosted Zone β†’ inside VPC πŸ”’
      • Works inside VPC only
      • Used for
        • Internal microservices
        • Example: db.internal β†’ private IP inside VPC

πŸ“Œ DNS Records

Record TypePurpose
A RecordDomain β†’ IPv4 address
CNAMEDomain β†’ another domain
AliasAWS resource mapping (LB, S3, etc.)
NSName servers (DNS resolution)
SOAStart of Authority (metadata, rarely used)
AAAADomain β†’ IPv6

πŸ“Œ Important:

  • NS record β†’ resolves domain
  • A/CNAME β†’ routes traffic to resource

πŸ“Œ Alias Record (Important ⭐)

  • AWS-specific
  • Points to:
    • ELB
    • CloudFront
    • S3
  • Benefits:
    • No cost
    • Supports root domain (example.com)

πŸ“Œ Step-by-step setup if you buy domain from other registrar :

  1. Buy domain from registrar (GoDaddy, Google Domains, etc.)
  2. Create Hosted Zone in Route 53
  3. Copy AWS Name Servers (NS records)
  4. Replace registrar DNS with AWS NS
  5. πŸ“Œ Key: Always use Route 53 NS, not registrar default NS


4️⃣ Routing Policies (VERY IMPORTANT πŸ”₯)


πŸ“Œ 1. Simple Routing

  • Flow: User β†’ Route 53 β†’ A Record β†’ EC2 IP
  • Steps:
    • Create A record
    • Point to EC2 public IP
  • Problem:
    • IP is static β†’ breaks if instance changes


πŸ“Œ 2. Weighted Routing

  • Distributes traffic based on percentage
Server A β†’ 70%
Server B β†’ 30%

πŸ“Œ 3. Failover Routing

  • Primary + Secondary setup If primary fails β†’ switch to backup
  • πŸ“Œ Flow:
    • If Primary works β†’ serve traffic
    • If Primary fails β†’ switch to Secondary
  • Use cases:
    • Disaster recovery
    • High availability

πŸ“Œ 4. Geolocation Routing

  • Route traffic based on user location (country)
  • Example:
    • India β†’ Server A
    • US β†’ Server B
  • Use cases:
    • Region-specific content
    • Compliance (data locality)
India β†’ Indian server
US β†’ US server

5️⃣ TTL (Time To Live)

  • Time DNS record is cached
  • Example:
    • TTL = 300 sec
  • Lower TTL:
    • Faster updates ⚑
    • More DNS queries

6️⃣ Alias vs CNAME

FeatureAliasCNAME
AWS-specificβœ…βŒ
Root domain supportedβœ…βŒ
CostFreeCharged
TargetAWS resourcesDomain only

πŸ“Œ Example:

  • om-mapari.com β†’ Alias (works)
  • om-mapari.com β†’ CNAME (❌ not allowed)

7️⃣ Domain Resolution Flow (VERY IMPORTANT πŸ”₯)

Add this for strong fundamentals:

User β†’ Local DNS cache  
     β†’ ISP DNS  
     β†’ Root DNS  
     β†’ TLD (.com)  
     β†’ Route 53 NS  
     β†’ A Record  
     β†’ IP β†’ Server

8️⃣ Real-World Architecture (Nice Add-on)

User  
 ↓  
Route 53 (DNS)  
 ↓  
CloudFront (CDN)  
 ↓  
Load Balancer  
 ↓  
EC2 / ECS / Lambda

9️⃣ Pricing Basics

  • Charged for:
    • Hosted zones
    • DNS queries
    • Health checks
  • Domain registration extra