What is Domain Name System and how it Works??





  • Domain Name System (DNS) is a hierarchical and decentralized naming system for the computers, services, or other resources connected to the network.

  • They are also referred as the Internet's equivalent of a phone-book.

  • DNS maintains a directory of domain names and translates them to their corresponding IP addresses.

  • This is very important or necessary because, domain names are easy for the people to remember than IP addresses.

  • Domain names are allowed with only valid set of characters:
    • A - Z
    • a - z
    • 0 - 9
    • Hyphen (-)

Note:        Underscore '_' is a reserved character.

  • DNS maps the name people use to locate a website to the IP address that a computer uses to locate a website.

For e.g:  if someone types www.google.com into web browser, the server behind the scene will map that name to corresponding IP address of google.com.


TYPES OF DNS SERVERS
    1. DNS Recursive Resolver / DNS Resolver
    2. Root Nameservers
    3. Top Level Domain (TLD) Nameservers
    4. Authoritative Nameservers


DNS Recursive Resolver / DNS Resolver

  • Provided by the Internet Service Provider (ISP).
  • Helps in connecting the web browsers of our computer to the DNS servers.
  • When a query is first done, it goes to their DNS resolver.


Root Nameservers
  • Total Root Nameservers : 13 sets, worldwide
  • Logically named as : letter.root-servers.net (letter -> a,b,c,d,e,f,g,h,i,j,k,l,m)
  • Operated by 12 different organizations.
  • Each set consists number of servers placed around the world.
  • Information page for all root nameservers are found at: letter.root-servers.org
    except for 'g', where for g: https://disa.mil/g-root
  • Detail about all these root nameservers can be found at : www.root-servers.org


Top Level Domain (TLD) Nameservers
  • Stores the information about all the domain names sharing a common domain extension.
  • For e.g:
    • .com TLD nameserver
      • stores the info. of all the websites ending with .com extension
    • .org TLD nameserver
      • stores the info. of all the websites ending with .org extension
    • .net TLD nameserver
      • stores the info. of all the websites ending with .net extension


Authoritative Nameservers
  • These are the last servers in DNS.
  • Stores the IP address of the requested website by the user.
  • Can be found with the command : #nslookup


WORKING OF DNS

  1. For e.g. when we type docs.google.com in our web browser, it first asks the DNS resolver for its IP address.
  2. Now, the DNS resolver will look for its IP address in its cache and replies with corresponding IP address if it found the result in its cache.
    Else, it forwards the request to the root nameserver and asks for its IP address.
  3. Root nameserver does not know the IP address for the requested website but it holds the information for the TLD nameservers and replies back the IP address of TLD nameserver. (.com in this case)
  4. Now, DNS resolver again asks the same question to the TLD nameserver.
  5. TLD nameserver also replies with a message that it does not know the IP address for docs.google.com, but it knows IP address for google.com's nameserver.
  6. The DNS resolver now asks google.com's nameserver the same question.
  7. Finally, google.com's server carries the information about all its nameservers and replies back with an IP address of docs.google.com.
  8. Now, the DNS resolver first saves the IP address of the requested website in its cache for further requests and replies the user with the IP address of requested website.




Post a Comment

0 Comments