The Domain Name System (DNS) is the way that internet domains names for e.g. “www.google.com” are located and translated into internet protocol (IP) addresses something like “126.96.36.199”. The domain name system maps the name of a website to the IP addresses of the server hosting it, thus allowing to locate a website.
An important and ubiquitous function of DNS is its central role in distributed internet services. When a user accesses a distributed Internet service using a URL, the domain name of the URL is translated to the IP address of a server that is proximal to the user.
The key functionality of DNS exploited here is that different users can simultaneously receive different translations for the same domain name. This feature of DNS to be able to provide the users with the proximal server is key to providing faster and more reliable responses on the Internet.
How DNS works?
There are four DNS servers involved during the processing of a DNS query in the backend:
- DNS recursor: The recursor can be thought of as a librarian who is asked to go find a particular book somewhere in a library. The DNS recursor is a server designed to receive queries from client machines through applications such as web browsers. Typically, the recursor is then responsible for making additional requests in order to satisfy the client’s DNS query.
- Root nameserver: The root server is the first step in resolving the human readable host names into IP addresses. It can be thought of like an index in a library that points to different racks of books, typically it serves as a reference to other more specific locations. There are 13 such root name servers distribute all across the globe, and manages by different independent organisations.
- TLD nameserver: The top level domain server (TLD) can be thought of as a specific rack of books in a library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion of a hostname (In example.com, the TLD server is “com”). There are over 750 such TLDs currently present all over the globe.
- Authoritative nameserver : This final nameserver can be thought of as a dictionary on the specific rack of books, in which a specific name can be translated into its definition. The authoritative nameserver is the last stop in the nameserver 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 (the librarian) that made the initial request.
The following 8 steps take place in a typical DNS lookup sequence:
- A user types ‘example.com’ into a web browser and the query 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 (such as .com or .net), which stores the information for its domains. When searching for example.com, our request is pointed toward the .com TLD.
- 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.
Onec the above steps successfully resolve the IP address of the requested url, the following two steps take place:
- The browser makes a HTTP request to the IP address.
- The server at that IP returns the webpage to be rendered in the browser.
Thus, the internet’s own phonebook along serves our endless web requests and keep the infinite web on and flowing.