Section 10 - Route 53

  • DNS
    • Domain Name System which translates the human friendly hostnames into the machine IP address
    • Uses hierarchical naming structure
    • Domain Registrar: Amazon Route 53, GoDaddy
    • DNS Records: A, AAAA, CNAME
    • Zone file: contains DNS records
    • Name Server: resolves DNS queries (Authoritative or Non-Authoritative)
    • Top Level Domain (TLD): .com, .us, .org
    • Second Level Domain (SLD): amazon.com, google.com
  • Amazon Route 53
    • Highly available, scalable, fully managed and Authoritative DNS
    • Authoritative = the customer (you) can update the DNS records
    • Route 53 is a Domain Registrar
    • Ability to check the health of your resources
    • Only AWS service which provides 100% availability SLA
    • Records
    • Define how you want to route traffic for a domain
    • Each record contains:
      • Domain/subdomain Name
      • Record Type
      • Value
      • Routing Policy
    • Supports the following DNS record types:
      • A - maps a hostname to IPv4
      • AAAA - maps a hostname to IPv6
      • CNAME - maps a hostname to another hostname
      • The target is a domain name which must have an A or AAAA record
      • Can't create a CNAME record for the top node of a DNS namespace (Zone Apex)
      • Example: you can't create for example.com, but you can for www.example.com
      • CNAME vs Alias
        • CNAME
        • Points a hostname to any other hostname
        • Only for non root domain
        • Alias
        • Points a hostname to an AWS Resource
        • Works for Root domain and non root domain
        • free of charge
        • native health checks
        • Extension to DNS functionality
        • Automatically recognizes changes in the resource's IP addresses
        • Unlike CNAME, it can be used for the top node of a DNS namespace (Zone Apex)
        • Alias record is always of type A/AAAA for AWS resources
        • You can't set the TTL
        • Records Targets
          • ELB, CloudFront Distributions, API Gateway, Elastic Beanstalk environments, S3 Websites
          • Cannot set an ALIAS record for an EC2 DNS name
      • NS - Name Servers for the Hosted Zone
      • control how traffic is routed for a domain
    • TTL (Time to Live)
      • High TTL - 24hr
      • Less traffic on route 53
      • Possibly outdated records
      • Low TTL - 60s
      • More traffic on Route 53
      • Records are outdated for less time
      • Easy to change records
      • Except for Alias records, TTL is mandatory for each DNS
    • Hosted Zones
    • Container for records that define how to route traffic to a domain and its subdomains
    • Public Hosted Zones - contains records that specify how to route traffic on the internet (public domain names)
    • Private Hosted Zones - contain records that specify how you route traffic within one or more VPCs (private domain names)
    • Routing Policies
    • Define how Route 53 responds to DNS queries
    • DNS does not route any traffic, it only responds to the DNS queries
    • Supports the following routing policies
      • Simple
      • Typically route traffic to a single resource
      • can specify multiple values in the same record
      • If multiple values are returned, a random one is chosen by the client
      • When Alias enabled, specify only one AWS resource
      • Can't be associated with Health Checks
      • Weighted
      • Control the % of the requests that go to each specific resource
      • Assign each record a relative weight:
        • traffic (%) = Weight for a specific record/Sum of all the weights for all records
        • Weights don't need to sum up to 100
      • DNS records must have the same name and type
      • Can be associated with Health Checks
      • Use Cases: load balancing between regions, testing new application version
      • Assign a weight of 0 to a record to stop sending traffic to a resource
      • If all records have weight of 0, then all records will be returned equally
      • Failover
      • Latency based
      • Redirect to the resource that has the least latency close to us
      • Super helpful when latency for users is a priority
      • Latency is based on traffic between users and AWS regions
      • Can be associated with Health Checks (has a failover capability)
        • HTTP Health Checks are only for public resources
        • Automated DNS Failover:
        • Health checks that monitor an endpoint
          • about 15 global health checkers will check the endpoint health
        • Health checks that monitor other health checks
        • Health checks that monitor cloudwatch alarms
        • Integrated with CW metrics
      • Geolocation
      • Routing based on user loaction
      • Specify location by Continent, Country or by US State
      • Should create a "Default" record
      • Use cases: website localizations, restrict content distributions, load balancing
      • Associated with health checks
      • Multi-Value Answer
      • Geoproximity (Route 53 Traffic Flow feature)
      • Route traffic to your resources based on the geographic location of users and resources
      • Ability to shift more traffic to resources based on the defined bias
      • To change the size of the geographic region, specify bias values
      • Must use Route 53 traffic flow to use this feature
    • Traffic Flow
    • Simplify the process of creating and maintaining records in large and complex configs
    • Visual editor to manage complex routing decision trees
    • Configurations can be saved as Traffic Flow Policy
      • can be applied to different route 53 hosted zones
      • supports versioning
    • Multi-value
    • Use when routing traffic to multiple resources
    • Route 53 return multiple values/resources
    • Can be associated with Health Check (return only values for healthy resources)
    • Up to 8 healthy records are returned for each Multi-Value query
    • Mult-Value is not a substitute for having an ELB
    • Domain Registar vs DNS Service
    • You buy or register your domain name with a Domain Registrar typically by paying annual charges
    • The Domain Registrar usually provides you with a DNS service to manage your DNS records
    • But you can use another DNS service to manage your DNS records
      • Ex: Purchase the domain from GoDaddy and use Route 53 to manage your DNS records