What are the different types of DNS queries?

The DNS Domain name systemis a hierarchical naming system that provides a unique identity to each URL on the internet. The user enters the domain name. The DNS resolves the domain name so the user can access the web page using the IP address. We call this process the name resolution. Let's see the servers that perform the name resolutions to understand how the DNS query is looked up.

These are the servers that lie on the hierarchy below:

  1. Root DNS server

  2. TLD(Top level domain) DNS servers

  3. Authoritative DNS servers

Hierarchy of DNS servers

We'll pass all the name-resolution requests through these servers before an IP address is produced.

Process

Below are different ways to resolve a DNS query:

  • Recursive DNS lookup

  • Iterative DNS lookup

Recursive DNS lookup

In recursive DNS lookup, one DNS server communicates with the other DNS servers higher in the hierarchy. This communication is on behalf of the local DNS server until it completely resolves the IP address and is sent back to the requesting host. In the recursive approach, the query is between the host and the local DNS server.

How to fetch a recursive query

Iterative DNS lookup

In iterative DNS lookup, the client interacts and requests name resolution from each DNS server. The query is between the local DNS server and the other servers.

When the host asks a DNS server for name resolution, the server finds it in the lookup table and sends it back to the host if the IP is found. Otherwise, it sends the address of the DNS server at the higher level (in the hierarchy) to the local DNS server. This continues until the IP address is found and is sent back to the host.

How to fetch an iterative query

To improve the performance of the lookup query, the local DNS server stores the most frequent search webpage IP address in its cache so that when it is requested again, it is provided by the local DNS server in less time.

Copyright ©2024 Educative, Inc. All rights reserved