DNS (Domain Name System)
In the Internet, the client and server communicate with each other using an IP address, but 32-bit integers are too difficult for people to remember, so the Internet defines the domain name and the mechanism for mapping the domain name to an IP address. The process of mapping a domain name to an IP address is called Domain name resolution .
The main points of the parsing process for domain-to-IP addresses are as follows: When an application needs to resolve the hostname to an IP address, the application invokes the resolver and becomes the client of the DNS, placing the domain name to be resolved in the DNS request message and sending it to the local domain name server in the form of a UDP user datagram. After the local domain name server finds the domain name, the corresponding IP address is returned in the reply message.
The order in which DNS servers are queried during domain name resolution is: Local cache record, zone record, forwarding domain name server, root name server. The following is a brief discussion of the domain name parsing process:
1. Host to the local domain name server query is generally used recursive query , the so-called recursive query is: If the host is queried by the local domain name server does not know the IP address of the domain name, the local name server as a DNS client, to other root domain Servers continue to issue query request messages (that is, continue querying for the host), rather than letting the host make its own further next query. Therefore, the query result returned by the recursive query is either the IP address to be queried, or an error, indicating that the desired IP address cannot be queried. 、
2. The local domain name server's query to the root domain server is usually an iterative query . The iterative query feature is that when the root name server receives an iterative query request message from the local domain name server, it either gives the IP address to be queried or tells The local name server: "which domain name server do you want to query next?". Then let the local domain name server make subsequent queries (rather than follow-up queries for the local domain name server). The root name server usually tells The local name server the IP address of the top-level name server you know, and lets the local name server query the top-level domain server. After receiving a query request from the local domain name server, the top-level domain server either gives the IP address to be queried or tells The local domain name server which domain name servers should be queried next. The local domain name server iterates over the query and finally returns the resolved domain name IP address to the host that initiated the query.
The example steps for recursive and iterative queries are as follows:
DNS Domain name resolution