Route 53 explained

Since the advent of the internet, IP addresses and domain names have been a core component of its ecosystem. You literally cannot use the internet without making use of IP addresses and domain names. Today, we intend to explore Amazon Route 53 which is a Domain Name System (DNS) service provided by AWS. If you are unfamiliar with the term Domain Name System, you are probably wondering what it is all about, so before going on to explore what Route 53 is, its features and capabilities, I’ll like us to first look at what a Domain Name System is. This will help put things into perspective when it comes to Route 53.

What is a Domain Name System?

The domain name system (DNS) is fundamental to everything we do online. Serving as a directory lookup for the Internet, it makes the Internet easier for humans to navigate and makes it easier for services online to be highly resilient.

DNS means that humans and machines can each use the kind of Internet address format most suitable to them. For instance, you can just type internetsociety.org in your web browser instead of the site’s IP (Internet Protocol) address, which would look like “104.18.16.166” (its IPv4 address) or 2606:4700::6812:10a6 (its IPv6 address).

For apps and devices, DNS is often less about making Internet destinations easier to remember—apps don’t have as much difficulty remembering things—and more about making them resilient. That is, DNS makes it possible for an organization to make itself available across many servers, not just one. How is that possible? DNS can be used to point an app to the server that is most appropriate for the user of the service. For example, it could point to a server that is close to the user of the app, instead of a server on the other side of the planet, which would cause a very laggy experience. Most cloud services operate in this manner, with DNS an essential component connecting a user to a computer that is close to them.


Amazon Route 53 is a highly available and scalable authoritative cloud Domain Name System (DNS) service. It connects the Internet traffic to appropriate servers hosting the requested Web application. In addition, route 53 also facilitates health-checking and domain name registration of services. The design of route 53 aims at providing a highly reliable and cost-effective approach for routing end-users to Internet applications. Why the name Route 53! AWS Route 53 takes its name from the Port 53, which handles DNS for both the TCP and UDP traffic requests, the term Route may signify the routing, or perhaps the popular highway naming convention in USA.

What is Amazon Route 53?

Amazon Route 53 is a highly available and scalable authoritative cloud Domain Name System (DNS) service. It connects the Internet traffic to appropriate servers hosting the requested Web application. In addition, route 53 also facilitates health-checking and domain name registration of services. The design of route 53 aims at providing a highly reliable and cost-effective approach for routing end-users to Internet applications. Why the name Route 53! AWS Route 53 takes its name from the Port 53, which handles DNS for both the TCP and UDP traffic requests, the term Route may signify the routing, or perhaps the popular highway naming convention in USA.

Basics Terminologies

Internet Protocol (IP)

It is a numerical label assigned to devices and used by computers to identify each other on a network.

Domain Name System (DNS)

 They are used to convert human readable domain names into IP addresses.

Domain Registrars

 A authority that can assign domain names. Some popular ones are Domain.com, Bluehost, Network Solutions, HostGator, GoDaddy and Amazon Route 53 itself.

DNS hierarchy

Root server

Root servers are the foundation of the DNS hierarchy, operating at the root zone. These specialized DNS nameservers handle queries for records stored or cached in the root zone. If a query falls outside their scope, root servers direct it to the appropriate Top-Level Domain (TLD) server.

There are 13 root server clusters worldwide, managed by organizations like ICANN, ensuring global DNS reliability. For SEO, root servers indirectly impact site speed and accessibility, as they initiate the DNS resolution process, which affects how quickly users can access your website.

Top-Level Domains (TLDs)

Top-Level Domains (TLDs) sit one level below root servers in the DNS hierarchy. They are essential for resolving DNS queries and include extensions like .com, .net, .org, and country-specific ones like .in. TLD servers direct queries to the correct domain nameservers, ensuring users reach the intended website.

For SEO, choosing the right TLD can enhance trust and relevance. For example, .com is universally recognized, while country-specific TLDs like .in can boost local search rankings

Domains

Domains are the core of your online identity, such as amazon.com or google.com. They serve as the primary address users type into their browsers. A well-chosen domain name is critical for branding, user trust, and SEO performance.

Subdomains

Subdomains are extensions of your primary domain, appearing before the main domain name, such as www.google.com or docs.google.com. They allow you to organize different sections of your website, like blogs, stores, or dashboards, under a single domain.

For SEO, subdomains can be treated as separate entities by search engines, which may dilute your main domain’s authority unless managed carefully. However, they’re useful for targeting specific audiences or functionalities

