Understand the working principle and process of the DNS server

Source: Internet
Author: User
Tags fully qualified domain name

The DNS server provides services to convert host names and domain names to IP addresses. Why do I need to convert host names and domain names to IP addresses? This is because when a client on the network accesses resources on a server
The Host Name and domain name entered in the address bar of the browser are easy to remember. The connection between computers on the network is achieved through the unique IP address of each computer in the network, in this way, there is a resolution between the address that is easily remembered by the user and the address that can be identified by the computer, and the DNS server plays an important role in address resolution. Next, I will take you to the DNS world, learn more about the working principle and process of the DNS server, and hope to help you.

Learn about DNS services

DNS is short for Domain Name System. It is a computer and network service naming System that organizes Domain hierarchies. When you enter a DNS name in an application, the DNS service can resolve the name to the IP address information related to the name.

When using network services, users prefer to enter a host name and a domain name in the address bar of the browser, such as computer.bookshop.com, because such names are easier to remember. However, computers use IP addresses to communicate over the network. To enable communication between network computers, the DNS server provides services that map the names of computers or services used by users to IP addresses.

DNS Service Process

When the DNS client needs to query the name used in the program, it will query the DNS server to resolve the name. Each query message sent by the client includes three pieces of information to specify the question to be answered by the server.

● The specified DNS domain name is a fully qualified domain name (FQDN ).

● The specified Query type, which can specify resource records based on the type or be a special type of query operation.

● The specified category of the DNS domain name.

For a DNS server, it should always be specified as the Internet type. For example, the specified name can be a computer's fully qualified domain name, such as hosta.hello.company.com, and the specified Query type is used to search for address resource records using this name. The system regards DNS query as a two-part question raised by the client to the server. For example, "do you have an address resource record for a computer named hostname.hello.company.com ?" When the client receives a response from the server, it reads and interprets the address resource record of the response to learn about the IP address of the computer on which it asks questions by name.

DNS queries are parsed in different ways. Sometimes, the client can use the cache information obtained from the previous query to locally respond to the query. The DNS server can use its own resource record information cache to respond to queries, or it can represent a request client to query or contact other DNS servers to completely resolve the name, then, the response is returned to the client. This process is called recursion.

In addition, the client can also try to contact another DNS server to resolve the name. If the client does this, it uses independent and additional queries based on server responses. This process is called iteration.

In short, the DNS query process is performed in two parts: first, the name query starts from the client and is transferred to the Resolution Program (DNS Customer Service) for resolution; second, when the local resolution query is not supported, you can query the DNS server to resolve the name as needed. The DNS query process is 4-1.

Figure 4-1 DNS query Process

 

As shown in the initial steps of the query process, the DNS domain name is used by the local program. The request is then sent to the DNS customer service for resolution by using the locally cached information. If the query name can be parsed, the query is answered and the process is completed. The local
The parser cache can obtain the name information from the following two possible sources:

● If the host file is configured locally, any host name-to-address ing from the file will be preloaded to the cache at DNS Customer Service startup.

● The resource records obtained from the previous DNS query response will be added to the cache and retained for a period of time.

If the query does not match the items in the cache, the resolution process continues and the client queries the DNS server to resolve the name.

Next, query the DNS server. When the local DNS cannot be queried locally, You can query the DNS server to resolve the name as needed. As shown in Figure 4-1, the client queries the preferred DNS server. The actual server used in this process is selected from the global list. When the DNS server receives a query, it first checks whether it can make an authoritative response based on the resource record information obtained in the local configuration area of the server. If the query name matches the corresponding resource record in the local region information, the server will make an authoritative response and use this information to parse the query name.

If the query name does not have region information, the server checks whether it can resolve the name through the local cache's previous query information. If the matching information is found, the server uses it to respond to the query. Then, if the preferred server can use the response from its cache to respond to the client sending the request, the query is complete.

If no matching response from the cache or region information is found in the query name on the preferred server, the query continues and uses recursion to completely resolve the name, including support from other DNS servers, to help parse the name. By default, DNS customer service requires the server to use recursive procedures before returning a response to indicate that the client completely resolves the name. In most cases, the default DNS server configuration supports recursive procedures, as shown in Figure 4-2.


 

 

Figure 4-2 recursive parsing process

 

To make the DNS server run correctly, you must first put some useful contact information from other DNS servers in the DNS domain name space memory. This information is provided as a root clue. It is a list of initial resources and can be used to locate some DNS servers that have absolute control over the root of the DNS domain name space tree. The root server has absolute control over the root domain and top-level domain in the DNS domain name space tree. The DNS server can use the root clue to search for the root server to complete the recursion process.

For example, when a client queries a single DNS server, the recursive process is used to locate the name host.example.microsoft.com. This process is performed when the DNS server and client are started for the first time and there is no local cache information that can help resolve the name query.

First, the server is preferred to analyze the full name and determine the location of the server with absolute control right for top-level domain com. Then, use iterative queries on the com DNS server to obtain the reference information of the microsoft.com server. Then, the reference response is sent from the microsoft.com server to the DNS server of example.microsoft.com. Finally, contact example.microsoft.com. Because the server includes the query name that is part of its configuration area, it gives an authoritative response to the source server that initiates recursion. When the source server receives a response indicating that it has obtained an authoritative response to the request query, it forwards the response to the client sending the request. In this way, the recursive query process is completed.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.