DNS query Principle

Source: Internet
Author: User
Most network communication is based on TCP/IP, while TCP/IP communication is based on IP addresses. But in real-world network access, who would like to use IP addresses for access? We cannot remember the IP addresses. To solve this problem, we have DNS.

DNS: When a domain name system user accesses the Internet, the user enters www.luwenju.com as a computer name, and the user's computer delivers it to the DNS server. After receiving the request, the server will respond to the user's computer with an IP address, your computer accesses the Internet through the IP address returned by the DNS server. As shown in

The DNS client needs to obtain the IP address of a computer to query the DNS server. Because the DNS server can query the IP address of a computer based on the corresponding DNS database, therefore, it returns www.luwenju.com = 192.168.1.100 in its resource record to the client.

The client submits the name of the computer to be accessed to the DNS server, and then the server starts querying. There are four types of DNS server queries: 1. recursive query 2. Iterative query 3. forwarder 4. Private Root

The following four query methods are respectively used:

1. recursive query:

When the DNS client sends a request to the DNS server to resolve a computer name, the DNS server first looks for its own database. If the database contains the ing information of the corresponding domain name and IP address, return the IP address corresponding to the domain name to the client. If the server does not find this resource record in its own database, the query fails.

First, the DNS client initiates a query request to the DNS server, and then the DNS server starts to check the resource record. If the resource record is found, it is returned to the client. If the record cannot be found, you can search for the record through the forwarder and root prompt. If the DNS server does not find this record in any way, the query fails.

2. Iterative query:

Iterative query refers to the query that a DNS server sends to an external DNS server.

① When the client initiates a request to the local DNS server, what is the IP address of www.luwenju.com?

② When the local DNS server receives an iterative query from the DNS client, the root server provides the IP address of the DNS server near the submitted domain name.

③ The local DNS server initiates an iterative query to the submitted DNS server, and so on until the local DNS server receives the resource record to be queried.

④ After receiving the resource record, the DNS server sends it to the local DNS Server

⑤ The local DNS server returns the resource record to the DNS Client

3. Forwarder

The forwarder forwards users' requests (requests that cannot be resolved by the internal DNS server) to the DNS server on the external network for resolution.

① The client initiates a DNS request to the local DNS server: What is the IP address of www.luwenju.com?

② This record is not found in the Resource Record of the local DNS server. Because the forwarding function is configured, the DNS client requests are forwarded to the Internet DNS server.

③ The Internet DNS server returns the resource record to the local DNS Server

④ The local DNS server returns the record to the client

4. Private Root

(To be continued)

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.