DEV Community

Cover image for Amazon Route 53 to Route End Users
Abhinav Pathak
Abhinav Pathak

Posted on

Amazon Route 53 to Route End Users

Amazon Route 53 is the domain name management service provided by AWS.The domain name management system or DNS is responsible for translating domain names to IP addresses every time we use the internet, similar to a phone book that translates from a person to an actual number to dial. As such, DNS is part of the essential fabric that holds together the internet.

When you use Amazon Route 53 to register a domain, the service becomes the authoritative DNS server for the domain and creates a public hosted zone. A Public zone defines how traffic is routed on the public internet. A Private zone defines how traffic is routed inside a virtual private cloud or VPC. VPCs intended to be used with Private Zones need to have DNS Hostname and DNS Support enabled in their configuration.

Image description

Private and Public Hosted Zones are made of records. There is a variety of record types. Two of the more important record types are the Name Server or NS record type and the Start of Authority or SOA record type. Amazon Route 53 creates a set of 4 unique NS records and 1 SOA record in each hosted zone created.

The Name Server (NS) records are used to identify the DNS servers for a given hosted zone.

The Start of Authority (SOA) record is used to define the authoritative DNS servers for an individual DNS zone.

These two records are essential to integrating your domain to the existing DNS system.

Route 53 supports the common record types of DNS including:

The A record is used to map a hostname to an IP address. An A record is used for IPv4 address.

The AAAA record is also used to map a hostname to an IP address. The AAAA record is used for IPv6 addresses.

A Mail exchange (MX) record is used to identify email servers for a given domain. You can have more than one and set the priority using a number. For example, you may have a primary email server with a priority of 10 and a secondary email server with a priority of 20. The lowest number record is used first.

The text (TXT) record is used to provide information in a text format to systems outside of your domain. It has multiple use cases.

A canonical name or CNAME is used to map a hostname to another hostname. This can be used to map multiple names to the same host. For example, when a server needs to respond as webserver using the hostname WWW and mail server using the hostname MAIL at the same time.

Please note that DNS supports record types above and beyond those mentioned here.

One record type that is outside the scope of DNS is the Alias record type.

The Alias record type is unique to Amazon Route 53 and maps a custom hostname in your domain to an AWS Resource which is usually represented by an internal AWS name. For example, CloudFront distributions, Amazon S3 buckets, and Elastic Load Balancers provide you a domain name that is internal to AWS. You can use an alias record to define a custom name to that resource. You can also use Alias records to map to apex records which are the top nodes of a DNS namespace like on example.com or cloudacademy.com

When you create a record using Route 53 you specify the record name, the record type, the actual value, the Time-To-Live in seconds, and the Routing policy for this record.

The Time to Live specifies the amount of time the record is considered valid. The same record result obtained before is used in the future and DNS won’t be queried again until the TTL has expired.

The Routing policy for a record defines how to answer a DNS query. Each type of policy does something different including the possible use of health checks. Let’s talk about those health checks first.

Image description

Amazon Route 53 health checks are independent resources that can be used by most routing policies when defining a record. When you create a health check, Route 53 sends requests to the endpoint every 30 seconds, and based on the responses, Route 53 decides if the endpoint is Healthy or UnHealthy and uses that information to determine what value to provide as an answer to the query.

You can also configure a health check for other “health checks” allowing you to independently verify different tiers of your application before the actual total application is considered healthy. Amazon Route 53 adds up the number of health checks considered healthy and compares that number to the health threshold value you specify.

With Route 53 health checks you can also monitor the state of a cloud watch alarm. The health check status is healthy when the alarm is in the OK state. The health check status is unhealthy when the alarm status is in the ALARM state. You can also choose what the health check status is when the alarm is in the INSUFFICIENT state. The options are healthy, unhealthy or “last known status”.

When Route 53 receives a query it chooses a record based on the routing policy, it then determines the current health of the selected record by checking the status of the health check for that record and responds to the query with the value of a healthy record. Unhealthy records are not considered. If you do not associate a health check with a record, Route 53 treats those records as always healthy.

The health check is performed by a fleet of health checkers located worldwide. You can use the list of recommended health checkers by region or customize the list to the regions specific to your business. Health checks are performed every 30 seconds unless you specify every 10 seconds.

Endpoint health checks can be specified by IP address or by domain name. The health check protocol can be TCP, HTTP, or HTTPS. For the HTTP-related protocols, you can use an optional string matching where you indicate that Route 53 is to search the response body for the string specified. Route 53 considers the endpoint healthy only if the string specified appears entirely within the first 5120 bytes of the response body.

Finally, for all health checks, you can choose to get notified when it fails.

Image description

Top comments (0)