Have you ever come across a ‘Telephone Directory’, widely in use before the advent of cellphones and smartphones? Its purpose was to help the user to find the telephone number of a subscriber identified by a name and an address or, in other words, we can say that it translated the name and address of a person into telephone number.
What purpose does an English-to-Hindi or a Hindi-to-English dictionary serve? Basically,translation of words from one language to another.
(Beating around the bush? Not really. Reaching DNS very soon)
How is a student in a class identified? Usually,in two ways- by a name and an enrollment number. Teachers and class fellows prefer names but most of the official work involves roll number. For downloading an admit card or a result, enrollment number gets the preference.
Similarly, an Internet host is identified in two ways-1)By a host name. Eg-www.xyz.com
2)By an IP address. Eg-121.7.106.83
Humans like you and me, specify the host name because its easier to remember the names that long numbers but the Transport layer’s IP protocol needs IP address to work any further. So, we need something, which can map a host name to an IP address and vice-versa. This is where, DNS enters the stage and performs its role of translation or mapping.
What is DNS ?
DNS stands for Domain Name System.
The DNS plays the role of a supporting program and helps other application programs (like,gmail) in translating a hostname to an IP address.
It is based on Client-Server Architecture. Lets see what it means? It means the client DNS sends a query to DNS server with the hostname provided by the user. In response, the DNS server, sends back the IP address of the required host.
Working of DNS:-
In the centralized DNS systems, there is a single server for handling the query resolutions. But, it cannot be implemented in today’s Internet scenario. What will happen if the only server fails? Whole Internet will crash, isn’t it? What will happen if the central server is at one place of the world and accessed from all other places? Significant and large distances will result into considerable delays in transfer. Who likes low speed of Internet?
Hence, The implementation of DNS is done in a ‘distributed manner’. It is implemented as a collection of large number of servers, organized hierarchically all over the world.
The hierarchy contains the following classes of DNS servers:-
1. Local DNS Server:- located on the network to which a computer is attached,usually at the ISP
2. Root DNS Server:-looks into the records in the root zone and produces the list of authoritative name servers.
3.Top-Level Domain (TLD) DNS Servers:-keeps all root zone and maintains it
4. Authoritative DNS Servers:-stores the maps of domain name to IP address
Now let us try to understand the working of this DNS system through a simple example, step-by-step.
Let there be two hosts, namely, abc.xyz.edu and pq.lmn.uvw.edu. The first host wants to interact with the second one, so types its URL in the browser and presses the enter key.
Step-1
The first host sends the DNS query message to its local DNS server, namely, dns.xyz.edu.
Step-2
Local DNS server forwards the message to the Root DNS Server.
Step-3
The Root DNS Server studies the suffix “edu” and sends a list of IP addresses containing the particular suffix to the local DNS Server.
Step-4
Root DNS Server passes the list to TLD DNS Servers.
Step-5
TLD DNS Server studies the suffix uvw.edu and sends back the IP address of the authoritative DNS server of the destination host, i.e. , dns.uvw.edu.
Step-6
Local DNS Server sends the query message to the authoritative DNS server.
Step-7
Authoritative DNS server sends the IP Adress of pq.lmn.uvw.edu to the local DNS Server.
(Images source: My own).