Domain Name System (DNS) in Computer Network

Domain Name System (DNS) in Computer Network

In this tutorial, you are going to learn about the Domain Name System (DNS) in Computer Network.

Domain Name System

There are several applications in the application layer of the Internet model that follow the client/server paradigm.

The client/server programs can be divided into two categories:

  • Those that can be directly used by the user, such as e-mail.
  • Those that support other application programs.

The Domain Name System (DNS) is a supporting program that is used by other programs such as e-mail.

To identify an entity, TCP/IP protocols use the IP address, which uniquely identifies the connection of a host to the Internet. However, people prefer to use names instead of numeric addresses. Therefore, we need a system that can map a name to an address or an address to a name. When the Internet was small, mapping was done by using a host file. The host file had only two columns: name and address.

Today, however, it is impossible to have one single host file to relate every address with a name and vice versa. The host file would be too large to store in every host. In addition, it would be impossible to update all the host files every time there was a change.

One solution would be to store the entire host file in a single computer and allow access to this centralized information to every computer that needs mapping. But we know that this would create a huge amount of traffic on the Internet.

Another solution, the one used today, is to divide this huge amount of information into smaller parts and store each part on a different computer.

In this method, the host that needs mapping can contact the closest computer holding the needed information. This method is used by the Domain Name System (DNS).

Name Space

To be unambiguous, the names assigned to machines must be carefully selected from a name space with complete control over the binding between the names and IP addresses. A name space that maps each IP address to a unique name can be organized in two ways:

  • Flat Name Space – Names are without structure
  • Hierarchical Name Space – Names are assigned using some structure. Each name is made of several parts.

Domain Name Space

To have a hierarchical name space, a domain name space was designed. In this design the names are defined in an inverted-tree structure with the root at the top. The tree can have only 128 levels: level 0 (root) to level 127.

Domain Name and Labels

Label – Each node in the tree has a label, which is a string with a maximum of 63 characters. Root is a null string. DNS requires that children of a node have different labels which guarantees the uniqueness of the domain names.

Domain Name – Each node in the tree has a domain name. The domain name are always read from the node up to the root.

Distribution of Name Space

The information contained in the domain name space must be stored. However, it is very inefficient and also unreliable to have just one computer store such a huge amount of information. In this section, we discuss the distribution of the domain name space.

DNS in the Internet

In the Internet, the domain name space (tree) is divided into three different sections: generic domains, country domains, and the inverse domain.

Generic Domain:

  • Registered hosts according to their generic behaviour.
  • Each node in the tree defines a domain, which is an index to the domain name space database.

Country Domain: Country domain follows the same format as the generic domain but uses two character country abbreviations.

Inverse Domain:

  • It is used to map an IP address to a name.
  • This may happen when a server has received a request from a client to do a task.
  • Then the server asks its resolver to send a query to the DNS server to map IP address to a name to determine if the client is on the authorized list.
  • This type of query is called an inverse or pointer query.


Mapping a name to an address or an address to a name is called name-address resolution. DNS is designed as a client/server application. A host that needs the mapping calls a DNS client called a resolver. The resolver accesses the closest DNS server with a mapping request. If the DNS server has the information, it satisfies the resolver otherwise it asks other servers to provide the information.

Recursive Resolution

  • Resolver can ask for a recursive answer from a name server
  • Resolver expects the server to supply the final answer.
  • If the server is the authority, it checks its database and replies.
  • If the server is not the authority, it sends the request to another server and waits for the response. If the parent is the authority, it responds; otherwise, it sends the query to yet another server.
  • When the query is finally resolved, the response travels back until it finally reaches the requesting client.

Iterative Resolution

  • If the server is authority, it sends the answer.
  • If the server is not authority, it returns the IP address of the server that it thinks can resolve the query.
  • The client is responsible for repeating the query to this second server.

This tutorial on Domain Name System (DNS) in Computer Network is contributed by Rajnish Kumar. If you like TheCode11, then do follow us on Facebook, Twitter and Instagram.

Previous Post Next Post

Contact Form