AWS - Route53

DNS 101

DNS is used to convert human friendly domain names into an Internet Protocol (IP) address (such as 82.124.53.1).

IP addresses are used by computers to identify each other in a network. IP addresses commonly come in 2 different forms, IPv4 and IPv6.

Top level domains are controlled by the Internet Assigned Numbers Authority (IANA) in a root zone database which is essentially a database of all available top level domains.

Domain Registrars
Because all of the names in a given domain name have to be unique there needs to be a way to organize this all so that domain names aren't duplicated. This is where domain registrars come in. A registrar is an authority that can assign domain names directly under one or more top-level domains. These domains are registered with InterNIC, a service of ICANN, which enforces uniqueness of domain names across the Internet. Each domain name becomes registered in a central database known as WhoIS database.

SOA Records
The SOA (Start of Authority) record stores information about
  • The name of the server that supplied the data for the zone.
  • The administrator of the zone.
  • The current version of the data file.
  • The number of seconds a secondary server should wait before checking for updates.
  • The number of seconds a secondary server should wait before retrying a failed zone transfer.
  • The maximum number of seconds that a secondary name server can use data before it must either refreshed or expire.
  • The default number of seconds for the time-to-live (TTL) on resource needs.
NS Records
NS stands for Name Server records and are used by Top Level Domain servers to direct traffic to the Content DNS server which contains the authoritative DNS records.

A Records
 An "A" record is the fundamental type of DNS record and in the "A" in A record stands for "Address". The A record is used by a computer to translate the name of the domain to the IP address.

TTL
The length that a DNS record is cached on either the Resolving Server or the users own local PC is equal to the value of the "Time to Live" (TTL) in seconds. The lower the time to live, the faster changes to DNS records take to propagate throughout the internet.

CNAMES
A Canonical Name (CNAME) can be used to resolve one domain name to another. For example, you you may have a mobile website with the domain name http://m.cloud.guru that is used for when users browse to your domain name on their mobile devices. You may also want the name http://mobile.acloud.guru to resolve to this same address.

Alias Records
Alias records are used to map resource record sets in your hosted zone to Elastic Load Balancers, CloudFront distributions, or S3 buckets that are configured as websites.

Alias records work like a CNAME record in that you can map one DNS name (www.example.com) to another target DNS name (elb24.elb.amazonaws.com).

Key Difference - A CNAME can't be used for naked domain names (zone apex record). You can't have a CNAME for http://acloud.guru, it must be either an A record or an Alias.

Alias resource record sets can save you time because Amazon Route 53 automatically recognizes changes in the record sets that the alias resource record set refers to.

For example, suppose an alias resource record set for example.com points to an ELB load balance at lb1-1234.us-east-1.elb.amazonaws.com. If the IP address of the load balancer changes, Amazon Route 53 will automatically reflect those changes in DNS answers for example.com without any changes to the hosted zone that contains record sets for example.com.

Routing Policies

Simple

This is the default routing policy when you create a new record set. This is most commonly used when you have a single resource that performs a given function for your domain, for example, one web server that serves content from http://alexmorelos.com.

Weighted

Weighted Routing policies let you split your traffic based on different weights assigned. For example, you can set 10% of your traffic to go to US-EAST-1 and 90% to go to US-WEST-1.

Latency

Latency based routing allows you to route traffic based on the lowest network latency for your end user (ie, which region will give them the fastest response time). To use latency-based routing you create a latency resource record set for the Amazon EC2 (or ELB) resource in each region that hosts your website. When Amazon Route53 receive a query for your site, it selects the latency resource record set for the region that gives the user the lowest latency. Route 53 then responds with the value associated with the resource record set.

Failover

Failover routing policies are used when you want to create an active/passive setup. For example, you may want your primary site to be be US-EAST-1 and your secondary DR site US-WEST-1. Route 53 will monitor the health of the primary site using a health check. 

Geolocation

Geolocation routing lets you choose where your traffic will be sent based on the geographic location of you users (the location from where DNS queries originate). For example, you may want all queries from Europe based users go to your fleet EC2 instances configured for your EC2 users.

Comentarios