DNS: Domain Name System

Suraj Dhamak
3 min readJun 21, 2021

--

What is DNS?

Over a network, the computers always identify each other with the help of unique numbers called IP addresses. They don't understand human languages. We as users always use human languages in order to search for something over the web. To access Facebook we search (www.facebook.com), but computers over the network won’t understand this. For the computers to understand our query to access Facebook, it is necessary that they are provided with the IP address of Facebook.

An IP address is a unique address that identifies a device on the internet or a local network. Format of IP address is (x.x.x.x) where each x ranges from 0 to 255. We as humans can’t memorize the IP address of each and every website. To make it feasible for base users to access the internet, DNS was introduced.
DNS acts as a translator between human users and the computer. It converts a domain name to its IP address.

Example:
www.example.com → DNS → 1.2.3.4

How DNS works?

DNS servers:
Servers are computers, storing HTML files, images, sounds, videos or any other file types. Servers that work together to provide the 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

Workflow:
1. Suppose we search for (example.com) in a web browser. Since the web browser requires the IP address, it will forward our query to the computers operating system. The operating systems are always configured to forward our query to the DNS resolver. So OS forwards our query to the DNS resolver.

2. The DNS resolver initially checks its cache, whether it contains the IP address of the requested website. If the required IP address is available in the cache then it is directly provided to the browser. If the required IP address is missing from the DNS cache, then it forwards our query to the Root name server.

3. Root name server checks the extension of the website, whether it is (.com, .org, .net, .in, etc). Based on the extension, the root name server provides the IP address of the TLD name server to the DNS resolver.
According to our example, we are searching for (www.example.com), it has an extension (.com). So the root name server will provide the IP address of (.com TLD name server) to the DNS resolver.

4. DNS resolver then contacts TLD name server (in our case .com TLD name server). The TLD name server then provides the IP address of the Authoritative name server to the DNS resolver. The Authoritative name server should necessarily store the IP address of the requested website.

How does the TLD name server know that which Authoritative name server stores the IP address of the requested website?
→ When we purchase a domain name from a registrar (for example Godaddy). On the registrar’s website, we can set the Authoritative name server which our domain should use. Once the authoritative name server details are stored on the registrar’s website, it tells the TLD name server managing authority (Registry) to update the TLD name server with the details of the Authoritative name server, which the user has provided. In this way, the TLD name server knows, which Authoritative name server will provide the exact IP address of the requested website

5. When the DNS resolver forwards our query to the Authoritative name server, then it provides the exact IP address of the requested website (www.example.com) to the DNS resolver. The DNS resolver stores this IP address in its cache for future use and provides the IP address to the computers operating system. The operating system forwards the IP to the web browser, which then contacts the respective server associated with that IP and loads the content for the user.

This was all about the basic overview of DNS and its working. To dig deep into DNS, stay tuned. For any queries feel free to connect via LinkedIn.

Happy Learning !!

--

--

Suraj Dhamak
Suraj Dhamak

Written by Suraj Dhamak

IT Geek | Cyber Security | Data Science

No responses yet