Working principle [switch] DNS of

  DNS is a very important service on the Internet, because now when people use the Internet, almost all in the use of the domain name to access a resource rather than an IP address. It can be said that people always need DNS services to help convert the target computer name to an IP address in the process of accessing Internet resources, once the DNS service fails, it will lead to paralysis lnternet.
  In order to provide a fully qualified domain name resolved to a user, you need to install and configure the network DNS server and the user's computer is configured as a DNS server or several clients. DNS client makes a query to the DNS server, DNS server, the request to make the appropriate response.
DNS queries resolve in a variety of different ways. The client can sometimes get query results from the query cache previously obtained. DNS server can use its own cache to answer a query, the query can be resolved by a client or contact other DNS servers, and the response back to the client, this process is called recursively (query). In addition, the client itself can attempt to contact other servers to resolve the name, this process is called iteration (query).
In short, DNS query process carried out in the following two parts:

  1. Inquiry sent to the parser parsed, if the results are returned in the native resolution.
  2. If you can not be resolved locally, the query DNS servers to resolve the name.

The following figure shows the complete DNS query process.

 

  4-38 Q1 shown in A1 and two local resolution process procedure shown in FIG. If the user input in the browser address bar www.example.com, the browser will Xianxiang resolver query IP address of the host before the host communication with the address corresponding to the. Q1 query request sent to the parser, the parser checks the local cache to see whether the in situ resolution. If you find the results in the cache, the result is sent to the browser (A1), the end of this inquiry. Local resolve the name information in the cache may have the following two sources:

  1. hosts file . If the file exists, any of which host names to IP address mapping will be pre-loaded into the cache when the DNS Client service is started.
  2. The inquiry response response acquired in previous DNS records stored in local DNS cache and kept for a period of time.

  If the information in the cache can not find a match, the resolution process continues, the client by querying DNS server to resolve the name.
  As shown, the client queries the primary DNS server 4-38 (Q2). When the DNS server receives a query, it first checks its local configuration information region (Q3) does not match the query. If so, then the server response to make A3, and use that information to resolve names (A2) query. If not, the server checks whether it is the previous query information through its cache to resolve the name (Q4). If a match is found from the information (A4), the server will return the client information (A2), the query is completed.
  If the above steps are unable to find the information matches, the query process continues. Primary DNS server uses a recursive process to obtain information from other DNS servers to help them resolve the name. In most cases, the default DNS server configured to support recursive process, the entire process is shown in FIG 4-39.

  As shown in Figure 4-39, assume that the client wants to host address query is host.hello.example.com. First, the main server analyzes the full name and determine the IP address of the DNS server has absolute control over top level domain com. Subsequently, the servers are queried to get the address of example.com subdomain DNS server. Then again example.com subdomain DNS server to query, to get the address hello.example.com DNS server. Finally, contact the DNS server hello.example.com subdomain on. The server queries its configuration in the area corresponding to the host IP address host.hello.example.com, and returns the result to the primary DNS server, the primary server then forwards this response to the client, so that the entire recursive query process is complete a.
  If the client uses an iterative process, the primary DNS server does not need to be like in a recursive manner to do so much work, only to return a reference to the reply to the client, which contains information about the client in favor of the resolution request (such as root tips etc.), while no other operations; client process then decide according reference information returned by the DNS server. But in the actual network environment, disable DNS servers tend to make recursive queries DNS server can not be resolved locally client requests return a reference to the reply of a server failure, this time, the client will consider resolution failed.
  Recursively and differences iterative approach is that when the DNS server does not have complete resolution requests the client locally, who will play the role of DNS resolution request initiated by a client to other DNS servers . Should be used recursively Typically, it is a good network management and security control. Just a recursive DNS server performance mode consumes more than an iterative manner, but under normal circumstances, the performance of this consumption does not matter.

Guess you like

Origin www.cnblogs.com/rockyching2009/p/11748245.html