AWS Route53

# DNS Terminologies

  • Domain Registrar: Amazon Route 53, GoDaddy
  • DNS Records: A, AAAA, CNAME, NS, …
  • Zone File: contains DNS records
  • Name Server: resolves DNS queries
  • Top Level Domain (TLD): .com, .org, .icu
  • Second Level Domain (SLD): amazon.com, google.com

FQDN -> http://api.example.com

# Route53

A highly available, scalable, fully managed and Authoritative DNS, and a Domain Registrar. 100% availability SLA

# Records

Route53 supports following DNS record types: A, AAAA, CNAME, NS; CAA, DS, MX, NAPTR, PTR, SOA, TXT, SPF, SRV

  • Domain/SubDomain name - example.com
  • RecordType - A or AAAA
  • Value - 12.34.56.78
  • Routing Policy
  • TTL

record types

  • A - hostname IPv4
  • AAAA - hostname IPv6
  • CNAME - another hostname
    • the target is a domain name which must have an A or AAAA record
    • eg. www.example.com -> example.com
  • NS - Name Servers for the hosted zone

Route53 supports Public/Private hosted zones. (mypublicdomain.com / company.internal)

CNAME vs Alias

  • CNAME
    • Points a hostname to any other hostname
    • ONLY FOR NON-ROOT DOMAIN (aka.something.mydomain.com)
  • Alias
    • Points a hostname to an AWS Resource
    • Works for ROOT DOMAIN and NON-ROOT DOMAIN (mydomain.com)
    • Free of charge
    • Native health check
    • automatically recognizes changes in the resource’s IP address
    • but can’t set the TTL
    • targets
      • ELB
      • CloudFront
      • API Gateway
      • Beanstalk environment
      • S3
      • VPC interface endpoints
      • Global Accelerator
      • Route53 record

# Routing Policy

  • Simple
    • route traffic to single/multiple value
    • can specify multiple values in the same record
    • if multiple values are returned, a random one is chosen by the client
    • no health check
  • Weighted
    • Control the % of the requests that go to each specific resource
    • DNS records must have the same name and type
    • health checks
    • assign weight to 0 to prevent traffic
    • if all records’ weight are 0, they will be treated equally
  • Failover
    • active-passive
    • active-active
  • Latency based
    • Redirect to the resource which has the least latency
    • latency is based on traffic between users and AWS Regions
    • health check
  • Geolocation
    • based on user location
    • should create a “default” record
  • Multi-Value answer
  • Geoproximity
    • ability to shift more traffic to resources based on the defined bias
    • must use Route53 Traffic Flow to use this feature
  • IP-based (CIDRs)
  • Multi-Value
    • up to 8 healthy records are returned for each query
    • Multi-value is not a substitute for having an ELB

# Health Check

  • Health checks are only for public resources
  • About 15 global health checkers will check the endpoint health
    • healthy/unhealthy threshold - 3 by default
    • interval 30s
    • if > 18% of health checkers report ok, Route53 considers it healthy
  • only pass when 2xx, 3xx status codes
  • Health Checks can be setup to pass / fail based on the text in the first 5120bytes of the response
  • calculated health checks (combination)
    • OR, AND, NOT
    • up to 256 child health checks
  • route53 health checkers are outside the VPC
    • create a cloud-watch metric and associate a cloud-watch alarm, then create a health check that checks the alarm itself

# Quick Catchups

  • 53 is a reference to the traditional DNS port

# References

Get Things Done
Built with Hugo
Theme Stack designed by Jimmy