DNS Server

    . Stands for Domain Name System.
   . We can simply communicate to various websites using domain names like yahoo.com and google.com etc.
   . But computers are addressed with numbers called IP addresses.
   . To bridge communication gap between users and computers, DNS resolves domain names to IP addresses.


  Why is it important?

         . It acts like phone book. If we don't know person's number but only their name, we look up in phone book using their names.
         . If DNS is not there, we would have to view websites using IP Address instead of names which is very complicated.

  How it Works?

       Step 1:

         . When you type any website name in browser, your computer looks in it local DNS cache.
         . Local DNS cache stores information that your computer already retrived.
         . If it founds, it returns IP Address and computer connects to that website.
         . If not found, it sends query to next level called Resolver Server.

      Step 2:

         . Resolver server is basically ISP (Internet Service Provider) server.
         . When it receives query, it will check in its cache memory to find IP Address.
         . If not found, it sends query to next level called Root Server.

     Step 3:

         . Root Servers are top or root of DNS hierarchy.
         . There are 13 sets of root servers strategically placed around world.
         . Operated by 12 different organizations.
         . When it receives query from resolver, it doesn't know IP address.
         . But it knows to direct resolver to find IP address.
         . It directs resolver to Top Level Domain (TLD) for .com domain.    

     Step 4:


         . Resolver sends query to TLD server which is directed by Root Server.
         . TLD server stores address information of all top level domains like .com , .org and .in etc.
         . This particular TLD server manages .com domain addresses.
         . It doesn't know IP Address requested by resolver but it directs to final level called Authoritative name servers.

     Step 5:

         . Now Resolver sends query to Authoritative Name Servers.
         . These are responsible for knowing everything about domain which includes IP Address.
         . So when it receives query for any domain like abc.com, it responds with IP address.
         . Now finally, Resolver can tell your computer the IP address for abc.com.

     Note:

         . Once Resolver receives IP Address, it stores it in the local cache memory so that it doesn't need to repeat all process again.
         . Entire process from start to finish takes only milliseconds to complete.

  Types of DNS servers:

     . Basically there are two types of DNS servers called Primary and Secondary servers.
     . They are the DNS server computers which store domain names.
     . Information in both the servers are identical. 
     . Values for these DNS servers are assigned by Internet Service Provider (ISP).
     . It is not sure that a single DNS server can function all the time. So there are 2 servers.

     Primary DNS server:

          . When setting up a DNS server, server admin has choice to designate a server as primary or secondary.
          . It is referred as Master server.
          . In some cases, Primary server can act as secondary server for another zone.
          . It contains information like IP address of domain and who is responsible for that domain.
          . Changes to zone files can only be done in primary servers.

    Secondary DNS server:

          . It is referred as slave server.
          . A single zone can contain only one primary server but it can have multiple secondary DNS servers.
          . It takes information from the primary server automatically.
          . It functions as read-only server.
          . Cannot make any changes to the zone files but information is updated from Primary server through zone transfer.
          . It just functions as a back up server when Primary server is not working.

    Finding your Primary and Secondary DNS server address:

          . Admins setup primary and secondary DNS servers.
          . We can find out what primary and secondary DNS servers we are using by getting into router configuration.
          . Browse Router IP in the browser and login with credentials.
          . In the status bar, we can find the Primary and Secondary DNS server IP addresses.