Amazon Route 53 is a highly scalable Domain Name System (DNS) web service that converts word-based website addresses like www.example.com into IP addresses like ww.xx.yy.zz.
Amazon Web Services operates worldwide DNS servers at 50+ edge locations. AWS domain queries are automatically routed to the nearest DNS server that will provide the quickest response time, which will help to lower update latency for DNS record management. For example, if you want to remap a domain to a different IP in GoDaddy, it takes anywhere from 30 minutes to 24 hours to propagate the change around the world. But in Route 53 the change will take effect within minutes.
Read More: What is Route53 in AWS and Why you consider it as your DNS?
AWS Route 53 integrates with other AWS features. You can use it to map domain names to your Amazon EC2 instances, Amazon S3 buckets, Amazon CloudFront distributions and other AWS resources.
“R53” offers Weighted Round Robin (WRR), also known as DNS load balancing, which allows you to assign weights to DNS records in order to specify which portions of your traffic will be routed to various endpoints. It allows you to load balance your application across multiple regions in order to provide low latency to end users
Here will see how to set up route53 dns service for two instances launched in different regions. Once instance in Ohio and other one in Mumbai region.
If you have two instances launched with same application in two different geographical regions. Let’s route user traffic to the nearest server to reduce latency and increase performance. I can achieve this using route53 dns service to route the user’s traffic based on the geographical information obtained from the ip address.
Getting started
Login to aws management console and open the route53 console.
- Click create hosted zone option at the top.
- Enter your domain name registered with any domain name registrar and a comment for the hosted zone. Click create zone after filling in the details.
- Hosted zone for your domain will be created and you will be given four DNS endpoints called delegation set. These endpoints should to be updated in your domain names nameserver section. In my case, it is godaddy.com. Go to your domain’s control panel and update the route53 DNS endpoints, deleting all the default values if any. The update will take a while to propagate.
If you have your domain in godaddy.com or any other domain provider, follow the below steps to update you route53 DNS endpoints.
- Go to DNS settings of your domain name and click manage option under name servers. By default, you will have two DNS endpoints. Deselect the standard option and select custom option in the manage section.
- Click add nameserver option and add the four route53 DNS endpoint and hit save.
- That’s it. You are done with the settings in the domain name registrars side. Now, all you have to do is create record sets for the hosted zone. These record sets are used map the domain names to respective aws instances where you host your application.
- Go back to route53 console and click “got to record sets” option. By default, you will have two record sets Type NS and SOA.
- Let’s say if you have two instances in two different aws regions. Now will have to route your traffic. Click create record set option, fill in the following details and create record set option.
- Name: append www
- Type: A
- TTL: 500
- Alias:
Yes, if you want to point the domain name to any load balancer, s3 or cloud front endpoints.
No, if you want to point the domain name to the servers ip. I my case, am selecting no because am pointing the domain name directly to the servers ip address.
- Value: IP address of your server which is hosting your application
- Routing Policy: latency
There are four routing policies in AWS simple , latency, weighted and failover.
- Region: region where you have the instance.
- Set ID: description for the record (ex: Ohio data center)
- Create another A record set for Mumbai region and save the record set. So, you will have two record sets with same domain name pointing to different ip addresses with latency based routing policy.
The DNS and record sets updation will take a while, normally 24-48 hours. Once it’s updated, the user requests will be routed based on the network latency. For example, if a user from US tries to access www.yourdomain.com, the request will be routed to Ohio region since the network latency from US to Mumbai is more compared to Ohio region. If a user from China/any Asia region tries to access www.yourdomain.com, the request will be routed to Mumbai region.
Pricing:
Hosted Zones | $0.50 per hosted zone / month for the first 25 hosted zones $0.10 per hosted zone / month for additional hosted zones |
Standard Queries | $0.500 per million queries – first 1 billion queries / month$0.250 per million queries – over 1 billion queries / month |
Latency Based Routing Queries | $0.750 per million queries – first 1 billion queries / month$0.375 per million queries – over 1 billion queries / month |