Skip to main content

AWS Route 53: Scalable DNS Web Service

Amazon Route 53 is a scalable and highly available Domain Name System (DNS) web service designed to provide developers and businesses with a reliable way to route end users to applications by translating domain names (e.g., www.example.com) into IP addresses (e.g., 192.0.2.1).

For a deeper understanding of DNS, I recommend first reading our section on DNS.

Domain Registration with Route 53​

AWS Route 53 allows you to register new domain names directly through AWS. It also supports transferring existing domains from other registrars to manage all your DNS needs in one place.

Hosted Zones​

A hosted zone is essentially a container for records that define how traffic should be routed for a domain and its subdomains. Think of it as a collection of rules for directing user requests to the appropriate destinations.

Example of DNS Records in a Hosted Zone​

NameTypeValueTTL
nailyourinterview.orgA192.0.2.1300
www.nailyourinterview.orgCNAMEnailyourinterview.org300
nailyourinterview.orgNSns-123.awsdns-45.net, ns-234.awsdns-56.com, ns-345.awsdns-67.co.uk, ns-456.awsdns-78.org172800
  • A Record: Points a domain to a specific IP address where the application is hosted.

  • CNAME Record: Points subdomains (like www) to the root domain, enabling easier management.

  • NS Record: Specifies the nameservers that store the DNS records for the domain. These are automatically assigned by the domain registrar.

  • Alias Record: Specific to Route 53, it maps a domain name to AWS resources such as an Elastic Load Balancer, CloudFront distribution, or S3 bucket. Unlike CNAME, Alias records work at the root domain level and are more efficient.

NameTypeValueTTL
nailyourinterview.orgAliasmy-lb.us-west-2.elb.amazonaws.com300
Note

Using an alias record to point your domain to a load balancer is preferable to using an A record with a specific IP address. This is because if the EC2 instance behind the IP address goes down and restarts, it may receive a new IP address, requiring a manual DNS update.

DNS Routing Strategies with Route 53​

NailYourInterview.org offers FREE interview preparation resources. We want to ensure users from different regions experience fast loading times and access relevant content. AWS Route 53 offers several routing strategies to help achieve this goal:

Note

In the slides above, I've added arrows from Route 53 to EC2 instances. However, in reality, the flow would look like the one shown in the Simple Routing example.

1. Simple Routing​

Use Case: Directs traffic to a single resource.

Example: Initially, we have a single server hosting NailYourInterview.org. Simple routing directs all user traffic to nailyourinterview.org, pointing to this server's IP address.

2. Weighted Routing​

Use Case: Distributes traffic between multiple resources based on assigned weights.

Example: NailYourInterview.org has two servers, one in India and one in the USA. We want 60% of the traffic to go to the Indian server and 40% to the US server because most of our audience is in India. Weighted routing allows us to assign these weights and balance the load accordingly.

3. Latency Routing​

Use Case: Routes traffic to the region that provides the lowest latency.

Example: To ensure fast loading times, latency routing directs users to the nearest server. For instance, a user in Europe would be directed to the closest data center, possibly in Germany, ensuring quicker response times.

4. Geolocation Routing​

Use Case: Routes traffic based on the geographic location of the user.

Example: We want users in the USA to see content relevant to American job markets, while users in India see content tailored for Indian job seekers. Geolocation routing directs US users to a server with American-specific content and Indian users to another server with Indian-specific content.

5. Geoproximity Routing​

Use Case: Routes traffic based on the geographic location of resources and users, allowing traffic bias adjustments.

Example: Suppose we have servers in both Mumbai and Delhi. We can use geoproximity routing to slightly favor the Mumbai server due to better infrastructure, even if a user is equidistant from both.

6. Failover Routing​

Use Case: Provides high availability by routing traffic to a secondary resource if the primary one fails.

Example: NailYourInterview.org's primary server is in India, but we have a backup server in the USA. If the primary server fails, failover routing automatically redirects traffic to the backup server, ensuring uninterrupted access to the site.

7. Multivalue Answer Routing​

Use Case: Returns multiple IP addresses in response to DNS queries, enabling client-side load balancing.

Example: If we have multiple servers hosting the site, multivalue answer routing can return the IP addresses of several servers. This allows user devices to choose one, helping distribute the load and enhancing reliability.