DNS called as Domain Name System or Name Server is something that is used by every internet user (knowingly or unknowingly). To understand the role of DNS, you should know what is Domain name. Domain name is a human readable website address. For example, this website’s domain name is Techglimpse.com. It means, if you want to visit Techglimpse, you should type techglimpse.com into your web browser’s address bar.
Now, your computer or web browser doesn’t know how to connect to techglimpse.com; because it does not know where techglimpse.com is located. So it needs help from someone, and that someone is DNS.
To make it simple, DNS is like a telephone directory; which contains number of domain names and its corresponding IP addresses.
IP address is the unique numbers separated by periods that identifies each computer connected to the internet. For example, techglimpse.com runs on machine that has unique IP address as 10.1.0.1.
So when you type techglimpse.com into the web browser’s address bar, you are actually connecting to techglimpse.com’s IP address (10.1.0.1). But how will your browser know that it should connect to 10.1.0.1 for techglimpse.com and ‘188.8.131.52’ for google.com? Here’s where DNS comes into play.
What is Domain Name System?
Domain Name System (DNS) is an industry standard protocol that translates domain name to IP address and viceversa. Checkout the below image that explains what is DNS. The user makes a request to techglimpse.com and the browser asks DNS for techglimpse’s IP address to make HTTP request. Once the DNS returns the IP address, the web browser makes HTTP request and the web server responds to the browser.
What is Recursive DNS Servers?
Whenever the user requests for a domain name, the web browser sends out a DNS query (if it doesn’t have the IP address of the domain name in its cache). The DNS query is first sent to a recursive DNS server. Recursive DNS servers are part of the DNS that responds with necessary information to requestor (for eg. any web client; in our case, web browser). These recursive servers are managed by Internet Service Providers (ISPs) or organizations. Recursive DNS takes help from Authoritative DNS servers.
What is Authoritative DNS Servers?
Authoritative DNS servers knows the mapping of domain to IP and viceversa. It means, they are the actual source that provide information to recursive DNS servers and then the recursive DNS responds to web clients.
How Authoritative DNS and Recursive DNS work together to form DNS?
Every website URL has a specific DNS server or group of servers called as Authoritative. Consider cnn.com, here the Top Level Domain (TLD) is ‘.com’ and the second level domain is ‘cnn’. Now imagine it as a hierarchical tree.
Starting from the top of the tree are the root domain servers. They have IP address of the authoritative servers that responds to DNS queries for the TLD like ‘.com’. Assume that the browser sends a DNS query for cnn.com to recursive DNS server and the recursive DNS server doesn’t have information cached, first it asks root domain servers as what is the IP address of authoritative servers for .com TLD. Then it asks the authoritative servers for ‘.com’ as how to find “cnn” domain’s authoritative server and so on. They are known as recursive servers as they ‘recurse’ through the hierarchical DNS tree in a top-to-bottom fashion, until they reach the authoritative server for the domain which actually has the IP address of the cnn’s web server.
Well, I tried to explain it in a very simple terms to make it easier to understand. But there are many complexities involved behind the scenes. Lets see all those in coming days.