How does DNS server work

What is DNS?

Short for Domain Name System (or Service or Server), an Internet service that translates domain names into IP addresses. Because domain names are alphabetic, they’re easier to remember. The Internet however, is really based on IP addresses. Every time you use a domain name, therefore, a DNS service must translate the name into the corresponding IP address. For example, the domain name www.example.com might translate to 198.105.232.4.

How DNS works??

Step1: When types www.example.com in the browser

Step2: the operating system looks at /etc/host file,first for the ip address of www.example.com(this can be changed from /etc/nsswitch), then looks /etc/resolv.conf for the DNS server IP for that machine (computer looks is its local DNS cache, which stores information that your computer has recently retrieved).

Step3: If the information is not stored locally, your computer queries (contacts) your ISP’s recursive DNS server. The dns server will search its database for the name www.example.com, if it finds it will give that back, if not it will query the root server(.) for the information.

Step4: 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.example.com so root server will give us referral to .com TLD servers.

If it was www.example.net then root server will give, .net TLD servers refferal.

Step5: Now One of the TLD servers of .com will give us the referral to the DNS server resposible for example.com domain.

Step6: the dns server for example.com domain will now give the client the ip address of www host(www is the host name.)

eg : dig +trace google.com >> can see the dns tracing.

Generic Top Level Domains(gTLD’s) are TLD’s like .com,.net,.org,.edu etc.

Country Code Top Level Domains are domains such as .in,.us,.uk etc.

{for more details :: http://www.slashroot.in/how-dns-works}

 

Leave a comment