DNS is known as the Domain Name System. DNS is the internal part of the internet and DNS is responsible for the conversion of names into IPs and IPs into Names.
Every website on the internet has its own unique IP Address. DNS is responsible to detect this IP Address of website.
There are lot of IP Address for the different website now It is very hard for the human being to remember these IP Addresses which is unique for each website.
That is why the term came DNS means Domain Name System. Now each website has its own domain name, domain name is unique ,domain name can be numbers also.
How DNS Works
(1) Whenever we type the any website’s Domain Name in our browser like www.GoForTricks.com then there is a DOT also present in the last of domain name which we can not see it seems like,
(2) This DOT at the end of the Domain Name represents the Root.
(3) Now after typing a domain name in the browser our browser sends the intruction to the window to get the IP address of the perticular website.
(4) If Operating system do not know the IP address then operating system send the query to the DNS server or domain name server.
(5) If Domain Name server dont know the IP Address then DNS server sends the query to the Root Name Server.
(6) Root Name Server is having the IP addresses of the TLDs or Top Level Domains like .org, .com and .edu
(7) Root Name Server give the address of the TLD Name servers as per query(.com Name Server).
(8) Then DNS goes to TLD Name server.
(9) TLD Name server tells the address of the GoForTricks name server.
(10) Then DNS goes to GoForTricks Name server and get the IP Address and sends it back to browser via Operating System.
( 11) Now Browser Open the IP Address and we get the webpage on our monitor screen.
Process to find the IP address of the website is also called the DNS lookup.
There are three type of query which generate in this process of Domain Name System.
(1) Reverse DNS Lookup
This is very important part of DNS query. In this process of reverse query we find the website name from the IP address means we already have the IP address and then we find the domain name of the website. This process is called the reverse lookup.
(2) Recursive Query
This type of the query is definitive query means that if our client or computer sends the query to find the IP address of the particular domain name then it sends the query to the DNS server and DNS server gives the IP address by finding on the internet.
In this process our computer find the IP address yes or not from the DNS server. It means DNS server gives the definitive answer to our computer that weather this IP address is available or not.
If this IP address is available then then DNS server let it know to your computer.
In this process Our DNS server can not use the other DNS server to find the IP address of the perticular domain. That is why this is called the definitive query or recursive query.
(3) Iterative Query
This is non definitive query means it is the communication between our DNS server to other DNS server or root server which redirect our DNS server to other DNS server to resolve the query which is sent by our computer.
In this process every time our DNS server gets the non definitive answer for this reason it is called the Iterative Query.
This is how the DNS work.