Skip to content

AWS Route 53 & CloudFront โ€” DNS & CDN

Amazon Route 53 is a highly available and scalable DNS (Domain Name System) service. It also provides domain registration and health checking.

In Azure terms: Route 53 = Azure DNS + Azure Traffic Manager (for routing policies)

  • Domain registration โ€” Buy and manage domain names
  • DNS hosting โ€” Host DNS zones and serve DNS queries
  • Health checking โ€” Monitor endpoints and route away from unhealthy targets
  • Traffic routing policies โ€” Control how DNS responds to queries
RecordPurposeExample
AMaps hostname to IPv4 addressapi.example.com โ†’ 1.2.3.4
AAAAMaps hostname to IPv6 addressapi.example.com โ†’ 2001:db8::1
CNAMEAlias one hostname to anotherwww.example.com โ†’ myapp.herokuapp.com
AliasAWS-specific CNAME to AWS resources (no charge for queries)app.example.com โ†’ ALB DNS name
MXMail server recordsUsed for email routing
TXTText records for verificationSPF, DKIM, site verification
NSName server recordsWhich servers are authoritative
SOAStart of authorityZone metadata
PolicyDescriptionUse Case
SimpleSingle record, no health checkSingle endpoint
WeightedSplit traffic by percentage (e.g., 90/10)A/B testing, gradual migration
Latency-basedRoute to the region with lowest latencyMulti-region apps
FailoverPrimary/secondary โ€” switch on health check failureDisaster recovery
GeolocationRoute based on userโ€™s geographic locationData sovereignty, localization
GeoproximityRoute based on location + adjustable biasTraffic shaping
MultivalueReturn multiple healthy recordsSimple load balancing

Route 53 can monitor endpoints (HTTP, HTTPS, TCP) and:

  • Return DNS only for healthy endpoints
  • Send SNS alerts when endpoints go unhealthy
  • Enable DNS failover between regions

Amazon CloudFront is a fast, global Content Delivery Network that delivers content (static files, APIs, videos, dynamic web pages) through 400+ edge locations worldwide.

In Azure terms: CloudFront = Azure CDN / Azure Front Door

User in Tokyo โ†’ CloudFront Edge (Tokyo)
โ†“ (cache miss โ€” first request)
Origin Server (us-east-1)
โ†“ (cached for subsequent requests)
User in Tokyo โ† Content served from Edge (< 10ms)
Origin TypeExample
S3 BucketStatic website, file downloads
ALB / EC2Dynamic web apps and APIs
API GatewayServerless API endpoint
Custom HTTPAny HTTP server, on-prem
MediaStore / MediaPackageLive/on-demand video streaming
FeatureDescription
HTTPS / TLSFree SSL certificate via AWS Certificate Manager (ACM)
Geo RestrictionBlock or allow specific countries
Signed URLs / Signed CookiesPrivate content access control
Lambda@EdgeRun Node.js/Python code at the edge (per request)
CloudFront FunctionsLightweight JS at the edge (faster, cheaper than Lambda@Edge)
Origin ShieldExtra caching layer between edges and origin โ€” reduces origin load
Real-Time LogsStream access logs to Kinesis
WAF IntegrationAttach AWS WAF for protection against OWASP threats

Cache behavior determines what gets cached and how:

  • TTL (Time to Live): How long content stays in edge caches
  • Cache-Control headers: Set by origin to control caching
  • Invalidation: Force-expire cached content (charged per invalidation)
Terminal window
# Invalidate all files in a CloudFront distribution
aws cloudfront create-invalidation \
--distribution-id E1234567890 \
--paths "/*"
User โ†’ Route 53 (DNS: mysite.com โ†’ CloudFront)
โ†’ CloudFront (HTTPS, edge caching)
โ†’ S3 Bucket (HTML/CSS/JS)

This is a common, cost-effective static website hosting pattern:

  1. Host files in S3
  2. Put CloudFront in front (HTTPS, custom domain, caching)
  3. Point your domain in Route 53 to CloudFront with an Alias record
FeatureRoute 53 + CloudFrontAzure Front Door
DNSRoute 53Azure DNS
CDNCloudFrontAzure CDN / Front Door
Custom routingRoute 53 routing policiesTraffic Manager
WAFAWS WAF (attached to CloudFront)Azure WAF (on Front Door)
Edge computeLambda@Edge, CloudFront FunctionsAzure Functions (Central)
DDoSAWS Shield (CloudFront integration)Azure DDoS Protection