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

How the wireless network market will develop in 2022

​A wireless network is a computer network that re...

Report: Global 5G RAN market shows strong growth

Global demand for 5G RAN is expected to grow at a...

Want to save power on your 5G phone? Wake it up first!

With the development of 5G networks, everyone has...

Can lightweighting become the spark that sets 5G off?

At the 31st PT Expo held recently, 5G became the ...

What is the charm of IPFS?

Fudan University has established the IPFS System ...

[6.18] RackNerd: $17.88/year KVM-1.8GB/18GB/5TB/Los Angeles Data Center

RackNerd has released a special package for the 6...

The battle of 1G to 5G, the communication reshuffle is about to begin

Recently, there has been a big conflict between H...

A comprehensive review of the main concepts of K8S!

[[392655]] This article is reprinted from the WeC...