🧩Route-53

SivaranjanSivaranjan
4 min read

What is AWS Route 53?

AWS Route 53 is a scalable and highly available Domain Name System (DNS) web service. It performs three major functions:

  1. Domain registration

  2. DNS routing

  3. Health checking


πŸ“¦ Core Components of Route 53

ComponentDescription
Hosted ZoneContainer for records for a domain
Record SetsMapping from domain names to resources (e.g., A, CNAME, MX, etc.)
Health ChecksMonitor health of resources like web servers
Routing PoliciesDefine how Route 53 responds to DNS queries (Simple, Weighted, Failover, etc.)
Domain RegistrationRegister domain names directly through Route 53

🧰 Use Cases

Use CaseExample
Website HostingRoute traffic to S3 static website, EC2, or ELB
Load BalancingDistribute traffic using weighted routing to multiple regions
Failover SetupAutomatically switch to backup site if primary fails (Failover Routing)
Latency-Based RoutingRoute users to closest AWS region for low latency
Multi-region High Availability SetupCombine latency + failover routing across regions
Hybrid DNS ResolutionResolve DNS between AWS and on-premises (using Route 53 Resolver)

πŸ—οΈ Architecture Diagram (Overview)

sqlCopyEditUser Request
    |
    v
Route 53
    |
    +-- Public Hosted Zone
    |     +-- A Record --> Application Load Balancer (EC2, EKS, etc.)
    |
    +-- Private Hosted Zone
          +-- Internal Services (e.g., *.internal.example.com)

βš™οΈ Workflow

Scenario: Deploying a Web App Using EC2 Behind ALB

  1. Domain Registration (Optional):

    • Buy domain from Route 53 or transfer an existing one.
  2. Create a Hosted Zone:

  3. Add DNS Records:

    • A Record β†’ Alias to Application Load Balancer

    • CNAME β†’ Used for subdomains like www.myapp.com

  4. Attach Routing Policy:

    • Simple β†’ For single target

    • Weighted β†’ For blue-green deployments

    • Failover β†’ For active-passive failover setup

    • Latency β†’ For performance optimization

  5. Health Check (Optional):

    • Monitor backend EC2 or endpoint

    • Route 53 will remove unhealthy resources from DNS response


πŸͺœ Step-by-Step Setup (Example)

🎯 Objective: Route domain myapp.com to an Application Load Balancer

βœ… Prerequisites:

  • An EC2-based application behind an Application Load Balancer

  • A registered domain name (e.g., from Route 53 or GoDaddy)

  • IAM permissions to manage Route 53


πŸ”§ Steps:

1. Create Hosted Zone

  • Go to Route 53 β†’ Hosted Zones

  • Click Create Hosted Zone

  • Choose type: Public Hosted Zone

  • Enter domain name: myapp.com

2. Get NS Records

  • Copy the Name Server (NS) records generated

  • If domain is external, update nameservers at your registrar

3. Create A Record (Alias to ALB)

  • In your hosted zone, create a new record:

    • Type: A – IPv4 address

    • Alias: Yes

    • Alias Target: Choose your ALB

    • Routing Policy: Simple / Weighted / Latency, etc.

    • TTL: 60 seconds (default)

4. Optional: Create CNAME Record

5. Health Check (Optional)

  • Create health check to monitor EC2 or endpoint.

  • Attach health check to record for failover setup.


🚦 Routing Policy Examples

TypeUse CaseExample Setup
SimpleSingle endpointA β†’ ALB/EC2
WeightedGradual traffic shifting or A/B testing80% traffic to us-east-1, 20% to us-west-2
FailoverHigh availability with active-passive setupPrimary = us-east-1, Secondary = us-west-2
LatencyRoute to region with lowest latencyUsers in India go to ap-south-1, US to us-east-1
GeolocationRoute based on user’s geographic locationUsers in UK β†’ EU servers, US β†’ US servers
MultivalueReturn multiple healthy endpoints (basic load balancing)3 healthy IPs for the same record

πŸ›οΈ Architecture Example: Multi-region Failover

lessCopyEdit[Client]
   |
   v
[Route 53]
   |
   +-- Health check: us-east-1 ALB
   |      |
   |      v
   |   [App in us-east-1]
   |
   +-- (Failover if unhealthy)
          |
          v
     [App in us-west-2]

⚠️ Best Practices

  • Use alias records instead of hardcoding IPs for AWS resources.

  • Use private hosted zones for internal services within a VPC.

  • Set up health checks + failover for high availability.

  • Use latency or geolocation routing for global apps.

  • Monitor DNS TTL and propagation delays when updating records.


πŸ§ͺ Real-Time Use Case (Blue-Green Deployment)

  1. Deploy v1 of your app to blue.myapp.com (ALB1)

  2. Deploy v2 to green.myapp.com (ALB2)

  3. Weighted routing:

    • Blue = 90%, Green = 10%

    • Gradually shift traffic

  4. Monitor health check

  5. Update myapp.com alias to point fully to green when stable

0
Subscribe to my newsletter

Read articles from Sivaranjan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sivaranjan
Sivaranjan

Cloud & DevOps Engineer | AWS Solutions Architect | Terraform Associate | Love to work with #AWS #Terraform #Docker #Kubernetes #Jenkins #GitHub #Linux