Hosted Zones

n AWS Route 53, a hosted zone is a container for DNS records that defines how traffic is routed for a specific domain (e.g., example.com) and its subdomains (e.g., web.example.com). When you create a public hosted zone, AWS automatically generates a Start of Authority (SOA) record and Nameserver (NS) records unique to that hosted zone. These records ensure proper DNS configuration and routing.

Hosted zones are critical for managing DNS settings efficiently, which directly impacts site performance and SEO. Misconfigured hosted zones can lead to downtime or slow load times, negatively affecting search rankings.

DNS Records

DNS records are what contain the actual information that other browsers or services need to interact with, like your server’s IP address. Nameservers, on the other hand, help store and organize those individual DNS records. Nameservers are the physical phone book itself and DNS records are the individual entries in the phone book

Name Server (NS) records

As discussed earlier it is physical phone book itself. Nameservers play an important role in connecting a URL with a server IP address in a much more human-friendly way. Nameservers look like any other domain name. When you look at a website’s nameservers, you’ll typically see a minimum of two nameservers (though you can use more). Here’s an example of what they look like:
ns-380.awsdns-47.com
Ns-1076.awsdns-06.org
They used by top level domain servers to direct traffic to the content DNS server. It specifies which DNS server is authoritative for a domain. It is of 4 types Recursive resolvers, root nameservers, TLD nameservers, and authoritative nameservers.

Time To Live (TTL)

Length of time the DNS record is cached on the server for in seconds. Default is 48 hours.

Canonical Name (CName)

A CNAME, or Canonical Name record, is a record that points to another domain address rather than an IP address. For example, say you have several subdomains, like www.mydomain.com, ftp.mydomain.com, mail.mydomain.com etc and you want these sub domains to point to your main domain name mydomain.com.

Alias Record

You will use an ALIAS record when you want the domain itself (not a subdomain) to “point” to a hostname. The ALIAS record is similar to a CNAME record, which is used to point subdomains to a hostname. The CNAME record only can be used for subdomains, so the ALIAS record fills this gap. Ex : @ 10800 IN ALIAS example.example.com.
Please note the final dot (.) at the end is necessary for the record to work correctly.

How Route53 Works?

1. A user enters www.codezaza.com into their web browser and presses Enter.

2. The user’s Internet service provider (ISP) forwards the request to a DNS resolver.

3. The DNS resolver contacts a DNS root name server to get the IP address for the .com top-level domain (TLD).

4. The DNS root name server responds with the IP addresses for the .com TLD name servers. The DNS resolver caches these addresses for future use.

5. The DNS resolver contacts one of the .com TLD name servers to get the IP addresses for the Route 53 name servers associated with the testlabs.com domain. The DNS resolver also caches these addresses for future use.

6. The DNS resolver contacts one of the Route 53 name servers to get the IP address for the www.codezaza.com record.

7. The Route 53 name server responds with an IP address of the web server hosting the www.codezaza.com website. The DNS resolver caches this address for future use.

8. The DNS resolver returns the web server’s IP address to the user’s web browser.

9. The web browser sends a request to the web server at the specified IP address. The web server responds with data for the www.codezaza.com website, which the web browser renders and displays to the user.

Routing Policies

When you create a record, you choose a routing policy, which determines how Amazon Route 53 responds to queries. Route 53 offers several routing policies that determine how traffic is routed to resources based on factors such as geographic location, latency, health and even routing preference. When it comes to choosing the right routing policy, it depends on your specific requirements and the desired behavior for your DNS routing. Let’s delve into some common routing policies and their characteristics

codezrouting policyaza
1. Simple Routing

Simple routing policy is the most basic and straightforward routing policy. It directs traffic to a single resource, such as an IP address or an AWS resource, such as an Elastic Load Balancer (ELB) or an Amazon S3 bucket. Simple routing is ideal for scenarios where you have a single resource serving all traffic or when you want to perform a basic health check on a resource.

2. Weighted Routing

Weighted routing policy allows you to split traffic between multiple resources based on assigned weights. This enables you to perform A/B testing, gradually roll out updates, or distribute traffic across resources based on capacity or performance. Weighted routing is useful when you want to compare the performance of different versions of your application or gradually introduce new features to a subset of users.

3. Latency-Based Routing

