Domain name resolution method, device, system, medium and equipment
By using a designated protocol to encapsulate DNS request and response information between the DNS load balancer and the back-end server, and carrying the IP address and port number of the requester, the performance bottleneck when a single DNS server handles a large number of requests is solved and high availability is achieved. , Highly stable DNS domain name resolution system.
Patent Information
- Application Number
- CN202110618390.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-03
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-06-03
AI Technical Summary
In the prior art, a single DNS server has performance bottlenecks when processing a large number of DNS resolution requests, making it difficult to provide a highly available and highly stable DNS domain name resolution system.
Encapsulate DNS request and response information by using a specified protocol (such as EDNS_PROXY or a custom UDP protocol) between the DNS load balancer and the backend server, and carry the IP address and port number of the requester in the data packet so that the backend server can Directly obtain the requester's information and generate a response.
It realizes the processing of larger-scale DNS resolution requests, provides a highly available and highly stable DNS domain name resolution system, reduces the memory consumption and performance pressure of the DNS load balancer, and improves the response speed and user experience.
Smart Images

Figure CN115442378B_ABST
Abstract
Description
Technical Field
[0001] This article relates to the field of Internet, and in particular to domain name resolution methods, devices, systems, media and equipment. Background Art
[0002] In the Internet, as user demands increase, centralized deployment of network equipment can no longer meet the needs of users in various regions. Therefore, distributed deployment is widely used. For example, Internet Data Centers (IDCs) and other network equipment can be deployed in several provinces or in each province to meet user needs.
[0003] Since the Domain Name Service (DNS) stores the domain names of all hosts in the network and the corresponding Internet Protocol (IP) addresses for interconnection between networks, and has the function of converting domain names into IP addresses, after the IDC is deployed in a distributed manner, the DNS will also be deployed in a distributed manner accordingly.
[0004] After the distributed network deployment is completed, the DNS in each partitioned network stores the domain name and corresponding IP address of each host in the partitioned network, and the network requests sent by each user device in the network are resolved by the DNS. The existing technology deploys a DNS server in each partitioned network. Due to the performance bottleneck of a single DNS server, it is difficult to withstand a larger number of DNS resolution requests. There is currently a lack of a highly available and stable DNS domain name resolution system. Summary of the invention
[0005] In order to overcome the problems existing in the related art, this article provides a domain name resolution method, device, medium and equipment.
[0006] According to a first aspect of the present invention, a domain name resolution method is provided, which is applied to a DNS load balancer, comprising:
[0007] Receive DNS request information from the requesting end, and obtain the IP address and port number of the requesting end;
[0008] Encapsulating the DNS request information into a scheduling data packet using a specified protocol, and encapsulating the IP address and port number of the requesting end in a first specified field of the scheduling data packet;
[0009] The scheduling data packet is sent to the back-end server so that the back-end server unpacks the scheduling data packet, obtains the DNS request information, and obtains the IP address and port number of the requesting end from the first designated field of the scheduling data packet. The back-end server generates DNS response information based on the DNS request information, or the back-end server generates DNS response information based on the DNS request information and the IP address of the requesting end.
[0010] In some embodiments of the present application, based on the above solution, the domain name resolution method further includes:
[0011] Receive a first response packet returned by the backend server, the first response packet being a data packet obtained by encapsulating the DNS response information by the backend server using the specified protocol, and the IP address and port number of the requesting end being encapsulated in a second specified field of the first response packet;
[0012] Unpacking the first response packet to obtain the DNS response information;
[0013] The DNS response information is sent to the requesting end.
[0014] In some embodiments of the present application, based on the aforementioned solution, the decapsulating the response packet further includes, the decapsulating the first response packet further includes, obtaining the IP address and port number of the requesting end in the second designated field of the first response packet;
[0015] The sending the DNS response information to the requesting end includes: sending the DNS response information according to the IP address and port number of the requesting end.
[0016] According to another aspect of the present invention, a domain name resolution method is provided, which is applied to a backend server and includes:
[0017] Receiving a scheduling data packet sent by a DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol;
[0018] Unpacking the scheduling data packet, obtaining the DNS request information of the requesting end, and obtaining the IP address and port number of the requesting end from the first designated field of the scheduling data packet;
[0019] Generate DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end.
[0020] In some embodiments of the present application, based on the aforementioned solution, generating DNS response information based on the DNS request information and the IP address of the requesting end includes:
[0021] The resolution result related to the domain name is determined according to the domain name corresponding to the DNS request information, and the optimal IP address is selected from the resolution result as the target domain name IP address for response according to the area corresponding to the IP address of the requesting end.
[0022] In some embodiments of the present application, based on the aforementioned scheme, the domain name resolution method further includes: encapsulating the DNS response information into a first response packet, and sending it to the DNS load balancer, or encapsulating the DNS response information into a second response packet, and sending the second response packet to the requesting end based on the IP address and port number of the requesting end.
[0023] In some embodiments of the present application, based on the above solution, encapsulating the DNS response information into a first response packet includes:
[0024] The DNS response information is encapsulated using the specified protocol to form the first response packet, and the IP address and port number of the requesting end are encapsulated in a second specified field of the first response packet.
[0025] In some embodiments of the present application, based on the aforementioned solution, the specified protocol includes: EDNS_PROXY protocol or a custom UDP protocol.
[0026] According to another aspect of the present invention, a domain name resolution device is provided, which is applied to a DNS load balancer, including:
[0027] A first receiving module is used to receive DNS request information from a requesting end, and obtain an IP address and a port number of the requesting end;
[0028] A first encapsulation module, used to encapsulate the DNS request information into a scheduling data packet using a specified protocol, and encapsulate the IP address and port number of the requesting end in a first specified field of the scheduling data packet;
[0029] A scheduling module is used to send the scheduling data packet to the back-end server so that the back-end server unpacks the scheduling data packet, obtains the DNS request information, and obtains the IP address and port number of the requesting end from the first designated field of the scheduling data packet. The back-end server generates DNS response information based on the DNS request information, or the back-end server generates DNS response information based on the DNS request information and the IP address of the requesting end.
[0030] In some embodiments of the present application, based on the above solution, the domain name resolution device further includes:
[0031] A response packet receiving module, used to receive a first response packet returned by the back-end server, wherein the first response packet is a data packet obtained by encapsulating the DNS response information by the back-end server using the specified protocol, and the IP address and port number of the requesting end are encapsulated in a second specified field of the first response packet;
[0032] A first decapsulation module, used to decapsulate the first response packet and obtain the DNS response information;
[0033] A sending module is used to send the DNS response information to the requesting end.
[0034] According to another aspect of the present invention, a domain name resolution device is provided, which is applied to a backend server and includes:
[0035] A scheduling result receiving module, used to receive a scheduling data packet sent by a DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol;
[0036] A second decapsulation module, used to decapsulate the scheduling data packet, obtain the DNS request information of the requesting end, and obtain the IP address and port number of the requesting end from the first designated field of the scheduling data packet;
[0037] A response module is used to generate DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end.
[0038] In some embodiments of the present application, based on the above solution, the response module is further used to:
[0039] The DNS response information is encapsulated into a first response packet and sent to the DNS load balancer, or the DNS response information is encapsulated into a second response packet and the second response packet is sent to the requesting end based on the IP address and port number of the requesting end.
[0040] According to another aspect of the present invention, a domain name resolution system is provided, including a DNS load balancer and a backend server;
[0041] The DNS load balancer is used to receive the DNS request information of the request end, obtain the IP address and port number of the request end; use the specified protocol to encapsulate the DNS request information into a scheduling data packet, and encapsulate the IP address and port number of the request end in the first specified field of the scheduling data packet; send the scheduling data packet to the back-end server; receive the first response packet returned by the back-end server, the first response packet is a data packet after the back-end server encapsulates the DNS response information using the specified protocol, and the IP address and port number of the request end are encapsulated in the second specified field of the first response packet; unpack the response packet to obtain the DNS response information; send the DNS response information to the request end;
[0042] The back-end server is used to receive a scheduling data packet sent by a DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol; unpacking the scheduling data packet, obtaining the DNS request information of the requesting end, and obtaining the IP address and port number of the requesting end from the first specified field of the scheduling data packet; generating DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end; encapsulating the DNS response information into a first reply packet and sending it to the DNS load balancer, or encapsulating the DNS response information into a second reply packet and sending the second reply packet to the requesting end based on the IP address and port number of the requesting end.
[0043] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed, the steps of the above-mentioned domain name resolution method are implemented.
[0044] According to another aspect of the present invention, a computer device is provided, comprising a processor, a memory and a computer program stored in the memory, wherein the processor implements the steps of the above-mentioned domain name resolution method when executing the computer program.
[0045] This article provides a domain name resolution method, in which a DNS load balancer performs load balancing on DNS requests, determines a backend server, encapsulates the DNS request information into a scheduling data packet using a specified protocol, and encapsulates the IP address and port number of the requesting end in the scheduling data packet, so that the backend server generates DNS response information according to the DNS request information or according to the DNS request information and the IP address of the requesting end, and encapsulates the DNS response information into a first reply packet. The backend server can encapsulate the response information using a specified protocol, encapsulate the response information into a first reply packet according to the IP address and port number of the requesting end and send it to the DNS load balancer. After the DNS load balancer receives the first reply packet sent by the backend server, it obtains the DNS response information and the IP address and port number of the requesting end from the first reply packet, and sends the DNS response information according to the IP address and port number of the requesting end. The backend server can also encapsulate the DNS response information into a second reply packet, and send the second reply packet to the requesting end based on the IP address and port number of the requesting end in the first specified field of the scheduling data packet. The technical solution disclosed in the present invention can withstand a larger number of DNS resolution requests and provide a highly available and stable DNS domain name resolution system. Since the scheduling data packet and the first response packet both carry the IP address information and port number information of the requesting end, the DNS load balancer no longer needs to maintain and query the corresponding relationship table between the requesting end IP, port number and the back-end server, and can directly send the DNS response message back to the requesting end based on the encapsulated IP address information and port number of the requesting end, effectively reducing the memory consumption of the DNS load balancer and improving the processing capacity of the load balancer. The back-end server can also obtain the IP address of the requesting end and perform accurate resolution response based on the DNS request information and the region corresponding to the IP address of the requesting end.
[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings constituting a part of this document are used to provide a further understanding of this document. The exemplary embodiments and descriptions of this document are used to explain this document and do not constitute an improper limitation on this document. In the accompanying drawings:
[0048] Figure 1 The present invention is a flowchart of a domain name resolution method according to an exemplary embodiment.
[0049] Figure 2 It is a schematic diagram of a data packet of the EDNS_PROXY protocol according to an exemplary embodiment.
[0050] Figure 3It is a schematic diagram of a data packet encapsulated by the EDNS_PROXY protocol according to an exemplary embodiment.
[0051] Figure 4 The figure is a schematic diagram of a data packet of a custom UDP protocol according to an exemplary embodiment.
[0052] Figure 5 It is a schematic diagram of a data packet encapsulated by a custom UDP protocol according to an exemplary embodiment.
[0053] Figure 6 The present invention is a flowchart of a domain name resolution method according to an exemplary embodiment.
[0054] Figure 7 The figure is a block diagram of a domain name resolution device according to an exemplary embodiment.
[0055] Figure 8 The figure is a block diagram of a domain name resolution device according to an exemplary embodiment.
[0056] Fig. 9 The figure is a block diagram of a domain name resolution device according to an exemplary embodiment.
[0057] Fig.10 The invention is a block diagram of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of the embodiments of this article clearer, the technical solutions in the embodiments of this article will be clearly and completely described below in conjunction with the drawings in the embodiments of this article. Obviously, the described embodiments are part of the embodiments of this article, not all of the embodiments. Based on the embodiments in this article, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this article. It should be noted that the embodiments in this article and the features in the embodiments can be combined with each other arbitrarily without conflict.
[0059] In order to solve the problems existing in the background technology, this article provides a domain name resolution method.
[0060] This article adopts the DNS server cluster approach to cope with larger-scale DNS cluster request traffic, and improves the performance of the DNS server cluster by adding a DNS load balancer in front of the cluster composed of multiple DNS servers.
[0061] In one method, the DNS load balancer maintains a corresponding table related to each DNS request (a corresponding table of the requesting end IP, port number and backend server) on the device during the process of forwarding data packets. However, this method has the following problems:
[0062] Each forwarding requires maintaining and querying the correspondence table between the requesting end IP, port number and backend server, which reduces the performance of the DNS load balancer and consumes a lot of memory.
[0063] When the DNS request packet reaches the backend server through the DNS load balancer, the backend server can only obtain the IP address of the DNS load balancer, but cannot obtain the source IP of the actual request. In the DNS resolution process, an IP library that represents the relationship between the request source and the network location and an overlay solution that reflects the mapping relationship between the request target object, the network area, and the Web Server IP are generally used to ultimately guide the user's access to the optimal server (Web Server) IP. Since the resolution process depends on the determination of the request source IP, when the request source IP is inaccurate, it is impossible to return different results based on the request region information, and the service quality will be greatly affected.
[0064] Furthermore, in order to at least partially solve the problem that the DNS service cannot accurately resolve the DNS resolution request because the back-end server cannot obtain the actual request source IP when the DNS resolution request passes through the DNS load balancer to reach the back-end server, or the DNS load balancer needs to maintain the corresponding relationship table of the request end IP, port number and back-end server, resulting in memory loss, performance degradation, etc., according to an exemplary embodiment of the present invention, a domain name resolution method is provided.
[0065] Figure 1 FIG. 1 is a flowchart of a domain name resolution method according to an exemplary embodiment. Figure 1 A domain name resolution method is applied to a DNS load balancer, including steps S11 to S13, which are specifically described as follows:
[0066] In step S11, the DNS request information of the requesting end is received, and the IP address and port number of the requested end are obtained.
[0067] In the domain name resolution method provided in this article, the DNS load balancer can be a server with corresponding software installed and load balancing implemented by the software, or it can be a dedicated load balancer used to load balance and schedule DNS requests from a large number of request ends.
[0068] Specifically, the requesting end may be a client or a server device. For example, a client requests a DNS cluster for domain name resolution, where the client may be a terminal device operated by a user, such as a tablet computer, a smart phone, etc. Alternatively, the requesting end may also be a server device such as a recursive resolution server or an edge node.
[0069] The DNS load balancer receives the DNS request information from the requesting end. The requesting end sends the DNS request information to the DNS load balancer. Those skilled in the art know that the DNS request information is sent in the form of a data packet. The DNS request information is the domain name resolution request. The DNS load balancer receives the data packet sent by the requesting end and can obtain the DNS request information, as well as the IP address and port number of the requesting end.
[0070] In step S12, the DNS request information is encapsulated into a scheduling data packet using a specified protocol, and the IP address and port number of the requesting end are encapsulated in the first specified field of the scheduling data packet so that the backend server can obtain the IP address and port number of the requesting end.
[0071] After the DNS load balancer receives the DNS request information from the requesting end, it first determines the backend server based on the load balancing strategy. The load balancing strategy can be a polling strategy; it can also perform HASH calculations on the requesting end's IP or requested domain name and other information, and assign backend servers based on the calculation results; it can also be other load balancing strategies, which are not limited in this article. Through the DNS load balancer, a large number of domain name resolution requests from the requesting end are evenly distributed to the backend servers in the cluster, improving the processing efficiency of the server cluster and preventing individual backend servers from being overloaded, resulting in resolution failures.
[0072] In step S13, a scheduling data packet is sent to the back-end server so that the back-end server unpacks the scheduling data packet, obtains the DNS request information, and obtains the IP address and port number of the requesting end from the first designated field of the scheduling data packet. The back-end server generates DNS response information based on the DNS request information, or the back-end server generates DNS response information based on the DNS request information and the IP address of the requesting end.
[0073] In this embodiment, after the DNS load balancer determines the back-end server, it is necessary to encapsulate the DNS request information, encapsulate it into a scheduling data packet and send it to the determined back-end server, so that the back-end server responds to the DNS request information. In this embodiment, the DNS load balancer performs load balancing scheduling on the request of the request end. In order to no longer maintain the corresponding relationship table between the request end IP, port number and back-end server, in the process of encapsulating the scheduling data packet, the DNS request information is encapsulated into a scheduling data packet using a specified protocol, and the IP address and port number of the request end are encapsulated in the first specified field of the scheduling data packet, and the scheduling data packet is sent to the back-end server. After the back-end server receives the scheduling data packet, it can not only obtain the DNS request information from the data packet, but also obtain the IP address and port number of the request end from the first specified field of the scheduling data packet, so that the back-end server can obtain the real IP address and port number of the request end, and can return the best target domain name IP address for the request end according to the IP address and port number of the request end, for example, it can be based on the request end IP Address positioning, so as to return the target domain name IP address with good network quality with the request end IP area, and can also ban some request end IP or return a rejection response packet. Return the target domain name IP address with lower load or best communication quality in the area where the requester is located, so that the target domain name IP address can quickly respond to the requester's request and improve the user experience.
[0074] In one embodiment, the back-end server uses a specified protocol to encapsulate the DNS response information into a first response packet, and encapsulates the IP address and port number of the requesting end in a second specified field of the first response packet, and sends the first response packet to the DNS load balancer, so that the DNS load balancer returns the DNS response information in the first response packet to the corresponding requesting end according to the IP address and port number of the requesting end in the second specified field; or, the back-end server directly encapsulates the DNS response information into a second response packet and sends it to the requesting end according to the IP address and port number of the requesting end.
[0075] The DNS load balancer sends the scheduling data packet to the backend server. Since the scheduling data packet is encapsulated by the DNS load balancing server using a specified protocol to encapsulate the DNS request information, the IP address and port number of the requesting end are encapsulated in the first specified field of the scheduling data packet, so that the backend server can obtain the IP address and port number of the requesting end from the first specified field of the scheduling data packet in addition to obtaining the DNS request information by unsealing the scheduling data packet. By obtaining the IP address and port number of the requesting end, the backend DNS server can not only return the best target domain name IP for the requesting end according to the IP address and port number of the requesting end, but also directly send the second response packet to the requesting end according to the IP address and port number of the requesting end in the subsequent response, or encapsulate the IP address and port number of the requesting end in the first response packet and send it to the DNS load balancer, so that the DNS load balancer can timely return the request to the requesting end according to the IP address and port number of the requesting end corresponding to the first response packet.
[0076] The back-end server only needs to encapsulate the IP address and port number of the requesting end in the first response packet and return it to the DNS load balancer. The DNS load balancer can then determine which back-end server the first response packet was sent from and which requesting end it was sent to. The DNS load balancer does not need to maintain a corresponding relationship table between the requesting end IP, port number and back-end server, and can accurately send the DNS response information in the first response packet to the corresponding requesting end, greatly reducing the memory consumption and performance degradation caused by the DNS load balancer maintaining a corresponding relationship table between the requesting end IP, port number and back-end server.
[0077] In one embodiment, the backend server responds to the DNS request information, and after generating the DNS response information, the DNS response information is similarly encapsulated using the same designated protocol to form a first response packet, and the IP address and port number of the requesting end are encapsulated in the second designated field of the first response packet, and sent to the DNS load balancer. After the DNS load balancer receives the first response packet, it can also obtain the DNS response information and the IP address and port number of the requesting end in the first response packet, without the need to query the corresponding relationship table of the requesting end IP, port number and backend server, and can determine the corresponding relationship between the first response packet and the requesting end, and send the DNS response information in the response packet to the corresponding requesting end according to the IP address and port number of the requesting end, which can reduce the memory consumption of the DNS load balancer and improve the working efficiency of the DNS load balancer.
[0078] In this embodiment, in order to facilitate the back-end server to identify the scheduling data packet sent by the DNS load balancer and the DNS load balancer to identify the first response packet returned by the back-end server, the DNS load balancer and the back-end server can use the same specified protocol for encapsulation. Furthermore, the DNS load balancer and the back-end server can encapsulate the IP address and port number of the requesting end in the specified protocol and attach them to the same field of the DNS request packet or the first response packet, or they can encapsulate the IP address and port number of the requesting end and attach them to different fields of the DNS request packet or the first response packet.
[0079] In an exemplary embodiment, after the backend server obtains the IP address and port number of the requester, it can use a specified protocol to encapsulate the DNS response information into a first response packet and send it to the DNS load balancer, wherein the specified protocol can be a custom EDNS extension protocol EDNS_PROXY protocol, or a custom UDP protocol, etc. For example, the backend server encapsulates the requester IP and port number in a custom EDNS extension protocol, attaches it to the EDNS segment of the first response packet, and sends the first response packet to the DNS load balancer. It is also possible to respond directly to the requester by encapsulating the DNS response information into a second response packet, which is sent directly to the requester by the backend server. The DNS response information does not need to pass through the DNS load balancer, which can not only reduce the load pressure of the load balancer, but also reduce the response time and improve the user experience.
[0080] In an exemplary embodiment, the specified protocol can be specified according to a specific scenario. For example, the specified protocol can be an EDNS proxy protocol EDNS_PROXY (a custom extended protocol based on EDNS). The EDNS_PROXY protocol can encapsulate the IP address and port number of the requesting end in the EDNS_PROXY protocol and attach it to the EDNS segment of the scheduling data packet. For example, Figure 2 FIG. 1 is a schematic diagram of a data packet of the EDNS_PROXY protocol according to an exemplary embodiment. The data packet format of the EDNS_PROXY protocol is as follows: Figure 2 As shown, the following extended fields and field lengths are specified in the data part of the DNS packet: CODE (protocol number) field, the field length is 16 bits, used to store the number of the specified protocol, for example, the number of the EDNS_PROXY protocol is 57, and the number of the custom UDP protocol is 58; Family (protocol type) field, the field length is 16 bits, used to store the Internet protocol type identifier, for example, 1 indicates that the Internet protocol is IPv4, and 2 indicates that the Internet protocol is IPv6; Port (port) field, the field length is 16 bits, used to store the port number; IP (IP address) field, the field length is 128 bits, used to store the IP address.
[0081] Figure 3 1 is a schematic diagram of a data packet encapsulated using the EDNS_PROXY protocol according to an exemplary embodiment. When the DNS load balancer encapsulates the DNS request information using the EDNS_PROXY protocol, the requester's IP address and port number and other information are encapsulated in the EDNS_PROXY protocol and attached to the EDNS segment of the DNS scheduling data packet. For example, the requester's IP address is 1.1.1.1 and the port number is 52941. The scheduling data packet after encapsulation using the EDNS_PROXY protocol is as follows: Figure 3 As shown. When the backend server receives the dispatch data packet and unpacks the dispatch data packet, it can obtain the request data and the IP address (1.1.1.1) and port number (52941) of the requesting end in the protocol header. As a custom extension protocol of EDNS, the EDNS_PROXY protocol follows the existing EDNS message format and has good compatibility. It does not require major modifications to the existing DNS server. Using the EDNS_PROXY protocol can reduce the workload of configuring the DNS system.
[0082] In an exemplary embodiment, the specified protocol may also be a custom UDP protocol, for example, Figure 4 FIG. 1 is a schematic diagram of a data packet of a custom UDP protocol according to an exemplary embodiment. The format of the custom UDP protocol is as follows: Figure 4 As shown, the following fields and lengths are specified in the UDP protocol header of the DNS packet: CODE (protocol number) field, the field length is 16 bits, used to store the number of the specified protocol, for example, the number of the EDNS PROXY protocol is 57, and the number of the custom UDP protocol is 58; Family (protocol type) field, the field length is 16 bits, used to store the Internet protocol type identifier, for example, 1 indicates that the Internet protocol is IPv4, and 2 indicates that the Internet protocol is IPv6; Port (port) field, the field length is 16 bits, used to store the port number; IP (IP address) field, the field length is 128 bits, used to store the IP address.
[0083] Figure 5 1 is a schematic diagram of a data packet encapsulated using the UDP protocol according to an exemplary embodiment. When the DNS load balancer encapsulates the DNS request information using the custom UDP protocol, the IP address and port number of the requesting end are encapsulated in the first designated field of the scheduling data packet. For example, the IP address of the requesting end is in the IPv6 protocol format, 2701:ab00:5:1u0::2, and the port number is 49382. The data packet encapsulated using the custom UDP protocol is as follows: Figure 5As shown. When the backend server receives the dispatch data packet, it first obtains the IP address (2701:ab00:5:1u0::2) and port number (49382) of the requesting end from the first specified field in the protocol header, and then obtains the DNS request information from the data part of the DNS packet. When using the custom UDP protocol, the information acquisition process is more complicated than the EDNS_PROXY protocol. It is necessary to first parse the UDP protocol header information to obtain the IP address and port number of the requesting end, and then process the DNS packet after the UDP protocol header to obtain the DNS request information; while the EDNS_PROXY protocol can directly process the DNS packet to obtain the DNS request information and the IP address and port number of the requesting end. In addition, configuring a custom UDP protocol in the existing DNS system requires a major transformation of the existing DNS server, but the custom UDP protocol can redefine the protocol header, has good flexibility, and can meet special needs.
[0084] This application does not restrict which protocol is used and in which field of the data packet the IP address and port number of the requesting end are encapsulated.
[0085] exist Figure 1 In the illustrated embodiment, the DNS load balancer encapsulates the IP address and port number of the requesting end in a dispatching data packet and sends it to the back-end server. Since the back-end server can obtain the IP address of the requesting end in the dispatching data packet, in the scenario where it is necessary to determine the regional information based on the real IP of the requesting end and return different results based on the regional information, the back-end server can determine the region of the requesting end based on the IP address of the requesting end and return the resolution result corresponding to the region of the requesting end to the requesting end. For example, through the method provided in this article, the DNS server can obtain the regional information of the requesting end, resolve the domain name requested by the client, and feed back the target domain name IP address of the edge node with the shortest delay or the best communication quality with the client to the client, so that the client requests data from the nearest edge node.
[0086] exist Figure 1 In the embodiment shown, the domain name resolution method further includes steps S14 to S16, which are specifically described as follows:
[0087] In step S14, a first response packet returned by the backend server is received. The first response packet is a data packet obtained by encapsulating the DNS response information by the backend server using the specified protocol. The IP address and port number of the requesting end are encapsulated in the second specified field of the first response packet.
[0088] In this embodiment, the DNS load balancer receives the DNS request information of the request end, sends the DNS request information to the back-end server determined according to the load balancing result, and is also used to receive the first response packet returned by the back-end server, decapsulate the first response packet to obtain the DNS response information, and send the DNS response information to the corresponding request end. The back-end server can use the same designated protocol as the DNS load balancer to identify the scheduling data packet sent by the DNS load balancer, decapsulate the scheduling data packet, obtain the DNS request information, generate the DNS response information, and return the first response packet encapsulated by the same designated protocol to the DNS load balancer, so that the DNS load balancer can identify the first response packet and obtain the DNS response information. When encapsulating the first response packet, the back-end server encapsulates the IP address and port number of the request end in the second designated field of the first response packet.
[0089] In this embodiment, the IP address and port number of the requesting end are encapsulated in the first designated field of the scheduling data packet and the second designated field of the first response packet. The first designated field and the second designated field both include at least one protocol header field, such as an IP field, a Port field, or a custom field that can simultaneously specify an IP address and a port number.
[0090] In step S15, the first response packet is unsealed to obtain DNS response information. After receiving the first response packet, the DNS load balancer needs to unseale the first response packet to obtain the DNS response information therein.
[0091] In an exemplary embodiment, the decapsulating the first response packet further includes obtaining the IP address and port number of the requesting end in the second designated field of the first response packet. After the DNS load balancer receives the first response packet from the backend server, it decapsulates the first response packet, obtains the DNS response information in the first response packet, and obtains the IP address and port number of the requesting end from the second designated field of the first response packet.
[0092] Therefore, the DNS load balancer can determine that the first response packet is obtained by encapsulating the response information corresponding to the DNS request information sent by the IP address of the requesting end after the back-end server receives it.
[0093] In step S16, the DNS response information is sent to the requesting end.
[0094] The DNS load balancer obtains the DNS response information from the first response packet, sends the DNS response information to the requesting end, and completes the response to the requesting end. Specifically, the DNS load balancer obtains the IP address and port number of the requesting end in the second specified field of the first response packet from the first response packet; and sends the DNS response information according to the IP address and port number of the requesting end.
[0095] In an exemplary embodiment, sending the DNS response information to the requesting end includes: sending the DNS response information according to the IP address and port number of the requesting end. The DNS load balancer only needs to send the DNS response information in the first response packet to the corresponding requesting end according to the IP address and port number of the requesting end. The IP address and port number of the requesting end are obtained from the second designated field of the first response packet, and there is no need to maintain and query the corresponding relationship table of the requesting end IP, port number and backend server in the DNS load balancer, thereby improving the response speed and reducing the consumption of the DNS load balancer memory.
[0096] Through the above steps S11 to S16, the DNS load balancer can complete the reception of the DNS request information of the requesting end, encapsulate the DNS request information using the specified protocol, and send it to the back-end server; receive the first reply packet from the back-end server, obtain the DNS response information and the IP address and port of the requesting end, and send the DNS response information to the requesting end according to the IP address and port of the requesting end. While achieving load balancing, the corresponding relationship between the requesting end IP, port number and back-end server is no longer maintained and queried, which reduces memory consumption and speeds up response.
[0097] Figure 6 FIG. 1 is a flowchart of a domain name resolution method according to an exemplary embodiment. Figure 6 , a domain name resolution method, applied to a backend server, includes steps S61 to S64, which are specifically described as follows:
[0098] In step S61, a scheduling data packet sent by a DNS load balancer is received, where the scheduling data packet is a data packet obtained by encapsulating DNS request information by the DNS load balancer using a specified protocol.
[0099] The backend server is determined by the DNS load balancer according to the load balancing strategy. The DNS load balancer uses the specified protocol to encapsulate the DNS request information into a scheduling data packet, and sends the scheduling data packet to the determined backend server, which responds to the request from the requesting end.
[0100] In step S62, the scheduling data packet is unpacked to obtain the DNS request information of the requesting end, and the IP address and port number of the requesting end are obtained from the first designated field of the scheduling data packet;
[0101] The scheduling data packet is unsealed to obtain the DNS request information of the requesting end. At the same time, when the DNS load balancer encapsulates the IP address and port number of the requesting end in the first designated field of the scheduling data packet, the backend server unseales the scheduling data packet and can also obtain the IP address and port number of the requesting end in the first designated field.
[0102] In step S63, DNS response information is generated based on the DNS request information, or based on the DNS request information and the IP address of the requesting end.
[0103] In an exemplary embodiment, generating DNS response information based on the DNS request information and the IP address of the requesting end includes:
[0104] Determine the resolution result related to the domain name according to the domain name corresponding to the DNS request information, and select the optimal IP address from the resolution result as the target domain name IP address for response according to the area corresponding to the IP address of the requesting end. After obtaining the request information, the back-end server can respond to the DNS request information and generate DNS response information. For example, if the request information is a domain name unblocking request, the back-end server can resolve the requested domain name and use the target domain name IP address serving the domain name as the DNS response information. Alternatively, after the back-end server obtains the request information and the IP address of the requesting end, it can generate DNS response information based on the request information and the IP address of the requesting end. For example, if the request information is a domain name request, the back-end server can use the IP address of the content server serving the domain name as the DNS response information; it can also determine the IP addresses of multiple content servers providing services for the domain name according to the domain name, and then determine the IP address of the optimal content server with the lowest load or the best network quality or the shortest delay with the requesting end in the area according to the area where the IP address of the requesting end is located as the DNS response information.
[0105] The back-end server can obtain the IP address of the requester in the dispatch data packet and return different result data according to the geographical information of the requester.
[0106] In an exemplary embodiment, Figure 6 The domain name resolution method shown also includes: step S64, encapsulating the DNS response information into a first response packet and sending it to the DNS load balancer, or encapsulating the DNS response information into a second response packet and sending the second response packet to the requesting end based on the IP address and port number of the requesting end.
[0107] The backend server can encapsulate the DNS response information into a first response packet and send it to the DNS load balancer, which decapsulates the first response packet to obtain the DNS response information and then forwards the DNS response information to the requesting end. Alternatively, the DNS response information can be encapsulated into a second response packet and the second response packet can be sent to the requesting end based on the IP address and port number of the requesting end in the first designated field of the scheduling data packet.
[0108] In an exemplary embodiment, encapsulating the DNS response information into a first response packet includes:
[0109] The DNS response information is encapsulated using a specified protocol into a first response packet, and the IP address and port number of the requesting end are encapsulated in a second specified field of the first response packet.
[0110] In order for the DNS load balancer and the backend server to identify the contents of the packets encapsulated by each other, the designated protocol used by the backend server is the same as that used by the load balancer, and the designated fields are the same. This avoids configuration errors or failures in extracting relevant information that cause resolution failures.
[0111] The back-end server can encapsulate the DNS response information into a first response packet, use a specified protocol to encapsulate the DNS response information, encapsulate it into a first response packet, and encapsulate the IP address and port number of the requesting end in the second specified field of the first response packet. As response information to the DNS load balancer, the first response packet is returned to the DNS load balancer, and the DNS load balancer unpacks the first response packet, obtains the DNS response information and the IP address and port number of the requesting end, and then sends the DNS response information to the corresponding requesting end. This implementation method can adapt to most existing DNS systems and does not require major adjustments to the existing DNS system. Moreover, while achieving load balancing, this method no longer maintains and queries the corresponding relationship table of the requesting IP, port number and back-end server, reduces memory consumption and speeds up response speed.
[0112] In an exemplary embodiment, the backend server can encapsulate the DNS response information into a second response packet, and send the second response packet directly to the requesting end according to the obtained IP address and port number of the requesting end. In this implementation, the DNS response information is no longer forwarded by the DNS load balancer, the response speed will be faster, and the DNS load balancer does not need to process the response packet again, which can greatly reduce the overhead of the load balancer and improve the load balancing capability. This implementation requires corresponding configuration of the existing DNS system.
[0113] In an exemplary embodiment, generating DNS response information based on the DNS request information and the IP address of the requesting end includes:
[0114] The resolution result related to the domain name is determined according to the domain name corresponding to the DNS request information, and the optimal IP address is selected from the resolution result as the target domain name IP address for response according to the area corresponding to the IP address of the requesting end.
[0115] According to the domain name corresponding to the DNS request information, the content server related to the domain name is determined. According to the area corresponding to the IP address of the requesting end, the optimal content server with the lowest load or the best network quality or the shortest delay with the requesting end is selected as the target server. Generally speaking, one target server corresponds to one target domain name IP address, and the IP of the target server is the optimal target domain name IP address at this time; of course, when the server and the IP are not one-to-one corresponding, the optimal IP address is selected as the target domain name IP address for response. Taking the cloud distribution network as an example, a large number of business servers are configured in the cloud distribution network system and provide services for a large number of domain names. Different business servers can provide services for different domain names. In addition, multiple areas can be divided in the cloud distribution network, and business servers are set up in multiple areas to provide services for the same domain name. Therefore, after the back-end server receives the domain name request, after obtaining the DNS request information and the IP address of the requesting end, it can determine the multiple related business servers that provide servers for the domain name according to the domain name in the request information, and then determine the area where the requesting end is located according to the IP address of the requesting end, and select the business server with the lowest load or the best network quality in the area where the requesting end is located as the target server. The IP address of the target server is used as the target domain name IP and responded to the requester so that the requester can connect to the nearest business server to obtain data content and improve the response speed. Certain requester IPs can also be blocked or a rejection response packet can be returned.
[0116] To better understand the domain name resolution solution provided in this article, Figure 1-Figure 6 Let's take an example to illustrate: Specific embodiment 1:
[0118] Client C1 sends a domain name resolution request to the DNS system, and the request information is www.test.com. The client's IP: 1.1.1.1, port: 52941. The DNS request information is sent to the DNS load balancer of the DNS system in the form of a data packet.
[0119] After receiving the data packet, the DNS load balancer can obtain the DNS request information of client C1, as well as the IP address of client C1: 1.1.1.1, and the port number of the requesting end: 52941.
[0120] The DNS load balancer determines that the backend server A resolves www.test.com according to the load balancing strategy. According to the client's IP address of 1.1.1.1, it determines that the Internet protocol is IPv4 protocol, the Internet protocol identifier is 1, and the DNS request information is encapsulated using the EDNS_PROXY protocol. The protocol number is 57, and the DNS request information www.test.com is encapsulated in the data part of the DNS packet. At the same time, the protocol number "57" is written into the CODE field, the Internet protocol identifier "1" is written into the Family field, the client IP address "1.1.1.1" is written into the IP field, and the client port "52941" is written into the Port field to complete the encapsulation of the request data. Figure 3 The encapsulated data packet is sent to the determined backend server A as a scheduling data packet.
[0121] After receiving the scheduling data packet, the backend server A decapsulates the scheduling data packet and obtains the requested information "www.test.com" in the data part of the DNS packet. At the same time, it obtains the port number "52941" of the client C1 in the Port field of the DNS packet and obtains the IP address "1.1.1.1" of the client C1 in the IP field.
[0122] Backend server A determines multiple related servers that provide services for the requested domain name "www.test.com" based on the requested domain name. Assuming that servers S1, S2, and S3 provide services for the domain name at the same time, the IP addresses of servers S1, S2, and S3 are used as the resolution results. Then, based on the IP address "1.1.1.1" of client C1, it is determined that the client is located in area 1. Then, the area where servers S1, S2, and S3 are located is queried. From the three servers S1, S2, and S3, it is determined that S1 is the shortest distance from the client, so S1 is determined as the target server.
[0123] Assume that the IP address of server S1 is 1.2.3.4, and the backend server A responds with the IP address "1.2.3.4" of server S1 as the target domain name IP address, that is, the backend server responds with the IP address of S1 as the DNS response information.
[0124] Backend server A uses the EDNS_PROXY protocol to encapsulate the DNS response information. The backend server encapsulates the IP address "1.2.3.4" of server S1 in the data part of the DNS data packet, and writes the protocol number "57" into the CODE field, the Internet protocol identifier "1" into the Family field, the client IP address "1.1.1.1" into the IP field, and the client port "52941" into the Port field, encapsulating the DNS response information into the first reply packet. The first reply packet is sent to the DNS load balancer.
[0125] The DNS load balancer receives the first response packet returned by the backend server A, unpacks the first response packet, and obtains the DNS response information from the data portion of the DNS data packet: the IP address "1.2.3.4" of server S1, and obtains the client's port number "52941" from the Port field in the protocol header field of the data packet, and obtains the client's IP address "1.1.1.1" in the IP field.
[0126] The DNS load balancer uses the IP address "1.2.3.4" of server S1 as the DNS response information, and sends the DNS response information to client C1 according to the target address "1.1.1.1" and the target port "52941".
[0127] Client C1 requests data from service server S1 which is the shortest in distance to speed up the response.
[0128] Through the above embodiments, the domain name resolution method provided in this article is adopted, and the DNS load balancer no longer needs to maintain and query the corresponding relationship table between the requesting end IP, port number and back-end server when performing load balancing, which effectively reduces the memory consumption of the DNS load balancer and improves the processing capacity of the load balancer. At the same time, the DNS load balancer can encapsulate the real IP address of the requesting end in the scheduling data packet and pass it to the back-end server. The back-end server can obtain the IP address of the requesting end and perform accurate resolution response according to the DNS request information and the region corresponding to the IP address of the requesting end.
[0129] Figure 7 FIG. 1 is a block diagram of a domain name resolution device according to an exemplary embodiment. Figure 7 The domain name resolution device applied to the DNS load balancer includes: a first receiving module 701, a first encapsulation module 702, and a scheduling module 703.
[0130] The first receiving module 701 is configured to receive DNS request information from a requesting end, and obtain the IP address and port number of the requesting end.
[0131] The first encapsulation module 702 is configured to encapsulate the DNS request information into a scheduling data packet using a specified protocol, and encapsulate the IP address and port number of the requesting end into a first specified field of the scheduling data packet.
[0132] The scheduling module 703 is configured to send the scheduling data packet to the back-end server so that the back-end server unpacks the scheduling data packet, obtains the DNS request information, and obtains the IP address and port number of the requesting end from the first designated field of the scheduling data packet. The back-end server generates DNS response information based on the DNS request information, or the back-end server generates DNS response information based on the DNS request information and the IP address of the requesting end.
[0133] Figure 8 FIG. 1 is a block diagram of a domain name resolution device according to an exemplary embodiment. Figure 8 The domain name resolution device also includes: a response packet receiving module 801, a first decapsulation module 802, and a sending module 803.
[0134] The response packet receiving module 801 is configured to receive a first response packet returned by the back-end server. The first response packet is a data packet obtained by encapsulating the DNS response information by the back-end server using the specified protocol, and the IP address and port number of the requesting end are encapsulated in the second specified field of the first response packet.
[0135] The first decapsulation module 802 is configured to decapsulate the first response packet and obtain DNS response information.
[0136] The sending module 803 is configured to send the DNS response information to the requesting end.
[0137] Fig. 9 FIG. 1 is a block diagram of a domain name resolution device according to an exemplary embodiment. Fig. 9 The domain name resolution device is applied to the back-end server, including: a scheduling result receiving module 901, a second unblocking module 902, and a response module 903.
[0138] The scheduling result receiving module 901 is configured to receive a scheduling data packet sent by a DNS load balancer, where the scheduling data packet is a data packet obtained by encapsulating the DNS request information received from the requesting end by the DNS load balancer using a specified protocol.
[0139] The second decapsulation module 902 is configured to decapsulate the scheduling data packet, obtain the DNS request information of the requesting end, and obtain the IP address and port number of the requesting end from the first designated field of the scheduling data packet.
[0140] The response module 903 is configured to generate DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end.
[0141] The response module 903 is also used to encapsulate the DNS response information into a first response packet and send it to the DNS load balancer, or to encapsulate the DNS response information into a second response packet and send the second response packet to the request end based on the IP address and port number of the request end.
[0142] This article also provides a domain name resolution system, including a DNS load balancer and a backend server;
[0143] The DNS load balancer is used to receive the DNS request information of the request end, obtain the IP address and port number of the request end; use the specified protocol to encapsulate the DNS request information into a scheduling data packet, and encapsulate the IP address and port number of the request end in the first specified field of the scheduling data packet; send the scheduling data packet to the back-end server; receive the first response packet returned by the back-end server, the first response packet is a data packet after the back-end server encapsulates the DNS response information using the specified protocol, and the IP address and port number of the request end are encapsulated in the second specified field of the first response packet; unpack the first response packet to obtain the DNS response information; send the DNS response information to the request end;
[0144] The back-end server is used to receive a scheduling data packet sent by a DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol; unpacking the scheduling data packet, obtaining the DNS request information of the requesting end, and obtaining the IP address and port number of the requesting end from the first specified field of the scheduling data packet; generating DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end; encapsulating the DNS response information into a first reply packet and sending it to the DNS load balancer, or encapsulating the DNS response information into a second reply packet and sending the second reply packet to the requesting end based on the IP address and port number of the requesting end.
[0145] Fig.10 1 is a block diagram of a computer device 1000 for load balancing according to an exemplary embodiment. For example, the computer device 1000 may be provided as a server. Fig.10 The computer device 1000 includes a processor 1001, and the number of processors can be set to one or more as needed. The computer device 1000 also includes a memory 1002, which is used to store instructions that can be executed by the processor 1001, such as application programs. The number of memories can be set to one or more as needed. The application programs stored therein can be one or more. The processor 1001 is configured to execute instructions to perform the above-mentioned domain name resolution method.
[0146] It should be understood by those skilled in the art that the embodiments of this article can be provided as methods, devices (equipment), or computer program products. Therefore, this article can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this article can adopt the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data), including but not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media generally contain computer-readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0147] This document is described with reference to flowcharts and / or block diagrams of methods, apparatuses (devices) and computer program products according to the embodiments of this document. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0148] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 Functions specified in one or more boxes
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0150] In this article, the term "comprises", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that an article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the article or device comprising the elements.
[0151] Although the preferred embodiments of this invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of this invention.
[0152] Obviously, those skilled in the art can make various changes and modifications to this article without departing from the spirit and scope of this article. Thus, if these modifications and variations of this article fall within the scope of the claims and their equivalents, then the intention of this article also includes these modifications and variations.
Claims
1. A domain name resolution method, applied to a DNS load balancer, characterized in that: include: Receive DNS request information from the requesting end, and obtain the IP address and port number of the requesting end; Encapsulating the DNS request information into a scheduling data packet using a specified protocol, and encapsulating the IP address and port number of the requesting end in a first specified field of the scheduling data packet; The scheduling data packet is sent to the back-end server so that the back-end server unpacks the scheduling data packet, obtains the DNS request information, and obtains the IP address and port number of the requesting end from the first designated field of the scheduling data packet. The back-end server generates DNS response information based on the DNS request information, or the back-end server generates DNS response information based on the DNS request information and the IP address of the requesting end.
2. The domain name resolution method according to claim 1, characterized in that: Also includes: Receive a first response packet returned by the backend server, the first response packet being a data packet obtained by encapsulating the DNS response information by the backend server using the specified protocol, and the IP address and port number of the requesting end being encapsulated in a second specified field of the first response packet; Unpacking the first response packet to obtain the DNS response information; The DNS response information is sent to the requesting end.
3. The domain name resolution method according to claim 2, characterized in that: The decapsulating the first response packet further includes obtaining the IP address and port number of the requesting end in the second designated field of the first response packet; The sending the DNS response information to the requesting end includes: sending the DNS response information according to the IP address and port number of the requesting end.
4. A domain name resolution method, applied to a backend server, characterized in that: include: Receiving a scheduling data packet sent by a DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol; Unpacking the scheduling data packet, obtaining the DNS request information of the requesting end, and obtaining the IP address and port number of the requesting end from the first designated field of the scheduling data packet, the IP address and port number of the requesting end being encapsulated in the first designated field of the scheduling data packet by the DNS load balancer; Generate DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end.
5. The domain name resolution method according to claim 4, characterized in that: The generating of DNS response information based on the DNS request information and the IP address of the requesting end includes: The resolution result related to the domain name is determined according to the domain name corresponding to the DNS request information, and the optimal IP address is selected from the resolution result as the target domain name IP address for response according to the area corresponding to the IP address of the requesting end.
6. The domain name resolution method according to claim 4 or 5, characterized in that: Also includes: The DNS response information is encapsulated into a first response packet and sent to the DNS load balancer, or the DNS response information is encapsulated into a second response packet and the second response packet is sent to the requesting end based on the IP address and port number of the requesting end.
7. The domain name resolution method according to claim 6, characterized in that: The encapsulating the DNS response information into a first response packet comprises: The DNS response information is encapsulated using the specified protocol to form the first response packet, and the IP address and port number of the requesting end are encapsulated in a second specified field of the first response packet.
8. A domain name resolution device, applied to a DNS load balancer, characterized in that: include: A first receiving module is used to receive DNS request information from a requesting end, and obtain an IP address and a port number of the requesting end; A first encapsulation module, used to encapsulate the DNS request information into a scheduling data packet using a specified protocol, and encapsulate the IP address and port number of the requesting end in a first specified field of the scheduling data packet; A scheduling module is used to send the scheduling data packet to the back-end server so that the back-end server unpacks the scheduling data packet, obtains the DNS request information, and obtains the IP address and port number of the requesting end from the first designated field of the scheduling data packet. The back-end server generates DNS response information based on the DNS request information, or the back-end server generates DNS response information based on the DNS request information and the IP address of the requesting end.
9. The domain name resolution device according to claim 8, characterized in that: Also includes: A response packet receiving module, used to receive a first response packet returned by the back-end server, wherein the first response packet is a data packet obtained by encapsulating the DNS response information by the back-end server using the specified protocol, and the IP address and port number of the requesting end are encapsulated in a second specified field of the first response packet; A first decapsulation module, used to decapsulate the first response packet and obtain the DNS response information; A sending module is used to send the DNS response information to the requesting end.
10. A domain name resolution device, applied to a backend server, characterized in that: include: A scheduling result receiving module, used to receive a scheduling data packet sent by a DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol; A second decapsulation module, configured to decapsulate the scheduling data packet, obtain the DNS request information of the requesting end, and obtain the IP address and port number of the requesting end from the first designated field of the scheduling data packet, wherein the IP address and port number of the requesting end are encapsulated in the first designated field of the scheduling data packet by the DNS load balancer; A response module is used to generate DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end.
11. The domain name resolution device according to claim 10, characterized in that: The response module is also used to: The DNS response information is encapsulated into a first response packet and sent to the DNS load balancer, or the DNS response information is encapsulated into a second response packet and the second response packet is sent to the requesting end based on the IP address and port number of the requesting end.
12. A domain name resolution system, characterized in that: Including DNS load balancer and backend server; The DNS load balancer is used to receive the DNS request information of the request end, obtain the IP address and port number of the request end; use the specified protocol to encapsulate the DNS request information into a scheduling data packet, and encapsulate the IP address and port number of the request end in the first specified field of the scheduling data packet; send the scheduling data packet to the back-end server; receive the first response packet returned by the back-end server, the first response packet is a data packet after the back-end server encapsulates the DNS response information using the specified protocol, and the IP address and port number of the request end are encapsulated in the second specified field of the first response packet; unpack the response packet to obtain the DNS response information; send the DNS response information to the request end; The back-end server is used to receive a scheduling data packet sent by the DNS load balancer, wherein the scheduling data packet is a data packet obtained by encapsulating the DNS request information of the requesting end received by the DNS load balancer using a specified protocol; decapsulate the scheduling data packet, obtain the DNS request information of the requesting end, and obtain the IP address and port number of the requesting end from the first specified field of the scheduling data packet; Generate DNS response information based on the DNS request information, or based on the DNS request information and the IP address of the requesting end; The DNS response information is encapsulated into a first response packet and sent to the DNS load balancer, or the DNS response information is encapsulated into a second response packet and the second response packet is sent to the requesting end based on the IP address and port number of the requesting end.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the steps of the method according to any one of claims 1 to 7 are implemented.
14. A computer device comprising a processor, a memory and a computer program stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
DNS (Domain Name System) transparent proxy method and device
CN108040134A
Domain name resolution method, apparatus and device, and computer storage medium
CN109391703A