What is DNS?
DNS is “phone-book” to the IPs of your favorite websites. Basically , domain names are important because the Internet’s addressing scheme is not very effective without them.
Each computer on the Internet has an Internet protocol (IP) address: a unique string of four numbers separated by periods, such as 220.127.116.11. Since remembering the IP addresses of all of your favorite Web sites would be nearly impossible, a group of computer scientists created the domain name system to assign a unique name to each numeric IP address.
DNS is a complicated topic with many aspects that affect your day to day life. To understand the process behind the DNS resolution, it’s important to learn about the different hardware components a DNS query must pass between. For the web browser, the DNS lookup occurs “ behind the scenes” and requires no interaction from the user’s computer apart from the initial request.
How DNS Works?
There are 4 main DNS resolver to complete the domain search . We will go through one-by-one .
DNS Recursor – It can be same as the map, directing the possible ways to reach your destination. It solve the request of client after receiving a DNS query from a web client, a recursive resolver will either respond with cached data, or send a request to a root nameserver, followed by another request to a TLD nameserver, and then one last request to an authoritative nameserver.
Root Nameserver – After getting the requests from recursor , the root server will resolve the host address(domain name) to machine IP. It makes the query bit more specific .
TLD Nameserver – The top level domain server can be described as the blocks in the map. It is the second nameserver to find out the TLD host in the nameserver; ex- for domain name example.com , the TLD is .com.
Authoritative nameserver – This is the last step of the DNS query . If the authoritative name server has access to the requested record, it will return the IP address for the requested hostname back to the DNS Recursor (DNS resolver).
Steps For DNS Lookup
As we got to know that DNS is transferring domain name to IP address, but there are some steps to perform it . Let’s take a glance at those steps.
- A user types ‘example.com’ into a web browser and the search travels into the Internet and is received by a DNS recursive resolver.
- The resolver then queries a DNS root nameserver (.).
- The root server then responds to the resolver with the address of a Top Level Domain (TLD) DNS server (ex- .com, .net, .org), which stores the information for its domains. But this case “example.com” , the TLD is “.com” .
- The resolver then makes a request to the .com TLD.
- The TLD server then responds with the IP address of the domain’s nameserver, example.com.
- Lastly, the recursive resolver sends a query to the domain’s nameserver.
- The IP address for example.com is then returned to the resolver from the nameserver.
- The DNS resolver then responds to the web browser with the IP address of the domain requested initially.
After those steps of the DNS lookup have returned the IP address for example.com, the browser is able to make the request for the web page:-
(i). The browser makes a HTTP request to the IP address.
(ii). The server at that IP returns the webpage to be shown on the browser.
After the understanding the process, you must be wondering-
What is a DNS resolver and How it works ?
It’s the first stop of whole DNS lookup process, dealing with the client’s initial request. It forward the queries to servers, which transferred to necessary IP .