域名解析

DNS (domain name system) is a distribu……

DNS (domain name system) is a distributed database for tcp/ip applications, which provides the conversion between domain names and IP addresses. Through the domain name system, users can directly use memorable and meaningful domain names for some applications, and the domain name is resolved to the correct IP address by the domain name resolution server in the network.
Domain name resolution is divided into static domain name resolution and dynamic domain name resolution, which can be used together. When resolving domain names, first use static domain name resolution (look up the static domain name resolution table). If the static domain name resolution is unsuccessful, then use dynamic domain name resolution. Because dynamic domain name resolution requires the cooperation of domain name server (DNS server), it will take some time. Therefore, some commonly used domain names can be put into the static domain name resolution table, which can greatly improve the efficiency of domain name resolution.

1.1.1 static domain name resolution
Static domain name resolution is to manually establish the corresponding relationship between domain name and IP address. When the user uses the domain name for some applications (such as telnet applications), the system looks up the static domain name resolution table and obtains the IP address corresponding to the specified domain name.
1.1.2 dynamic domain name resolution
1. Analysis process
Dynamic domain name resolution resolves domain names into IP addresses by querying the corresponding relationship between domain names and IP addresses from the domain name server. The dynamic domain name resolution process is as follows:


(1) When the user uses the domain name for some applications, the user program first sends a request to the parser in the DNS client.
(2) After the DNS client receives the request, it first queries the local domain name cache. If there is a mapping item that has been resolved successfully, return the IP address corresponding to the domain name to the user program; If the mapping item to be searched is not found, a query request is sent to the domain name server.
(3) The domain name server first looks up the IP address corresponding to the domain name from its own database. If it is judged that the domain name does not belong to the domain, the request will be handed over to other domain name servers for processing until the resolution is completed, and the resolution result will be returned to the DNS client.
(4) After receiving the response message from the domain name server, the DNS client returns the resolution result to the user program.