The working principle and process of DNS server

Source: Internet
Author: User
Tags resource fully qualified domain name

The service provided by the DNS server is the task of converting the host name and domain name to an IP address. Why do I need to convert the hostname and domain name to an IP address? This is because when a client on a network accesses a resource on a server, the user enters the browser's address bar with the easy to remember host name and domain name. The connection between computers on the network is accomplished by the unique IP address that each computer has on the network, which requires a resolution between the user's easily remembered address and the address that the computer can identify, and the DNS server acts as an important role in address resolution. Next I will take you into the DNS world, detailed understanding of how the DNS server works and its process, I hope to be able to bring some help to friends.

Understanding the DNS Service

DNS is the abbreviation for the domain Name System, a computer and network service naming system that organizes domain hierarchies. When a user enters a DNS name in an application, the DNS service can resolve this name to the IP address information associated with this name.

Users like to use network services in the browser's address bar to enter the use of host name and domain name, such as computer.bookshop.com, because such a name is more easily remembered by the user. However, the computer uses an IP address to communicate on the network. To enable communication between network computers, the service provided by the DNS server is to map the computer or service name used by the user to an IP address.

The work process of the DNS service

When a DNS client needs to query the name used in a program, it queries the DNS server to resolve the name. Each query message sent by the client includes 3 messages to specify the question the server should answer.

The specified DNS domain name, which is represented as a fully qualified domain name (FQDN).

The specified query type, which can specify resource records based on type or as a specialized type of query operation.

The specified category for the DNS domain name.

For DNS servers, it should always be specified as an Internet category. For example, the specified name can be a fully qualified domain name for the computer, such as hosta.hello.company.com, and the specified query type is used to search for an address resource record through that name. The system will use DNS query as a client to the server two parts of the problem, such as "for the computer named Hostname.hello.company.com, you have address resource records?" When a client receives a reply from the server, it reads and interprets the address resource record of the answer to understand the IP address of the computer it asks questions by name.

DNS queries are parsed in a variety of different ways. Clients can sometimes answer queries in place by using cached information obtained from a previous query. The DNS server can use its own resource record information cache to answer queries, or to query or contact other DNS servers on behalf of the requesting client, to fully resolve the name, and then return the answer to the client. This process is called recursion.

In addition, the client itself can try to contact other DNS servers to resolve the name. If the client does so, it uses a separate and additional query based on the server's answer, which is called an iteration.

In summary, the DNS query process is done in two parts: first, the name query starts from the client and is routed to the resolver (DNS Client Service) for resolution, and secondly, the DNS server can be queried as needed to resolve the name when the query cannot be parsed in place. The procedure for DNS queries is shown in the following illustration.

Figure DNS Query process

DNS domain names are used by native programs, as shown in the initial steps of the query process. The request is then routed to the DNS client service to resolve by using the information in-place caching. If the name of the query can be resolved, the query is answered and the procedure is completed. Where the local resolver cache can obtain name information from the following 2 possible sources:

If the host file is in-place configured, the mapping of any host name to address from the file will be preloaded into the cache when the DNS Client service is started.

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

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

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.