- service to translate domain names into IP addresses
- Example, domain name www.example.com might translate to 198.105.232.4.
- works in an complex and hierarchical manner.
- Working
- if one DNS server doesn’t know IP address, it asks another one, and so on, till IP address is returned.
- Domain names are organized as a tree or hierarchical in manner
- Each node of tree, called a domain, is given a label.
- domain name of node is concatenation of all labels on path from node to root node like network.support.testprep.in
- 2 Types of DNS systems
- Recursive DNS
- It knows where to get corresponding IP address for a domain.
- It connects to an Authoritative DNS to get this information,
- then cache this information for a period of time.
- It does not itself have target IP addresses.
- Authoritative DNS
- final authority on DNS information.
- keep IP addresses for domain names
- provide an update mechanism for changing those values
- Recursive DNS
- 2 types of IP addresses:
- IPv4
- 32 bit address
- 4 billion different addresses (4,294,967,296)
- IPv6
- Created to solve depletion issue of IPv4 address space
- 128 bit address
- 340 undecillion addresses (340,282,366,920,938,463,463,374,607,431,768,211,456)
- Top Level Domains: Signified by last word in a domain name – .com, .edu
- Controlled by Internet Assigned Numbers Authority (IANA)
- Stored in a root zone database which is a database of all available TLDs (Top Level Domains)
- Database can be found at http://www.iana.org/domains/root/db
- Domain Names:
- All names in a given domain name have to be unique
- DNS registrars are authority’s that can assign domain names directly under one or more TLD’s
- Domains are registered with InterNIC, as service of ICANN, which enforces uniqueness of domain names across internet
- Each domain name becomes registered in a central database known as WhoIS database
- Popular domain registrars include godaddy.com, namecheap.com, Route53 etc..
- SOA (Start of Authority) Records store information about:
- Name of server that supplied data for zone
- Administrator of zone
- Current version of data file
- Number of seconds a secondary name server should wait before checking for updates
- Number of seconds a secondary name server should wait before retrying a failed domain transfer
- Maximum number of seconds that a secondary name server can use data before it must either be refreshed or expired
- Default number of seconds for TTL (Time to Live) on resource records
- DNS Record Types:
- NS or Name Server Records are used by TLD’s to direct traffic to content DNS server which contains authoritative DNS records
- A or Address records are used by a computer to translate name of domain to an IP address
- CNAMES or Canonical Names can be used to resolve one domain name to another
- CNAME’s can’t be used for naked domain names (zone apex). As such awsdocs.com must be either an A record or an Alias record
- Alias records are used to map resource record sets in hosted zone to ELBs, CloudFront Distributions, or S3 Buckets that are configured as websites
- Alias records work like CNAME records in that you can map one DNS name to another target DNS name
- Alias records can save time because Route53 automatically recognizes changes in record set that alias resource record set refers to
- You are NOT charged for requests to Alias records, you ARE charged for requests to CNAMES, so using Alias records is cheaper
- TTL or Time to Live is length that a DNS record is cached on either resolving server or users local PC. lower TTL, faster changes to DNS records take to propagate throughout internet
- ELBs do not have a pre-defined IPv4 address, DNS names are used for ELB resolution
- Always use an Alias record over a CNAME where possible, as it’s cheaper and faster
DNS Routing
Name Resolution process is done as
- Upon receiving query from client, local nameserver will check if it has authority for required domain name. If it has, local nameserver returns IP address sought. Otherwise, go to step 2.
- Query one of root nameservers to find server authoritative for next level down.
- Querying this second nameserver for address of a DNS server with detailed knowledge of second-level domain.
- Repeating previous step to progress down name, until final step which would, rather than generating address of next DNS server, return final address sought.
DNS process
- A user opens a web browser, enters www.example.com in the address bar, and presses Enter.
- The request for www.example.com is routed to a DNS resolver, which is typically managed by the user’s Internet service provider (ISP), such as a cable Internet provider, a DSL broadband provider, or a corporate network.
- The DNS resolver for the ISP forwards the request for www.example.com to a DNS root name server.
- The DNS resolver for the ISP forwards the request for www.example.com again, this time to one of the TLD name servers for .com domains. The name server for .com domains responds to the request with the names of the four Amazon Route 53 name servers that are associated with the example.com domain.
- The DNS resolver for the ISP chooses an Amazon Route 53 name server and forwards the request for www.example.com to that name server.
- The Amazon Route 53 name server looks in the example.com hosted zone for the www.example.com record, gets the associated value, such as the IP address for a web server, 192.0.2.44, and returns the IP address to the DNS resolver.
- The DNS resolver for the ISP finally has the IP address that the user needs. The resolver returns that value to the web browser. The DNS resolver also caches (stores) the IP address for example.com for an amount of time that you specify so that it can respond more quickly the next time someone browses to example.com. For more information, see time to live (TTL).
- The web browser sends a request for www.example.com to the IP address that it got from the DNS resolver. This is where content is, for example, a web server running on an Amazon EC2 instance or an Amazon S3 bucket that’s configured as a website endpoint.
- The web server or other resources at 192.0.2.44 returns the web page for www.example.com to the web browser, and the web browser displays the page.
Enhance your skills with expert guidance and tutorial on AWS Certified Solutions Architect Associate. Try Free Practice Test Now!
AWS Certified Solutions Architect Associate Free Practice TestTake a Quiz