What is the process of DNS domain name resolution?

What is the process of DNS domain name resolution?

Interviewer: Please tell me what the process of DNS domain name resolution is like?

The DNS protocol is an application layer protocol based on UDP. It is used to convert the website's URL, that is, the domain name, into an IP address so that users can access the website.

picture

DNS links domain names and IP addresses together. With a DNS server that stores the correspondence between website domain names and IP addresses, we don't have to enter the IP address to visit a website. Instead, we enter the URL and then access the website by requesting the DNS server to obtain the IP corresponding to the domain name.

picture

The namespace of a DNS domain is a tree-like hierarchical structure, which can generally be divided into a root domain, a first-level domain (also called a top-level domain), a second-level domain, a subdomain, and a host name.

picture

Correspondingly, there will be a domain name server at each layer of the domain name to provide domain name resolution services at the corresponding level.

picture

The process of DNS domain name resolution is that the host first checks the DNS cache on the local browser, then checks the DNS cache and hosts file in the local operating system. If there is no DNS domain name resolution, it will initiate a DNS domain name resolution request to the local DNS server. If the local DNS server has the IP address corresponding to the requested domain name, it will directly return to tell the host. If not, it will send a request to the root domain name server. The root domain name server is the highest level and is not directly used for domain name resolution, but it will tell the local DNS server to find the corresponding top-level domain name server. Then, the local DNS server will find the corresponding top-level domain name server for request. The top-level domain name server will tell the local DNS server to find the corresponding authoritative DNS server. The local DNS will then turn to ask the authoritative DNS server. After the authoritative DNS server queries, it will tell the local DNS the corresponding IP address, and the local DNS will return the IP address to the host.

At this time, in order to avoid the above resolution process again when the DNS resolution is initiated for this domain name next time, the host and the local DNS will cache the domain name resolution result just now. The next time the resolution is performed, if there is a cache, the resolution result can be directly obtained from the cache.

picture

picture

picture

picture

picture

From the above process, we can see that there are two types of DNS query methods, one is recursive and the other is iterative.

Recursive query means that if A requests B, then B, as the recipient of the request, must give A the answer he wants.

picture

Iterative query means that if receiver B does not have the exact content required by requester A, receiver B will tell requester A how to obtain the content, but will not make a request itself.

picture

In actual applications, recursive queries are usually used for queries from the requesting host to the local DNS server, while iterative queries are used for the local DNS server to send query requests to the root domain name server or top-level domain name server.

picture

picture

<<:  What are the differences between HTTP and HTTPS besides security?

>>:  Quick introduction to IM communication technology: short polling, long polling, SSE, WebSocket

Recommend

IMIDC Japan multi-IP server from $88/month, E3-123x/16GB/512G SSD/30M bandwidth

IMIDC is a local operator in Hong Kong. The busin...

Learn how to start your networking career

The networking industry is changing rapidly, and ...

Elisa's 5G network now covers half of Finland's population

Finnish operator Elisa said its 5G network has be...

6 SD-WAN Challenges and Benefits

Software-defined WAN (SD-WAN) has obvious advanta...

5G plans of the three major operators in 2020

So far, the three major operators have released t...

Network security knowledge: View the user license agreement

It is very necessary to understand the user licen...