Latency-based routing policy directs traffic to the resource with the lowest latency for the end user. Route 53 measures latency between the user’s location and each resource and routes traffic to the resource with the lowest latency. Latency-based routing is beneficial for improving the user experience by directing users to the closest and fastest-performing resource.

4. Failover Routing

Failover routing policy is used to create active-passive failover configurations. Route 53 automatically redirects traffic from an unhealthy or unavailable primary resource to a standby resource. Failover routing is essential for high availability and disaster recovery scenarios, ensuring minimal downtime in the event of resource failures.

5. Geolocation Routing

Geolocation routing policy allows you to route traffic based on the geographic location of the end user. You can define routing rules to direct traffic to specific resources based on the continent, country, or region from which the request originates. Geolocation routing is useful for serving localized content, complying with data privacy regulations, or restricting access to resources based on geographic boundaries.

Route 53 Real world Scenarious.

Scenario 1: Disaster Recovery Using Route 53 Failover

Question: Your application is hosted in a primary region (us-east-1), with a backup in eu-west-1. How can you configure Route 53 for automatic failover in case the primary region becomes unavailable?

Solution:

  • Set up Failover Routing Policy in Route 53.
  • Configure primary and secondary DNS records, where the primary record has a health check.
  • If the primary fails, Route 53 redirects traffic to the secondary region automatically.
Scenario 2: Route Traffic Based on User Location

Question: A streaming service wants to comply with licensing regulations by ensuring users from different countries can only access content available in their region. How can this be achieved?

Solution:
Use Geolocation Routing in Route 53 to direct traffic based on users’ locations.

  • Create DNS records for each region (e.g., ap.codezaza.com, eu.codezaza.com).
  • Assign Route 53 geolocation rules to send users to the appropriate content library.
Scenario 3: Routing Traffic to On-Premises and AWS Cloud

Question: Your company has a hybrid cloud setup, with some services on-premises and others in AWS. Users should be routed to on-prem servers unless they are unavailable, in which case they should be redirected to AWS.

Solution:

  • Use Failover Routing with health checks.
  • Set the on-prem servers as primary records and AWS endpoints as secondary records.
  • If the on-prem servers go down, Route 53 automatically redirects traffic to AWS.
Scenario 4: Centralized Domain Management Across Multiple AWS Accounts

Question: Your organization has multiple AWS accounts, each managing different applications. You want a centralized DNS solution to manage all domains from a single AWS account.

Solution:

  • Use Route 53 as a centralized hosted zone in one AWS account.
  • Configure cross-account delegation by creating NS records in the other accounts, pointing to the primary hosted zone.
Scenario 5: Migrating a Website Without Downtime

Question: You are migrating codezaza.com to AWS from another provider. How do you ensure zero downtime during the DNS migration?

Solution:

  • Lower the TTL (Time-To-Live) value of existing DNS records before migration.
  • Create identical records in Route 53.
  • Update the domain’s NS (Name Server) records at the domain registrar.
  • Once the update propagates, remove the old DNS provider.
Scenario 6: Preventing DDoS Attacks on Route 53

Question: Your application is experiencing DNS-based DDoS attacks. What steps can you take to protect Route 53 from malicious traffic?

Solution:

  • Enable AWS Shield Advanced to protect against DNS attacks.
  • Use AWS WAF to filter traffic at the CloudFront or ALB layer.
  • Set rate-based rules to block repeated malicious queries.
Scenario 7: Handling Custom Domain SSL in Route 53

Question: Your website uses a custom domain (codezaza.com), but SSL certificates are not working after setting up Route 53. How do you resolve this issue?

Solution:

  • Verify that your SSL certificate is correctly issued via AWS Certificate Manager (ACM).
  • Ensure the domain is correctly mapped using CNAME records for validation.
  • If using CloudFront, configure the distribution with the ACM certificate from us-east-1.

Conclusion

Amazon Route 53 is a powerful and highly reliable DNS web service that plays a critical role in ensuring seamless connectivity between users and applications. By intelligently routing end-user requests through DNS resolvers and directing them to the appropriate AWS resources or external servers, Route 53 provides low-latency responses and enhanced availability. Its features, such as domain registration, DNS management, health checks, and traffic routing policies, make it a complete solution for businesses looking to improve performance and resiliency. Whether you are running a small website like codezaza.com or managing enterprise-level applications, Route 53 offers scalability, global reach, and cost-effectiveness. In short, it simplifies DNS management while delivering the reliability and performance needed in today’s digital world.