The whole process of domain name resolution

The whole process of domain name resolution

The domain name is the URL entered by the browser to access the website address bar, such as www.baidu.com when accessing Baidu search.
To access a website, you must find the ip address of the website server. The domain name and the ip address are corresponding, so the process of domain name resolution is to find the corresponding ip address through the domain name.

Insert picture description here

This domain name resolution process can be divided into ten steps. If the IP address corresponding to the domain name is queried in the current step, the following steps will not continue:

1. The browser searches its own DNS (Domain Name System, Domain Name System) cache.

2. Search for the DNS in the operating system, such as the DNS cache in the memory or the local hosts file (in the Windows environment, maintain a table of domain names and IP addresses, the location is generally C:\Windows\System32\drivers\etc\ hosts)

Insert picture description here
3. Use the recursive query method to query the local domain name resolution server. The server address can be set manually. If it is not set, the local DNS address in the router will be used.

4. The local domain name server adopts an iterative query method.

  1. Look up the root domain name server (although it does not have specific information for each domain name, but it stores the address of the top-level domain name server responsible for the resolution of each domain, such as com, net, org, etc.), the root domain name server returns the top-level domain name of the com domain The address of the server.

  2. The local domain name server initiates a request to the top-level domain name server of the com domain, and returns the address of the baidu.com authority domain name server (authority domain name server, used to save the mapping of all host domain names to IP addresses in the zone)

  3. The local domain name server initiates a request to the baidu.com authority domain name server to obtain the IP address of www.baidu.com

5. The local domain name server returns the obtained IP address to the operating system and also caches the IP address itself.

6. The operating system returns the IP address to the browser and also caches the IP address itself.

7. So far, the browser has obtained the IP address corresponding to the domain name

The difference between recursive query and iterative query:

  • Recursive query is a query mode of the DNS server. In this mode, the DNS server receives a client request and must reply to the client with an accurate query result . If the DNS server does not store the query DNS information locally, the server will query other servers and submit the returned query results to the client.
  • Iterative query DNS server Another query method is iterative query. The DNS server will provide the client with other DNS server addresses that can resolve the query request. When the client sends a query request, the DNS server does not directly reply the query result, but tells it Client another DNS server address, the client submits a request to this DNS server, and loops in turn until the query result is returned.

Guess you like

Origin blog.csdn.net/m0_50654102/article/details/114678139
Recommended