Wednesday, January 8, 2020

AWS Route 53

Before jumping into AWS Route 53, first we need to understand, what is the Domain Name System(DNS) and how its work.


We have different domain in Internet world like .com, .net etc. You can purchase unique domain Name (URL) for your website, Like “www.xyz.com”  .  if your browser wants to access your website, Browser requires IP address to reach the server. Then DNS comes into a picture.

Domain name System (DNS) help your browser to convert your Domain URL to IP address where your website is hosted. Browser sends the request to Domain resolver to fetch the IP, Domain resolver has the address of its DNS service provider and fetch the information from there and send it back to the browser.

This  works on L7 layer (Application layer) of the OSI model.

DNS work on UDP 53 and TCP 53 port



Below are some properties/records in DNS, which we mostly use in DNS, we need to understand the meaning of these records before going to Route 53.

a.       A Record


This is a mapping of your Domain Name to some IPV4 address. Means with Help of “A” record, you can map your domain like “xyz.com”, to the IPV4 address of the server where your site is hosted.

b.      AAAA Record


This is a mapping of your domain Name to some IPV6 address. Means if your website is hosted on server which have IPV6 address then you have to do AAAA record mapping. “A” record will not work here.

c.       CNAME


CNAME refers for Canonical Name. It used to alias one name to another. If you have a website “xyz.com”. In most cases when you type xyz.com or “www.xyz.com” on browser both should return the same server IP address.
In this case you have two option to achieve this

1.       Add separate “A” record for “xyz.com” and “www.xyz.com”. But in this approach you have to specify the IP address two times.

2.       You can add a CNAME for “www.xyz.com” which will point to “xyz.com” and Add “A” record for “xyz.com”. Here you have approach you have to specify the IP address one time only, which is easy to maintain.

d.      NS Record


This is used by the TOP level domain server to direct traffic to the content DNS server, which contains the DNS records.

e.       SOA Record


SOA stands Start of Authority. It contains below information like 

1.       Email of Domain Administrator

2.       Domain Last update date

f.        MX Record


MX stands for Mail Exchange. It helps to identify where to deliver the email for your domain users. Like “user@domain.com”


Now we have a basic understanding about the Domain Name System(DNS) and its functionality, which is sufficient to understand the Route 53.



AWS Route 53


1.       Route53 is AWS managed Domain Name System (DNS) Service.

2.       Below are the main functionalities of AWS Route 53 and you can use any combination as per your requirement.

a.       Domain provider


You can buy a domain. Like you buy from other domain providers (Godaddy etc.), But You cannot register or buy all domain from Route53.It support Generic TOP level domains and Geographic Top Level domain only.

b.      Work as Domain Name System


You can use Route53 as DNS for any domain. Means you can purchase Domain somewhere else and use Route 53 as its authoritative DNS, but you cannot register all domains, there is some limitation for the same like it should be the TOP level domain etc. You need an authorization code from the current registrar to transfer a domain.

c.       Health Check of your website


Route 53 sends a test request over the internet to check the website resource status like server availability and functionality. Route 53 can send notification in case of any issue and route traffic from unhealthy resource to healthy resource.

3.       Alias Record


It is same as a CNAME record, where you can map one DNS URL to other DNS URL.with help this you can map your website URL to.

a.       AWS Load Balancer

b.      Domain Name of Cloudfront Distribution

c.       S3 Bucket static website URL.

d.      API gateway URL

4.       CNAME vs Alias record


To understand the difference between CNAME and Alias, we need to understand the Naked Domain.

Domain without “www” is called the naked domain. Means “http://xyz.com” is naked domain and www. xyz.com is not naked domain.

CNANE cannot be used for naked Domain names. So if you have a URL “http://xyz.com” then, In this case you have to use either “A” record or Alias record.

5.       Hosted Zone:


This is AWS terminology, it is the container that contains the information about routing, every domain registered with Route 53 there will be a hosted Zone in AWS. Means how you want to route your domain and subdomain traffic will mention in hosted zone.

6.       If you register domain with Route 53, Then Route 53 make it itself the DNS service for registered domain.

7.       Route53 Health Check


As discussed, Route 53 is also used for health check of resources.

a.       Route 53 supports http, https and TCP health check

b.      You can specify Domain or IP address of endpoint for a health check. However, the Endpoint can be in AWS or outside the AWS.

c.       Route 53 can do the health check of resource which have private IP, non-routable and multicast range

d.      Route 53 can notify Cloud watch for un-healthy Instance.

e.       You can associate health-check on individual record set.  if health-check fail, it removed from Route 53 until it will pass.

f.        You can set SNS notification if health-check failed.

8.       Route53 Routing Policies


You can define the rules in Route53, with the help of this Route 53 respond the queries, which send by the browser via DNS resolver. Means Route 53 provides the server IP of the server where your site is hosted based on some rules.

a.       Simple Routing Policy


It is default policy; in this we create one record with one or multiple IP address, LB URL etc.  If you specify multiple IP address, Then Route 53 return multiple value to Browser in random order and Brower can use any one.

b.      Weighted Routing Policy


If you want to split the upcoming traffic on bases of some weights, then it is your answer. Means suppose if you have two web servers and you want to distribute traffic, like 40% on server-1 and 60% on server-2, then you can do with the help of weighed routing policy.

c.       Failover Routing policy


If you want to configure active-passive failover, then can use this policy. Like if you have hosted your site on two servers, and make the second server as failover in case of first become unavailable.

d.      Latency-based routing policy


If you have hosted your site in multiple location and you want to route the traffic where User feels the lowest network latency, then go with Latency-based routing. 

e.       GEO location Routing policy


If you want to route the traffic based on geographic location of the user who is accessing your website.
Suppose you have web-server-1 in Europe and Webserver-2 in USA. you want to redirect the traffic based on geographic location of users where he is trying to access the site.
Like if user access from Europe will be served from Webserver-1 and USA user will be served from WebServer-2.

f.         Geoproximity routing policy


This is similar to GEO location Routing policy, But only one additional functionality.
If you want to route the traffic based on location of the user who is accessing your website, but can shift one location traffic to another location. To achieve this, you have to use Route 53 Traffic Flow feature.

g.       Multivalue answer routing policy


You can create a multiples record set and Route 53 return multiple IP to Browser to respond to DNS queries.

This is similar to Simple routing policy except

1.       You can create multiple record set.

2.       It allows to put health check on very record-set.


Cheers!
Sandeep
https://www.linkedin.com/in/sandeep-sharma-40a40b22/

                                                                                                                                               

23 comments:

  1. Very useful to understand and differentiate the concepts.

    ReplyDelete
  2. This is a very nice one and gives in-depth information. I am really happy with the quality and presentation of the article. I’d really like to appreciate the efforts you get with writing this post. Thanks for sharing.
    AWS training in Pune

    ReplyDelete
  3. Amazing article on AWS Thanks for sharing this with us , keep sharing
    AWS Training in Pune

    ReplyDelete
  4. Amazing article on AWS, thanks for sharing this with us. Keep sharing.
    https://proitacademy.in/

    ReplyDelete
  5. Good Post! Thank you so much for sharing this pretty post, it was so nice to read and useful to improve my knowledge as updated one, keep blogging.

    AWS Certification Training in Electronic City

    ReplyDelete

AWS Elastic Compute Cloud -EC2

Elastic Compute Cloud (EC2) is a virtual Machine on AWS Host (Physical servers). AWS uses a XEN hypervisor to create virtualization and p...

Amazon Web Services Fundamentals