You can route web traffic based on user’s IP address to different servers located at all over the world using GEO DNS. AWS Rout 53 has a option LBR which is givings us the same features as GEO DNS. The objective is where a website has, for example, a server in Singapore and one in the US, and a user looks up the name of the website in DNS, if the user is in India, the user gets the IP address of the Singapore server, whereas a user in the US gets the IP address of the US server. This can make access faster and lower costs compared to directing all users worldwide to the same server or to multiple servers round robin. In this article I will show you, how to configure AWS Route 53 with Latency Based Routing (LBR).
Advantages: Below are some basic advantages regarding GEO DNS.
- Better Performance: As we are serving the website from the nearest webserver, the user will feel a better performance with the website.
- Decrease Bandwidth Costs
- Increase Bandwidth Efficiency
- Improved Ad-Serving
- Geo-Targeted relevant information
- Country or language specific content loading options
How to Configure Rout53:
As per the AWS document if your application is hosted on Amazon EC2 instances in multiple EC2 regions, you can reduce latency for your end users by serving their requests from the EC2 region for which network latency is lowest. Route 53 latency-based routing lets you use DNS to route end-user requests to the EC2 region that will give your users the fastest response. Below are the list of endpoints/ regions supported by LBR.
- Nothern Virginia, US: us-east-1
- Nothern California, US: us-west-1
- Oregon, US: us-west-2
- Ireland, EU: eu-west-1
- Singapore, Asia: ap-southeast-1
- Tokyo, Asia: ap-northeast-1
- Sydney, Asia: ap-southeast-2
- Sao Paulo, South America: sa-east-1
If you don’t have your domain configured in Rout53 then follow my previous article “How to add/ configure a Domain in AWS Route 53” to add your domain to Rout53. Go to the Route 53 Management Console to configure Rout53.
For this example configuration I am considering 3 web servers located at different regions of AWS for www.linuxfunda.com
- Web 1 – us-west-1 – 220.127.116.11
- Web 2 – ap-southeast-1 – 18.104.22.168
- Web 3 – sa-east-1 – 22.214.171.124
Click on Hosted Zones > Click on the Zone File for which you want to configure LBR > Click on Go to Record Set > Click on Create Record Set. In this example I am using “linuxfunda.com” as my domain name and will add LBR for the www.linuxfunda.com.
- Set Name to “www”
- Chose Type “A-IPv4 addresses”
- Set Value “Value of your web servers”
- Set Routing Policy to “Latency”
- Set Region to “Your Web Servers Region”
- Set ID to “Friendly Name”
- Click on “Save Record Set” button.
Do the above action for each of your web server as shown in the image below.
Finally you will get three records in the Rout53 for “www.linuxfunda.com” as shown in the below image.
After completing the above configuration now validate your environment using CloudMonitor. You will get different IP addresses for your web application from different locations. Now enjoy with your new configuration.
Latest posts by Tapas Mishra (see all)
- Working with Docker – II - December 16, 2016
- Working with Docker – I - November 28, 2016
- How to work with Chef using Oracle VirtualBox and Vagrant on a Windows host – Part II - November 30, 2014