What is AWS Route 53

Published by

on

Table of Contents

  1. What is DNS?
  2. Components of DNS
  3. How DNS Works?
  4. What is Amazon Route 53 or AWS Route 53?
  5. Creating Records in Route 53
  6. CNAME vs ALIAS Record
  7. Routing Policies in Route 53
  8. Health Checks in Route 53

What is DNS?

The Domain Name System (DNS) converts hostnames into IP addresses.

Components of DNS

There are several important components in AWS Route 53:

  • Domain Registrar: Where you host or register the domains, such as GoDaddy or Amazon Registrar Inc. Domain registrars usually provide you DNS services to manage your domain records. For instance, when you register a domain with GoDaddy, you need to copy the Name servers from Route 53 to GoDaddy.
    • Create a hosted zone in Route 53.
    • Update NS records on the 3rd party website to use Route 53 NS. When someone queries, GoDaddy forwards the request to Amazon Route 53 servers.
  • DNS Records: Where you add records such as A, AAAA, CNAME, NS, etc.
  • Zone File: This contains DNS records.
  • Name Server: Resolves the DNS queries.
  • Top Level Domain (TLD): Such as .com, .us, .in, etc.
  • Second Level Domain: Such as amazon.com, google.com, etc.

How DNS Works?

Let’s say you need to access a web server; the following occurs in the backend:

  1. A request is made through a web browser.
  2. The request lands first on the Local DNS server managed by the ISP.
  3. If not found, the request is forwarded to the Root DNS server.
  4. If still not found, the request is forwarded to the Top Level DNS server.
  5. Finally, if not found, the request is forwarded to the Second Level DNS server, managed by the domain registrar like Amazon Registrar or GoDaddy.

What is Amazon Route 53 or AWS Route 53?

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service. You can use Route 53 to perform three main functions in any combination: domain registration, DNS routing, and health checking.

Route 53 is a Managed DNS service that contains rules and records, helping clients reach the server through URLs.

For Example: You can add A records, AAAA records, Alias records, CNAME records, etc.

Key Components of Route 53 Records

Records play an essential role in Route 53, allowing you to route traffic accordingly. Each record contains:

  • Domain Name, Subdomain: When you register a domain, a hosted zone is also created, where you add and manage the records. Under the hosted zone, create a record set where you will define the IP address, region, and latency name.
  • Record Type
  • Value of Record
  • Routing Policy
  • TTL: The amount of time the record is cached at the DNS resolver. A lower TTL means more requests for new content, while a higher TTL results in fewer requests and older content.

DNS Record Types

  • A: Maps hostname to IPv4.
  • AAAA: Maps hostname to IPv6.
  • CNAME: Maps a hostname to another hostname. The target domain must have an A or AAAA record, and a CNAME record cannot be created for the top node of the DNS namespace.
  • NS: Name servers for hosted zones control how traffic is routed for a domain.
  • Hosted Zones: A container for records that define how to route traffic to a domain and its subdomains. There are two types: private and public hosted zones.

Creating Records in Route 53

To create a record in Route 53:

  1. Go to hosted zones and click on “Create Record.”
  2. Add a quick create record.

Once you add the record, you may use tools like dig or nslookup to check the records. The nslookup tool can be installed on Cloud Shell using the command:

sudo yum install -y bind-utils

CNAME vs ALIAS Record

Let’s check the difference between CNAME and ALIAS records.

CNAME:

  • Used to map one domain to another domain, e.g., abc.def.com to lmn.opq.com.
  • Only works for non-root domains.

ALIAS:

  • Used to map one domain to another AWS resource, e.g., abc.def.com to abc.amazonaws.com.
  • Works for both non-root and root domains.
  • Free of charge.
  • For example, you can map example.com to a Load Balancer (myalb-12345.us-east-1.elb.amazon.com).
  • Automatically recognizes changes in resource IP addresses.
  • Alias records are always of type A/AAAA for AWS resources.
  • You can evaluate the health of the target with an Alias record.
  • Resource targets include: Load Balancer, CloudFront distribution, API Gateway, Elastic Beanstalk, S3 websites, VPC Interface endpoints, and Route 53 records in the same hosted zone.

Routing Policies in Route 53

Routing policies help identify how Route 53 responds to DNS queries. Below are some routing policies:

  • Simple Routing Policy: Routes traffic to a single resource. Multiple values can be specified in the same record, but a random one is returned, with no health checks involved.
  • Weighted Routing Policy: Routes based on specified weights for load balancing.
  • Latency Routing Policy: Routes based on user location to ensure lower latency. A default record can be created for unmatched locations.
  • Failover Routing Policy: Implemented based on disaster recovery with health checks. One instance is in a primary site (active), while another is in a disaster recovery site (passive).

  • Geo Location: Routes traffic according to the geographic location of users.
  • Multi-Value Routing Policy: Routes traffic to multiple resources by returning multiple values.
  • Geoproximity: Routes traffic based on the geographic locations of users and resources.
  • IP-based Routing: Routes based on clients’ IP addresses to optimize performance and reduce network costs, with corresponding CIDR for clients and endpoints.

Health Checks in Route 53

Health checks monitor the health of load balancers. There are three types of health checks available in Route 53:

  • Health Check with Automated DNS Failover: Monitors an endpoint (e.g., application, server, and other AWS resources). It passes only if the response from the endpoint is 2xx or 3xx.
  • Calculated Health Checks: Combines results from multiple health checks.
  • Private Hosted Zones: Cannot access private endpoints (e.g., private VPC or on-premises resources). You can create CloudWatch metrics and associate alarms, allowing the health check to monitor the alarm itself.

Creating Health Checks in Route 53

To create health checks in Route 53:

  1. In the AWS console, go to Health Checks and click on “Create Health Checks.”
  2. Choose what to monitor from the following:
    • Endpoint
    • Status of other health checks (calculated health checks).
    • State of CloudWatch alarms.

Conclusion

In summary, understanding the Domain Name System (DNS) and its components, particularly within the context of Amazon Route 53, is pivotal for effective web resource management. From creating DNS records to implementing various routing policies and health checks, Route 53 offers robust features that enhance the reliability and performance of web applications. Mastery of these concepts not only aids in successful domain management but also optimizes traffic routing, ensuring that end-users experience seamless access to applications and services. As cloud infrastructure continues to evolve, tools like Route 53 will remain essential for maintaining efficient and scalable web architectures.