How DNS Works

Today we spend a huge amount of time on Internet. We browse many different websites and get valuable information from it. But have you ever wondered how all this happens? I mean to say that how these websites open instantly when you type their name on address bar of your browser and they open instantly. May be you never thought of this. But i think it is very interesting to know that how all this happens. Keep reading this article if you want to know about this interesting process.

When you enter a website name like “www.linuxonlinesolutions.com” at the address bar of your browser, the website ‘www.linuxonlinesolutions.com’ opens instantly. But you will be amazed to know that this website doesn’t open directly, as this request doesn’t go to the webserver, but to the DNS first. DNS is the reference for Domain Name Server. It converts Domain name like “www.linuxonlinesolutions.com” to an IP address like “216.18.203.210”. It uses port number 53 to response the DNS queries. You will be thinking that what is the need to convert Domain name into an IP address? Can’t a website open directly? Well let me clear it to you with an example. Suppose i tell you my name is ‘vinod’ and my phone number is “9898658547”. Now what is easier for you to remember? My name or My phone number? I think you all will agree that my name is easier for you to remember. It is our human tendancy that we can remember names easily as compare to the numbers. But computers uses a unique strategy. They can only remember the number. Computers knows binary language and they uses this language to communicate with other computer and programs. This is the reason why we use DNS.

DNS can store millions of Domain names and IP addresses into its database and this database is used when an inquiry for a website reaches to it. Basically a domain name consist three parts in it.
www.linuxonlinesolutions.com.

mail.linuxonlinesolutions.com.

Above domain name is called a FQDN [Fully Qualified Domain Name] and it usually divided in 5 parts:

1] root server:- “.” at the end of FQDN is called as root server. Root server contain the record of all the Domain Name Server of the world that contain the domain name. There are 13 root servers in world, but this is a controversial statement because some people says that there are more than 13 root servers.

2] Top Level Domain:- “com” is the Top level domain [TLD]. TLD is the part of domain name which is used to indicate the type of organization or country. Like ‘.com’ is reference for Commercial organization, ‘.org’ is reference for Non-profit organization, ‘.edu’ is reference for Educational institution, ‘.gov’ is reference for Government organization etc….Whereas TLD for countries can be ‘.in’ for india, ‘.pk’ for pakistan, ‘.uk’ for united kingdom, ‘.nz’ for New Zealand etc..

3] Second Level Domain:- “linuxonlinesolutions” is the second level domain. It is basically name of your website which is based upon the type of organization you are running. Yahoo and Google are the example of second level domain.

4] Subdomain:- “mail.linuxonlinesolutions.com” is a subdomain of “www.linuxonlinesolutions.com”. Basically domain provider gives you minimum 10 subdomain names free of cost. But some companies charges additional money to get subdomains.

5] Hostname:- “www” is the host name of any website. It is usually the name of the system or network where you are hosting the website.

Above Five parts completes FQDN. Now lets see how DNS works when you request for a website.
When you enter “www.linuxonlinesolutions.com” into address bar of your web browser, the query goes to your ISP’s DNS first. If it knows the IP-address of the website, it send back the response. But if it doesn’t, it forwards the query to the root server. Root server maintain the top level domains. It checks which name server has record for the ‘.com’ database. When it finds that name server, it tells the ISP’s DNS server to contact that name server. ISP’s DNS server contact that name server and ask for the IP-address of the website. In reply, name server tell the IP-address of website to the ISP’s DNS server. Now at last DNS send the appropriate Web page, associated with that IP-address to the users web browser.
Thats how your DNS works.

You can leave a response, or trackback from your own site.

Leave a Reply