- What is DNS? : DNS is used convert human friendly domain names into IP address
- IP address : Ipv4 is a 32 bit address and Ipv6 128 bit address
- Top level domains: .com, .org, .gov . IANA controls these domains in root zone database.
- second level domain names : co.uk , co.in
- Domain Registrar: Godaddy,Bluehost,Hostgator . Recently, Amazon also became a domain registrar.
- The name of the server that supplied the data for the zone
- Administrator of the zone
- Current version of data file
- # of seconds secondary domain server should wait before checking updates
- # of seconds secondary domain server should wait before retrying a failed zone transfer
- # of seconds secondary domain server can use data before it must be either refreshed or expire
- The default # of seconds for the time to live (ttl) file on resource records
Name Server (NS) Records
- Used by top level domain name servers to direct traffic to the content DNS server which contains the authoritative DNS records.
Address (A) record:
- Translate domain name to IP Address
Time to live (TTL)
- # Of seconds that a DNS record is cached in resolving server or client PC.
- Lower the TTL faster the changes to DNS records are propogated
Canonical Name (cname):
- Resolve one domain name to another domain name ( example : www.mobile.nxgcloud.com resolves to www.m.nxgcloud.com)
Alias records :
- Amazon created. Specific to route 53
- naked domains/ zone apex record to ELB/S3/CDN. cname records cannot be used for naked domains , but alias can be used
- ELB’s do not have pre-defined IPV4 addresses. Resolve them using DNS names.
- Understand the difference between cname and Alias
- Given a choice , choose Alias records over cname records
Register a Domain Name
- Route53 ->Domains -> Register domains (Options: register domain name or transfer domain name)
- Select register domain name -> choose a domain name->Add to cart->Fill the contact details->Complete purchase
- Wait for the registration to be completed
- By default , NS and SOA records will be created in zone
- Default routing policy
- Single record set in routing policy
- Use case: your domain is served by single resource. (e.g. Website is served by single EC2 instance/Single ELB)
- No built in intelligence
- Multiple record sets in routing policy. Assign weight to each record set
- Traffic is split based on weights assigned to the record sets.
- Record1: nxgcloud.com -> Target ELB1 weight 80%
- Record2: nxgcloud.com -> Target ELB2 weight 20%
- Traffic coming to nxgcloud.com will be split between ELB1 and ELB2. 80% traffic to ELB1 , 20% to ELB2
- Usecase: Testing your development servers before putting them into production
- Multiple record sets in routing policy. Specify region to each record set
- Traffic is split based on lowest latency for the end user
- Record1: nxgcloud.com -> Target ELB1 Region R1 ( EU-West-2)
- Record2: nxgcloud.com -> Target ELB2 Region R2 (Ap-Southeast-2)
- Traffic coming to nxgcloud.com will be routed based on latency. When a request comes to the domain AWS selects the target in region with lowest latency for the end user
- Usecase: Production workload to improve the page load times for users scattered across the world.
- Multiple record sets in routing policy. Specify failover record type Primary/Secondary
- Create health check for active target in Route53
- Create Primary record and health check
- Create Secondary record
- Traffic is always to primary as long as health check is green to it.
- Record1: nxgcloud.com -> Target ELB1 Primary
- Record2: nxgcloud.com -> Target ELB2 Secondary
- Traffic coming to nxgcloud.com will always goes to ELB1 (Primary). If active site is down traffic will be routed to passive site
- Usecase: Active-Passive setup
- Multiple record sets in routing policy. Specify location to each record set
- Traffic is routed based on geographic location of the end user
- Record1: nxgcloud.com -> Target ELB1 Location Europe
- Record2: nxgcloud.com -> Target ELB2 Location US
- Record2: nxgcloud.com -> Target ELB3 Location Default
- Traffic coming to nxgcloud.com will be routed based on location of the end user.
- Usecase: European customers to Europe region US customers to US region.
- ELBs do not have predefined IPV4 addresses. Resolve them using DNS name
- Understand the difference between cname and alias records
- Given the choice always choose alias
- Remember different routing policies and use cases