What is DNS and How it Works?

DNS:

DNS is an abbreviation of Domain Name System. It is used to translate domain names into IP addresses that allows browsers to access other internet resources.

Role of DNS:

DNS plays a vital role in translating domain names into numerical IP addresses that computers use to identify and communicate with each other. When users enter a domain name into address bar of their web browser, users are directed towards the site they want to visit. This instant task consists of several steps known as DNS lookup or DNS resolution process.

Important terms Used in DNS:

DNS Record:

DNS record is an IP address that matches the competent domain name and it handles requests for that domain.

Host Files:

It is simple text file that maps hostnames to IP addresses in an operating system.

Cache:

Cache is a hardware or software component that stores data temporarily in computing environment.

Problems Associated with Matching of IP Address:

There are certain problems where IP address does not match with domain name in your hosts file and cache. There
problems are dealt by taking necessary steps that involve DNS servers.

DNS Servers:

DNS servers are integral part of DNS records, associating domain names with their corresponding IP addresses. DNS resolution is the name given to this process of translation and lookup. The DNS is setup in a hierarchy. There are various types of DNS servers that involve in loading a website.
If your computer cannot find a matching IP address in host file or cache, it will send DNS request to system of four DNS servers.

1- DNS Resolver:

DNS resolver is also known as DNS recursive server. It plays primary role between a computer and other DNS servers. It manages DNS queries from client devices. Its objective is to forward a request to other DNS and send it back once completed. When recursive resolver receives a request, firstly it will search its cache to find a matching IP address for domain name. If said IP address finds , the request sent to DNS servers ends here. Hence, you will instantly view the website you want to visit.
However, If no match is found, DNS resolver will send request to DNS server named as Root Nameserver.

2- Root Nameserver:

Root nameserver is also known as Root DNS server. It represents top level of DNS hierarchy. There are 13 sets of root servers distributed worldwide. They keep information about authoritative DNS servers responsible for top-level Domains. When root DNS server receives a request from DNS resolver, it will recognize top-level domain of domain name. Then it will inform DNS resolver to go to correct TLD nameserver.

3- TLD Nameserver:

This DNS server manages the DNS records for specific top-level domains such as .com, .org, .net, .online etc. For each TLD, there are authoritative DNS servers that store information for domains within that TLD.

4- Authoritative Nameserver:

Other name of authoritative nameserver is authoritative DNS server. It is the Final authority in DNS resolution process. It stores actual DNS record for specific domain names that you want to visit. The DNS resolver will obtain IP address and send it back to your computer, pointing you to the site. Ultimately, the DNS caching that stores IP addresses collected from authoritative nameservers as a temporary data.

DNS caching:

This helps users in providing DNS information for frequently accessed domain names without sending request to authoritative DNS server everytime.