Domain name system (DNS)


Introduction to DNS
So hello everyone In this article we are going to understand about the DNS, what is DNS, how it works and so many things, after reading this article you will be able to explain what is DNS to anyone.
DNS stands for Domain name system it is nothing but like the phone number directory, you store the phone number of your friends, family members in your mobile phone and give that number a name for example if your friend’s name is John then you will save John’s phone number as John in your phone directory of mobile and then whenevey you want to call John you will search for the John not for the John’s phone number in phone directory you have no need to remember the phone number of John, you can give a name to phone numbers, DNS system exactly works like this You can take an analogy with this phone book example, DNS is a Phone book and friend’s number is IP addres of the server you give a name to the IP address of the server and store that name in DNS with the IP address so that you don’t need to remeber the IP address of any server you can call the server by it’s name only.
There are so many layers exist so many terminologies and tech jargens used but don’t worry we
What is DNS ?
Domain Name system(DNS) is fundamental to everything we do online, DNS is a way to tell a machine to access any website in internet, DNS is a user friendly way to remeber any website’s IP address as we have seen in introduction part we have no need to remeber IP address of any website, instent of remembering IP address we point a name to that IP address and tha name is known as Domain, DNS is a record of all Domain names with the IP address, we always type the domain of any website in web browser the DNS will start to search for the corresponding IP address and this process is known as DNS Lookup.
How Domain Looks Like ?
Domain name is a name provided to any web servers IP address instent of call IP address we call the Domain name of that website and then the process of DNS Lookup starts.
A structure of a domain name is devided into many parts-
Sub-domain - Lebelsto the left of the main domain name for example devblog.aryan.com here devblog is a subdomain.
Second level Domain name (SLD) - This is the actula name of the website for example www.google.com here google is SLD.
Top-level Domain (TLD) - This is the most general part, indicating the type or location of the domain for example (.com, .org, .in, .uk etc)
The domain name starts with the host name followed by the name of the website and finally ends with the top level domain line .com, .org etc.
How Domain name is different from URL-
Domain name is just the name of the website but URL is consist more information
Protocol - HTTP/HTTPS
Domain name - Name of the website consist sud-domain, SLD, TLD for example www.google.com
Path or specific file or folder on the website - path of any particulat page in the website includes after the while domain name seperated by “ / “ for example getbootstrap.com/docs here “/docs“ is the path.
Working of DNS-
Domain Name System (DNS) is an important part of how the internet function. It translates human-readable domain names (like www.google.com) into machine-readable IP addresses (like 192.0.2.1) that computers use to communicate with each other. Let’s dive into the detailed steps of how DNS works.
DNS works in layers
DNS client
DNS root servers
TDL server
ANS server
Check Local Cache
The first place our system looks is in its local cache, which may include:
Browser Cache: The browser might have recently stored the IP address if we’ve visited the site before.
Operating System (OS) Cache: The OS maintains a DNS cache to speed up lookups.
Router Cache: Our router might also store previously requested IP addresses.
If the IP address is found in any of these caches, the process ends here and the browser connects to the website. Otherwise, the process moves forward.
DNS Client -
DNS client is the local DNS system which is preinstalled in our machine DNS client also known sa DNS resolver as it’s name says the work of DNS resolver resolves the IP address of the domain name, DNS client of DNS resolver finds the IP address of that requested domain as I told you DNS client is localy installed in machine or computer DNS client also caches the IP address of the websites. If you want to connect to any server the you have to know the IP address of that perticular machine or server, when you write the domain name of any website, browser search for the IP address of which requested domain is pointing in DNS client, if browser successfully finds the IP address in DNS client then browser redirects you to the server.
DNS root servers-
DNS root server is the server situated in remote location, in the whole world 13 DNS root servers exist we are going to see the need of DNS root server, We have talked about the DNS client previously that how DNS client work but wait, what if the IP address of the rquested domain is not available in the DNS client then, so how you will react to the server, to solve this problem DNS root servers comes in the picture, whenever you request for any website in browser the browser search for the IP addres of the requested domain name in DNS client but if the browser is unsuccessful to resolve or find the IP address then browser will ask to the DNS root server for the IP address of the requested domain name, but wait here domain root server does not give you the IP address of the requested domain it gives the IP address of the TDL server.
TLD servers-
TLD stands for Top Level Domain server. Whenever you request for any domain name browser will search for the IP address in the DNS client and id brouser is unsuccessful to resolve the IP address of the requested domain name the request will refer to the DNS root server, as I have told previously that the domain root server doen not give the IP addtess of the domain name but it gives the IP address of the TLD servers. Domain root server checks for the subdomain of the requestd domain name now what is this subdomain, if we request for the domain name www.google.com here .com is the subdomain, DNS root server search for the IP address of the TLD server to which the subdomain of requested domain name belongs, for example if the sub domain of the requested domain is .com then DNS root server will return the IP address of .com TLD server and the the requested domain will be transfered to that TLD server and then TLD server will return the IP address of the ANS.
ANS (Authoritative name server)-
As I have told there are so many layers and tech jargens in this filed ANS is an another tech jargen. ANS stands for Authoritative name server in TLD server we have seen that after passing the requested domain name to the TLD server, TLD servers retrns the IP address of the ANS. ANS is nothing but the domain name providers like godaddy, bigrocks etc. after passing the request to TLS server it returns the IP address of the ANS server from where the requesten domain name was bought, and after find the ANS server requested domain name is transfered to the ANS and the ANS returns the IP address fo the requested website or server to the browser and then browser redirects you to the website.
Website Loads
Our browser receives the response from the real server and the website content is displayed on our screen. All of this happens in just milliseconds, making the process seamless for the user.
We have two ways to complect the above process to get Ip address of requested domain
Iterative
Recursive
Is DNS secure:
DNS traffic is, by default, unencrypted, which means third parties can see users’ queries.
There are three major secure transport protocols which have been, or are being, standardized for DNS. These are DoT, DoH, and DoQ:
Conclusion
In this article we have discuss about the Domain name system (DNS) that DNS is just like phone book of intenet where we can find the IP address of the any address via name called as domain name, and we have discussed about the Domain name, parts of domain name (subdomain, 2nd level domain , top level domain) and the difference between URl and Domain name and we have discussed about the querying process of the DNS and discussed about the cache, DNS client, TLS, ANS.
Subscribe to my newsletter
Read articles from Aryan Dhirhi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
