Ace Cloud Interviews
🌐

AWS Networking & CDN

Route 53

Highly available DNS service with traffic routing policies and health checking

Amazon Route 53 is a highly available, scalable DNS service that also provides domain registration and health checking. It is deeply integrated with AWS services and supports advanced traffic routing policies that enable architectures like blue/green deployments, latency-based routing, and failover - making it essential knowledge for any AWS architect.

DNS Record Types and Alias Records

Route 53 supports all standard DNS record types and adds a proprietary Alias record type that eliminates the need for CNAME at zone apex (root domain).

Record TypePurposeExample
AIPv4 addressapi.example.com -> 52.10.20.30
AAAAIPv6 addressapi.example.com -> 2001:db8::1
CNAMECanonical name aliaswww.example.com -> example.com (not at zone apex)
AliasAWS-specific alias (free queries, works at apex)example.com -> ALB or CloudFront domain
MXMail server routingexample.com -> mail.example.com with priority
TXTText records for verificationSPF, DKIM, domain ownership verification
NSNameserver delegationDelegates a subdomain to another hosted zone
PTRReverse DNS lookupIP -> hostname for email reputation
SRVService location recordsUsed by some SaaS discovery protocols
💡

Use Alias records instead of CNAMEs whenever pointing to AWS resources (ALB, CloudFront, S3 website, API Gateway). Alias records are free, work at the zone apex, and respond with the actual IP addresses of the target.

Routing Policies Compared

Route 53 routing policies control which record values are returned to DNS queries. They can be combined with health checks for automatic failover.

PolicyHow It WorksUse Case
SimpleReturns all values; client choosesSingle resource; no health checks
WeightedReturns records proportionally by weight (0-255)A/B testing; gradual deployments (10/90 split)
LatencyReturns the region with lowest measured latency for the userMulti-region apps; improves user experience
FailoverReturns primary unless health check fails, then secondaryActive-passive DR; regional failover
GeolocationRoutes by user's country or continentData sovereignty; localized content
GeoproximityRoutes by geographic distance with bias adjustmentFine-grained regional control; Traffic Flow only
Multi-valueReturns up to 8 healthy records randomlyClient-side load balancing; basic HA without ALB
IP-basedRoutes by CIDR block of the resolverISP-specific routing; known IP ranges
⚠️

Geolocation routes by the user's DNS resolver location, not the user's actual IP. Users on corporate or public DNS resolvers (like 8.8.8.8) may be incorrectly geolocated. Always have a default record for geolocation - queries that don't match any location would otherwise return NXDOMAIN.

Health Checks and DNS Failover

Route 53 health checks monitor endpoints and can automatically remove unhealthy records from DNS responses. They work across all routing policies.

Health Check TypeWhat It MonitorsKey Setting
EndpointHTTP/HTTPS/TCP to a specific IP or domainInterval: 10s (fast) or 30s; threshold: 3 failures
CalculatedCombines multiple child health checks with AND/OR logicGood for service-level composite status
CloudWatch AlarmHealth is based on a CloudWatch alarm stateFor resources Route 53 cannot reach directly (private)

For resources in private VPCs, Route 53 health checkers cannot reach them directly because they operate from public IP ranges. Use a CloudWatch alarm health check instead - create a CloudWatch alarm on a metric (e.g., ALB HealthyHostCount), then link the Route 53 health check to that alarm.

bash
# Create a health check for an HTTP endpoint
aws route53 create-health-check \
  --caller-reference 2024-01-01 \
  --health-check-config \
  "Type=HTTP,FullyQualifiedDomainName=api.example.com,Port=80,RequestInterval=30,FailureThreshold=3"

# Create a failover record set (primary)
aws route53 change-resource-record-sets \
  --hosted-zone-id Z1234 \
  --change-batch '{
    "Changes": [{
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "api.example.com",
        "Type": "A",
        "Failover": "PRIMARY",
        "HealthCheckId": "abc-123",
        "AliasTarget": {
          "DNSName": "my-alb.us-east-1.elb.amazonaws.com",
          "EvaluateTargetHealth": true,
          "HostedZoneId": "ZALBHOSTEDZONEID"
        }
      }
    }]
  }'

Private Hosted Zones and DNS Resolution

Private hosted zones let you resolve custom domain names within VPCs without exposing them to the internet. They are essential for service discovery in multi-VPC architectures.

FeaturePublic Hosted ZonePrivate Hosted Zone
Resolvable fromAnywhere on the internetOnly within associated VPCs
RequiresDomain registration or NS delegationAssociated VPCs with enableDnsSupport and enableDnsHostnames enabled
Split-horizon DNSN/ASame name with different values per zone (internal vs external)
Cost$0.50/month + $0.40 per million queries$0.10/month + $0.40 per million queries

For on-premises DNS resolution of Route 53 private zones, use Route 53 Resolver endpoints. An inbound endpoint allows on-premises DNS servers to forward queries to Route 53. An outbound endpoint lets Route 53 forward queries for on-premises domains to your on-premises DNS.

💡

When associating a private hosted zone with VPCs in other accounts, you must use the AWS CLI or SDK - the console only shows VPCs in the same account.

Route 53 Pricing

ComponentPriceNotes
Hosted zone$0.50/month (public), $0.10/month (private)First 25 zones discounted
Standard queries$0.40 per millionMost record types
Latency routing queries$0.60 per millionAdditional cost for latency measurement
Geo DNS queries$0.70 per millionGeolocation and geoproximity
Health checks (AWS endpoint)$0.50/month per checkFast (10s interval): $1.00/month
Health checks (non-AWS)$0.75/month per checkExternal endpoints cost more
Domain registration$9-$400/yearDepends on TLD
🎯

Interview Focus Points

  • 1What is the difference between an Alias record and a CNAME? Why can't you use CNAME at the zone apex?
  • 2Explain how you would implement a blue/green deployment using Route 53 weighted routing.
  • 3How does Route 53 health checking work for resources in a private VPC?
  • 4Walk through how you would set up active-passive failover between two regions using Route 53.
  • 5What is the difference between Geolocation and Latency routing? When would you use each?
  • 6How would you configure split-horizon DNS with Route 53 for internal vs external resolution?
  • 7Explain Route 53 Resolver endpoints and when you need inbound vs outbound endpoints.
  • 8What happens to Route 53 DNS resolution if you have overlapping records in a public and private hosted zone?