What is DNS?
DNS stands for Domain Name System. It is a naming system that is used to identify devices across the internet. It is an application layer protocol and is used to map the domain names to the IP addresses.
Why it is needed?
It is very difficult to remember IP addresses for every website that we check out. For example, if we want to do online shopping, we search for some online shopping websites' names. It will be really difficult for us to visit a website if we have to remember IP addresses for every website instead of their name.
DNS makes this task easy for us as it maps the domain names with IP addresses and we don't need to remember IP addresses. We just search for the domain name of the website and DNS provides the IP address for that website.
Types of Domain
The various types of Domain are:
- Generic Domain - It defines the category of the domain. For example - (.com- commercial), (.org - non-profit organization), (.edu - educational).
- Country Domain - It categorizes according to the country. For example - (.in - India), (.uk - United Kingdom).
- Inverse Domain - It is used for mapping an address to a name. When a client requests to the server, the server has a list of authorized clients. It sends the query to the DNS server to verify the client belongs to the list of authorized clients and sends a query to the DNS server to map an address to the name.
How does DNS work?
The host requests for the IP address of a particular domain name to the DNS server and the IP address is returned to the host by the DNS server. The hierarchy of the resolution of the request is shown below.

- The client requests for the IP address of a particular domain name to the DNS resolver.
- The resolver requests to the root DNS server.
- The root DNS server then forwards the query to the Top-level DNS server.
- The top-level domain server has all the information about the authoritative DNS servers.
- The authoritative server then returns the IP address corresponding to the requested domain name to the resolver.
- The resolver then returns the IP address to the host.