How DNS Works (Step-by-step analysis)

Hello Friends,

This is my first blog I am sharing with you. Today I am going to explain about DNS, i.e what is DNS and how it works.

This is a very confusing topic. Most of the people get confused even after understanding the things clearly.

DNS stands for “Domain Name System”.

Whenever we register a domain lets say “abc.com”, and then we purchase a hosting account to host our site, we a get valid IP address of the server (shared or dedicated) where our contents resides. We can access our site using the server IP address where our site is hosted. If we have one site, we can remember the IP address easily and we can access it without any issue, however if we have number of sites hosted in different servers, it is very difficult to remember those IP addresses. That is why, DNS concept comes into picture which resolve the complexity of remembering the IP addresses for the site.

Through DNS, we give a name of the site and use that name to view our contents. Whenever we type our domain name in the browser, it first convert to the original IP address from where the contents to be fetched as server/nameservers does’t recognise our names that we type in (here abc.com).

Please refer the below mentioned steps to know how this conversion takes place:

Step 1: If I type, www.abc.com in my browser

Step 2: The operating system looks at /etc/host file,first for the ip address of www.abc.com, if the entry is not available , then looks /etc/resolv.conf for the ISP DNS server for that machine.

Step 3 : The ISP DNS Server will search its database for the name www.abc.com , if it finds it will give that back, if not it will query the root server(.) for the information.

Step 4: The root server will return a referral to the .com TLD name server(these TLD name servers knows the address of name servers of all SLD’s).In our case we searched for www.abc.com so root server will give us referral to .com TLD servers.

TLD = Top Level Domain
SLD = Secondary Level Domain

In this case TLD is .com and SLD is abc
If it was www.abc.info then root server will give, .info TLD servers refferal.

Step 5: Now One of the TLD servers of .com will give us the referral to the DNS server resposible for abc.com domain.

Step 6: The DNS server (authoritative name server) we get the IP address for abc.com

Step 7: abc.com responds to the ISP DNS Server by answering the query and providing the IP address

Step 8: The ISP DNS Server stores the answer in it’s cache for future use and answers to my machine by sending the IP address

Step 9: My machine may store the answer to the DNS query in it’s own cache for future use. Then the it communicates directly with the server of domain abc.com using the IP address.

Powered by Facebook Comments

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.