What is DNS, how it works?

What is DNS, how it works?


In this blog you're going to learn about DNS and how does it work. Computer's only understands binary language i.e 0s and 1s, but have you ever thought, while searching any website on internet you always type in characters and not number's so how computer's understand what do we want?

Here comes the role of a DNS. DNS stands for Domain Name System which is more or less similar like our contact list in our phone book. While saving our friend's or relative's no. in our contact we save by adding name so that it will be easy for us in case we are searching them because it's slightly difficult to remember the number's of all our friend's. The case is different if you are too smart though. Likewise DNS also consist of the names of it's respective IP addresses. For instance the IP address of google.com is 172.217.160.206 but it's quite difficult to remember the IP address of all domain names so we have domain name system which resolves the names of the internet sites with their IP address adding efficiency and security in the process.


How it works?


Before that let's learn about DNS servers,

DNS Servers 

Servers are used to store computer's HTML files, images, sounds, videos or any other file type. Servers that work together to provide IP address of the requested website to the web browser are called DNS servers.


There are 4 types of DNS servers -

1. DNS recursive resolver / DNS resolver
2. Root name server
3. Top Level Domain /  TLD name server
4. Authoritative name server


DNS Resolver


It is provided by the ISP, it connects the web browser of our computer to the DNS name servers.
 

Root Name Server


There are 13 sets of root name servers, logically named as letter.root-servers.net where letter ranges from  'a' to 'm' and are operated by 12 different organizations. Each set has a no of servers placed around the world and informational page exist for all root name servers at address letter.root-servers.org for letter ranges from 'a' to 'm' except for 'g' which is a home page address.

TLD Name Server

It stores the information of all domains sharing a common domain extension. 
e.g .com TLD name server stores the information of all websites ending with .com extension.

Authoritative Name Server

It is the last server in the DNS. It stores the IP address of the requested website.




 


 

Lets see the backend process of how website appears in front of our eyes within a fraction of seconds.


When you type in facebook.com in web browser and if your web browser or OS can't find the IP address in its own cache memory, it will send this query to the next level to what is called resolver server. 

When resolver receives the query, it will check on its own cache memory to find the IP address of facebook.com and if it can't find it, it will send to the next level which is the root server.

When a root server receives a query of an IP address for facebook.com,  the root server doesn't know what the IP address is, but it does know where to send the resolver to help it find the IP address. The root server directs the resolver to the TLD for the .com domain.

The resolver will now ask the TLD for the IP address of the facebook.com. 

When TLD receives a query it directs the resolver to the final level i.e Authoritative name server.

Resolver asks for an IP address of facebook.com to the Authoritative name server, it responds with an IP address and finally the resolver will tell your computer the IP address then your computer can now retrieve the facebook webpage.

Once resolver receives an IP address it will store in its cache memory in case it receives another query for facebook.com it does not have to ask to all the other servers it will check from its own cache memory and will display in the users webpage.


Learn : Sniffing


 



Comments

Popular

OSI model

Ethical hacking terminologies

Phases of ethical hacking