Open In App

Address Resolution in DNS (Domain Name Server)

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

Prerequisite – Domain Name Server 
Mapping a domain name to an IP Address is known as Name-Address Resolution. The Domain Name Server (DNS) Resolver performs this operation by consulting name servers. 

Mapping name to an address or an address to a name is called name-address resolution.

RESOLVER

  • DNS is designed as a client -server application.
  • A host that needs to map an address to a name or a name to an address calls a DNS client called a resolver.
  • The resolver accesses the closest DNS server with a mapping request.
  • If the server has the information it satisfies the resolver ;otherwise, it either refers the resolver to other servers or asks other servers to provide the information.
  • After the resolver receives the mapping, it interprets the response to see if it is a real resolution or an error, and finally delivers the result to the process that requested it.

Mapping Names to Addresses

In this case, the server checks the generic domains or the country domains to find the mapping. If the domain name is from the generic section, the resolver receives a domain name such as “chal .atc: fhda.edu”. The query is sent by the resolver to the local DNS server for resolution. If the local server cannot resolve the query, it either refers the resolver to other servers or asks other servers directly. If the domain name is from the country domain section, the resolver receives a domain name such as “ch .fhda.cu.ca.us”. The procedure is the same.

Mapping Addresses to Names

A client can send as IP address to a server to be mapped to a domain name. This is called a PTR query. To answer queries of this kind, DNS uses the inverse domain. However, in the request, the IP address is reversed and two labels, in- addr and arpa are appended to create a domain acceptable by the inverse domain section. For example. if the resolver receives the IP address 132.34.45.121 , the resolver first inverts the address and then adds the two labels before sending. the domain name sent is “121.45.34.132.in-addr.arpa” , which is received by the local DNS and resolved.

In order to find a particular DNS requesting host place its query to the Local DNS Server with a mapping request. If it has the information, the resolver is satisfied else the resolver is referred to other servers or other servers are asked to provide the information. After the resolver, gets the response, it checks whether the response is correct or not. If the response is correct, the response is passed to the process that requested it, else the name query fails. 

A resolution can be of two types – iterative and recursive. 

Recursive Resolution

Here, the client requires the Local Server to give either the requested mapping or an error message. A DNS Query is generated by the application program to the resolver to fetch the destination IP Address. The Query is then forward to the local DNS Server. If it knows the IP Address, it sends a response to the resolver. Assuming, it does not know the IP Address, it sends the query to the root name server. 

The client (resolver) can ask for a recursive answer from a name server. This means that the resolver expects the server to supply the final answer. If the server is the authority for the domain name, it checks its database and responds. If the server is not the authority, it sends the request to another server (the parent usually) 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.

The root name server contains information about at least one server of Top Level Domain. The query is then sent to the respective Top-Level Domain server. If it contains the mapping, the response is sent back to the root server and then to the host’s local server. If it doesn’t contain the mapping, it should contain the IP Address of the destination’s local DNS Server. The local DNS server knows the destination host’s IP Address. The information is then sent back to the top-level domain server, then to the root server and then to the host’s Local DNS Server, and finally to the host. 

 

Recursive and Iterative Resolution

Iterative Resolution

The main difference between iterative and recursive resolution is that here each server that does not know the mapping sends the IP Address of the next server to the one requested it. Here, the client allows the server to return the best answer it can give as a match or as a referral. A DNS Query is generated by the application program to the resolver to fetch the destination IP Address. The Query is then forward to the local DNS Server. Assuming, it does not know the IP Address, it sends the query to the root name server. 

The root name server returns the IP Address of the Top-Level Domain Server to the Local Server. The Top-Level Domain server is contacted by the Local Server and it returns either the IP of the destination host or its local DNS Server. If it returns the server’s address, then by contacting the destination’s Local DNS Server, we get the IP Address of the destination host. The response/mapping is then passed from the host’s local DNS server to the resolver and then finally to the host. 

If the client does not ask for a recursive answer, the mapping can be done iteratively. If the server is an authority for the name, it sends the answer. If it is not, it returns (to the client) 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. If the newly addressed server can resolve the problem , it answers the query with the IP address; otherwise, it returns the IP address of a new server to the client. Now the client must repeat the query to the third server. This process is called iterative because the client repeats the same query to multiple servers.

Caching Mechanism

In both iterative and recursive resolution, after a server asks for a mapping request from another server, it receives the response and stores this information in the Cache memory before sending it to the client. This is done to lower the search time it takes for a server to check the IP Address in its Database. So, the next time, if a request comes to the server, it first checks its cache memory and tries to resolve the request. The response is marked as Unauthoritative to inform the client that the response is from Cache. The only way caching can be problematic is when the server caches the mapping for a long time and the mapping gets outdated. However, there are techniques to resolve this like using TTL.

Each time a server receives a query for a name that is not inn its domain, it needs to search its database for a server IP address . Reduction if this search time would increase efficiency. DNS handles this with a mechanism called caching. when a server asks for a mapping from another server and receives the response it stores this information in its cache memory before sending it to the client. Caching speeds up resolution, but it can also be problematic. The cache memory must be searched periodically and those mappings with an expired TTL must be purged. If a server caches a mapping for a long time, it may send an outdated mapping to the client.

Comparision of Iterative and Recursive Resolution

Property Iterative Resolution  Recursive Resolution
Server Response  Returns the best match or a referral  Returns the requested mapping or an error message
Query Propagation  Each server that does not know the mapping sends the IP address of the next server  Only the local server sends the query to the next server
Server Load  Higher load on servers since each server in the chain must be queried  Lower load on servers since only the local server is queried
Response Time  Longer response time since multiple servers may need to be queried  Shorter response time since only one or a few servers are queried
Cache Usage  Lower cache hit rate since referrals are returned instead of mappings  Higher cache hit rate since mappings are returned directly
Security  Lower security since each server in the chain may potentially modify the response  Higher security since only the local server is trusted to return a valid response


Last Updated : 21 Sep, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads