Dual-stack selection method for DNS (Domain Name Server) area transmission and related device

By prioritizing servers with IPv6 addresses in DNS zone transfers for zone data synchronization, the problem of servers being unable to select IPv6 addresses in a dual-stack environment is solved, thereby accelerating traffic migration and improving synchronization efficiency.

CN121967541APending Publication Date: 2026-05-01CHINA INTERNET NETWORK INFORMATION CENTER
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA INTERNET NETWORK INFORMATION CENTER
Filing Date
2026-02-05
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In a dual-stack environment, the slave server cannot prioritize the authoritative server with the IPv6 address for DNS zone data synchronization, resulting in limited traffic migration speed.

Method used

By sending SOA query requests to multiple servers, and if all responses are IPv4 addresses after the first waiting period, the system continues to wait for a second period to increase the probability of responses from IPv6 addresses. Then, based on the sequence number and response time, the system prioritizes IPv6 addresses for regional data synchronization.

Benefits of technology

It accelerates the migration of traffic to the IPv6 network, improves the efficiency of regional data synchronization, and enables IPv6 priority without modifying the existing DNS resolution software configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967541A_ABST
    Figure CN121967541A_ABST
Patent Text Reader

Abstract

The invention discloses a dual-stack selection method for DNS (domain name system) area transmission and a related device, a first server respectively sends query requests of authorization start records SOA to a plurality of servers providing area data for the first server, P pieces of response information are obtained after waiting for a first time length, if IP addresses corresponding to the P pieces of response information are IPv4 addresses, the first server sends the query requests to the plurality of servers, and if the IP addresses corresponding to the P pieces of response information are IPv4 addresses, the first server sends the query requests to the plurality of servers; if yes, continuing to wait for a second time length to obtain Q pieces of response information, improving the probability of receiving the response information of the IPv6 address, then preferentially sorting the P pieces of response information and M IP addresses with the same serial number in the Q pieces of response information according to the IPv6 address to obtain a sorting result, and finally sending an area transmission XFR request according to the sorting result, therefore, the first server can preferentially select the server with the IPv6 address to carry out regional data synchronization, and the migration of traffic to an IPv6 network is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

A dual-stack selection method and related apparatus for DNS zone transfer Technical Field

[0001] This application relates to the field of DNS zone transfer technology, specifically to a dual-stack selection method and related apparatus for DNS zone transfer. Background Technology

[0002] The Domain Name System (DNS) provides fundamental services for the operation of the Internet. Within a given area, DNS is typically deployed in a distributed master-slave architecture to achieve high availability and load balancing. This architecture uses the DNS zone transfer mechanism to synchronize data between master and slave servers. In scenarios where distributed management is achieved through multiple levels of authoritative servers, slave servers can obtain zone data from one of the multiple authoritative servers, allowing them to synchronize zone data from other authoritative servers even if one authoritative server becomes unreachable.

[0003] In related technologies, in the aforementioned one-slave-multiple-master scenario, the method for a slave server to select the Internet Protocol (IP) address of an authoritative server for regional data synchronization is as follows: First, when the authoritative server updates the data, it sends a zone change notification to the slave server, and the slave server directly initiates a Full Zone Transfer (AXFR) request or an Incremental Zone Transfer (IXFR) request to the authoritative server. Second, when the refresh update time expires or the administrator manually triggers the update, the slave server polls the IP addresses of multiple configured authoritative servers in a round-robin fashion and initiates an AXFR / IXFR request to the first reachable authoritative server to synchronize the regional data.

[0004] However, in a dual-stack environment, the above method prevents the slave server from prioritizing the authoritative server with the IPv6 address to synchronize regional data. Summary of the Invention

[0005] In view of this, this application provides a dual-stack selection method for DNS zone transfer. When the IP addresses of multiple servers returning SOA response information to the first server within the first time period are IPv4 addresses, the system continues to wait for a second time period to increase the probability of receiving response information with IPv6 addresses. Then, the server that has undergone zone change is determined by the sequence number, thereby allowing the first server to preferentially select the server with the IPv6 address for zone data synchronization, thus accelerating the migration of traffic to IPv6.

[0006] To address the aforementioned problems, this application provides the following technical solution: Firstly, this application provides a dual-stack selection method for DNS zone transfer, the method comprising: a first server sending query requests for Authorisation Start Records (SOA) to multiple servers respectively, the multiple servers providing zone data to the first server; the first server waiting for a first duration, receiving P response messages, where P is a positive integer; if the P IP addresses corresponding to the P response messages are all IPv4 addresses, the first server continues to wait for a second duration, receiving Q response messages within the second duration, where Q is a positive integer; the first server determines the P response messages and the Q response messages... In the response information, there are N Internet Protocol (IP) addresses corresponding to N response messages with sequence numbers greater than the sequence number in the query request. The sequence number is used to identify the version of the region data, and N is a positive integer less than or equal to P. If the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted according to IPv6 address priority to obtain a sorting result, where M is a positive integer less than or equal to N. The first server sends a Region Transfer (XFR) request to the server corresponding to the N IP addresses according to the sorting result until the first server successfully sends the XFR request to one of the servers.

[0007] As one possible implementation, if the N IP addresses include M IP addresses with the same sequence number, sorting the M IP addresses according to IPv6 address priority to obtain the sorting result includes: the first server sorting the N IP addresses in descending order of sequence number; if the N IP addresses include M IP addresses with the same sequence number, sorting the M IP addresses according to IPv6 address priority to obtain the sorting result.

[0008] As one possible implementation, the method further includes: the first server determining the response time corresponding to each of the P response messages and the Q response messages, wherein the response time refers to the time from when the first server sends the query request to the server to when the first server receives the response message from the server; if the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted according to IPv6 address priority to obtain a sorting result, including: if the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted according to IPv6 address priority; if the M IP addresses include multiple IPv6 addresses, the multiple IPv6 addresses are sorted according to the response time in ascending order to obtain a sorting result.

[0009] As one possible implementation, the first server sending query requests for the Authorization Start Record (SOA) to multiple servers includes: if preset conditions are met, the first server sends query requests for the SOA to multiple servers respectively, the preset conditions including one or more of conditions 1, 2, 3, and 4; condition 1 is that the SOA's Refresh timer in the first server expires; condition 2 is that the first server responds to a manual zone update operation triggered by an administrator; condition 3 is that a second server sends a zone change notification to the first server via an IPv6 address, the first server sends the SOA query request to the second server, and the first server does not receive the response information from the second server, where the second server is one of the multiple servers; condition 4 is that a third server sends the zone change notification to the first server via an IPv4 address, where the third server is one of the multiple servers.

[0010] As one possible implementation, during the process of the first server sorting the N IP addresses, the method further includes: if the M IP addresses do not include IPv6 addresses, sorting the M IP addresses in ascending order of response time.

[0011] On another front, this application provides a dual-stack selection device for DNS zone transfer, the device comprising: a sending unit, configured to send query requests for Authorisation Start Records (SOA) to multiple servers respectively, wherein the multiple servers provide zone data to the first server; a receiving unit, configured to allow the first server to wait for a first duration and obtain P response messages, where P is a positive integer; the receiving unit is further configured to, if the P IP addresses corresponding to the P response messages are all IPv4 addresses, allow the first server to continue waiting for a second duration and obtain Q response messages within the second duration, where Q is a positive integer; and a determining unit, configured to allow the first server to determine the P response messages and the Q response messages. The information includes N Internet Protocol (IP) addresses corresponding to N response messages with sequence numbers greater than the sequence number in the query request. The sequence number is used to identify the version of the region data, and N is a positive integer less than or equal to P. A sorting unit is used to sort the M IP addresses according to IPv6 address priority if the N IP addresses include M IP addresses with the same sequence number, obtaining a sorting result where M is a positive integer less than or equal to N. A synchronization unit is used for the first server to send a Region Transfer (XFR) request to the servers corresponding to the N IP addresses according to the sorting result, until the first server successfully sends the XFR request to one of the servers.

[0012] As one possible implementation, the sorting unit is further configured to: sort the N IP addresses in descending order of sequence number; if the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses in order of IPv6 address priority to obtain a sorting result.

[0013] As one possible implementation, the determining unit is further configured to: the first server determine the response time corresponding to each of the P response messages and the Q response messages, wherein the response time refers to the time from when the first server sends the query request to the server to when the first server receives the response message from the server; the sorting unit is configured to: if the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses according to the priority of IPv6 addresses; if the M IP addresses include multiple IPv6 addresses, sort the multiple IPv6 addresses according to the order of the response time from smallest to largest, to obtain a sorting result.

[0014] As one possible implementation, the sending unit is configured to: if a preset condition is met, the first server sends a query request for the Authorization Start Record (SOA) to multiple servers respectively, wherein the preset condition includes one or more of condition 1, condition 2, condition 3, and condition 4; condition 1 is that the SOA's Refresh timer in the first server expires; condition 2 is that the first server responds to a manual zone update operation triggered by an administrator; condition 3 is that a second server sends a zone change notification to the first server via an IPv6 address, the first server sends the SOA query request to the second server, and the first server does not receive the response information from the second server, wherein the second server is one of the multiple servers; condition 4 is that a third server sends the zone change notification to the first server via an IPv4 address, wherein the third server is one of the multiple servers.

[0015] As one possible implementation, the sorting unit is further configured to: during the process of the first server sorting the N IP addresses, if the M IP addresses do not include IPv6 addresses, sort the M IP addresses in ascending order of response time.

[0016] In another aspect, this application provides a computer device, the computer device including a processor and a memory: the memory is used to store a computer program; the processor is used to execute the method described in any of the above-mentioned methods according to the computer program.

[0017] In another aspect, this application provides a computer-readable storage medium for storing a computer program that, when executed by a computer device, implements the method described in any of the above-mentioned embodiments.

[0018] In another aspect, this application provides a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform any of the methods described above.

[0019] As can be seen from the above technical solution, in this solution, the first server sends query requests for the Start of Authorization Record (SOA) to multiple servers that provide area data to the first server. After waiting for a first duration, P response messages are obtained. If the P IP addresses corresponding to the P response messages are all IPv4 addresses, the server continues to wait for a second duration, during which Q response messages are obtained, increasing the probability of receiving response messages with IPv6 addresses. Then, from the P and Q response messages, the N IP addresses corresponding to the N response messages with sequence numbers greater than the sequence number in the query request are determined. The sequence number is used to identify the version of the area data, that is, the N servers with updated area data can be determined by the sequence number. Then, the N IP addresses are sorted. If the sequence numbers of the M IP addresses are the same, the IPv6 address is ranked first, and the sorting result is obtained. Finally, according to the sorting result, an Area Transfer (XFR) request is sent to the server corresponding to the N IP addresses until an XFR request is successfully sent to one of the servers. Based on the sorting result, the first server can prioritize the server with the IPv6 address for area data synchronization, thereby accelerating the migration of traffic to the IPv6 network. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 is a flowchart illustrating a dual-stack selection method for DNS zone transmission provided in an embodiment of this application; Figure 2 is a structural diagram illustrating a dual-stack selection device for DNS zone transmission provided in an embodiment of this application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0023] As described in the background section, in a multi-level distributed architecture, a slave server can synchronize regional data from multiple authoritative servers. However, in a dual-stack environment, the slave server can only synchronize regional data from the authoritative server that issued the regional change notification, or poll the IP addresses of multiple authoritative servers according to the configuration and synchronize regional data from the first reachable authoritative server. However, it cannot prioritize the authoritative server with the IPv6 address from multiple authoritative servers for regional data synchronization.

[0024] To address the aforementioned issues, this application provides a dual-stack selection method for DNS zone transfer. A first server sends query requests for the Authorisation Start of Account (SOA) record to multiple servers providing zone data to the first server. After waiting for a first duration, P response messages are received. If all P IP addresses corresponding to the P response messages are IPv4 addresses, the process continues for a second duration, during which Q response messages are received, increasing the probability of receiving IPv6 address response messages. Then, from the P and Q response messages, N response messages with sequence numbers greater than the sequence number in the query request are selected. The system uses N corresponding IP addresses, where the sequence number identifies the version of the region data. The sequence number determines which N servers have updated region data. These N IP addresses are then sorted. If M IP addresses have the same sequence number, the IPv6 address is prioritized. Based on this sorting, XFR requests are sent to the servers corresponding to the N IP addresses until an XFR request is successfully sent to one of them. This sorting allows the first server to prioritize the IPv6 address for region data synchronization, thus accelerating traffic migration to the IPv6 network.

[0025] The solutions provided in this application relate to the field of DNS zone transfer technology, and are specifically illustrated through the following embodiments.

[0026] Referring to Figure 1, which is a flowchart of a dual-stack selection method for DNS zone transmission provided in an embodiment of this application, including S101-S106.

[0027] S101: The first server sends query requests for the Authorization Start Record (SOA) to multiple servers respectively.

[0028] The first server is one of the servers in the distributed architecture. In this distributed architecture, the configuration information of the first server includes the IP addresses of multiple servers, which provide regional data to the first server.

[0029] When the regional data in multiple servers is updated, the first server needs to synchronize the regional data from the multiple servers. Specifically, the first server sends a query request for the Authorization Start Record (SOA) to each of the multiple servers to determine whether the regional data has been updated in the multiple servers.

[0030] As one possible implementation, S101 includes: if a preset condition is met, the first server sends a query request for the Authorization Start Record (SOA) to multiple servers respectively.

[0031] The preset conditions include one or more of conditions 1, 2, 3, and 4; condition 1 is that the SOA Refresh timer in the first server expires; condition 2 is that the first server responds to the administrator's manual triggering of the zone update; condition 3 is that the second server sends a zone change notification to the first server via an IPv6 address, the first server sends an SOA query request to the second server, and the first server does not receive a response from the second server, where the second server is one of multiple servers; condition 4 is that the third server sends a zone change notification to the first server via an IPv4 address, where the third server is one of multiple servers.

[0032] The Refresh timer is a timer used to set the interval for sending SOA query requests. When the SOA Refresh timer expires on the first server, query requests are sent to multiple servers to actively check whether the regional data has been updated.

[0033] When an administrator manually triggers a zone update operation, the first server responds to the zone update operation by sending SOA query requests to multiple servers.

[0034] When a second server sends a zone change notification, such as a Notify message, to the first server via an IPv6 address, it indicates that the zone data on the second server has been updated. The first server then directly sends an SOA query request to the second server. If the first server does not receive a response from the second server, it may indicate a network failure or other situation that prevents it from synchronizing zone data from the second server. In this case, the first server sends query requests to multiple servers (including the second server) to successfully synchronize zone data from other servers.

[0035] When a third server sends a zone change notification to the first server via an IPv4 address, it sends query requests to multiple servers to synchronize zone data based on the sorting results of the multiple servers, thus accelerating the shift of traffic to IPv6.

[0036] Therefore, it is not necessary to send query requests to multiple servers in every situation.

[0037] S102: The first server waits for the first duration and receives P response messages.

[0038] Where P is a positive integer.

[0039] The first duration is a pre-set waiting time, which is not specifically limited in this embodiment of the application, for example, 30ms.

[0040] Response information refers to the response information to SOA query requests, which is used to determine the number of version updates for regional data.

[0041] When the first server sends SOA query requests to multiple servers, some of these servers may fail to return response information to the first server due to network issues, or may require a long time to return response information. In order to improve the efficiency of regional data synchronization, this application embodiment sets a first time period and obtains P response information in the first market, so as to realize the synchronization of regional data in the first server according to the P servers corresponding to the P response information obtained within the first time period.

[0042] S103: If all P IP addresses corresponding to the P response messages are IPv4 addresses, the first server continues to wait for a second duration, during which it receives Q response messages.

[0043] Where Q is a positive integer. The second duration is a preset duration, which is not specifically limited in this embodiment of the application, for example, it is 50ms, etc.

[0044] If the IP addresses corresponding to the P response messages obtained within the first time period are IPv4 addresses, then continue to wait for the second time period. Within the second time period, Q response messages are obtained. These Q response messages may include response messages corresponding to IPv6 addresses.

[0045] Therefore, if no response is received from the server with the IPv6 address within the first time period, the system continues to wait for a second time period in order to successfully establish a network connection with the server with the IPv6 address. This increases the probability of traffic migrating to IPv6 by sacrificing efficiency.

[0046] S104: The first server determines the N Internet Protocol IP addresses corresponding to the N response messages whose sequence numbers are greater than the sequence number in the query request from among the P response messages and Q response messages.

[0047] The serial number is used to identify the version of the regional data. For example, a larger serial number indicates more updates, which means that the regional data has been updated.

[0048] N is a positive integer less than or equal to P. The regional data in the P servers may be the same as the regional data in the first server, so there is no need to synchronize the regional data from that server.

[0049] By analyzing the sequence number in each of the P and Q response messages, we can identify N response messages whose sequence numbers are greater than the sequence number in the query request, and determine the IP address of the server corresponding to each of the N response messages.

[0050] S105: If there are M IP addresses with the same sequence number among the N IP addresses, sort the M IP addresses according to the priority of IPv6 addresses to obtain the sorting result.

[0051] Where M is a positive integer less than or equal to N. The sorting result refers to the result after sorting the N IP addresses.

[0052] For example, when there are M IP addresses with the same sequence number among N IP addresses, the IPv6 addresses are ranked first and the IPv4 addresses are ranked last, resulting in one set of sorting results. If there are multiple other sets of IP addresses with the same sequence number, they are also sorted according to the IPv6 priority order within each set of IP addresses, resulting in multiple sets of sorting results. Then, the multiple sets of sorting results with different sequence numbers are arranged in ascending or descending order of sequence number to obtain the final sorting result.

[0053] Therefore, by sorting the M servers with the same version of regional data in order of IPv6 priority, the IP addresses at the top of the list are IPv6 addresses, and the server corresponding to the IP address at the top of the list is selected for regional data synchronization, thus achieving IPv6 priority.

[0054] As one possible implementation, S106 includes: the first server sorts the N IP addresses in descending order of their sequence numbers; if the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted in order of IPv6 address priority to obtain the sorting result.

[0055] In a multi-tiered distributed architecture, to ensure the first server has the latest regional data, it needs to synchronize different versions of regional data from multiple servers one by one to retain the latest version. To improve synchronization efficiency, the first server only needs to synchronize the latest regional data from the servers that already have the latest version of the regional data.

[0056] Therefore, in this embodiment of the application, the IP addresses are sorted in descending order of serial number so that the servers corresponding to the top-ranked IP addresses have updated regional data. This allows the servers corresponding to the top-ranked IP addresses to be selected for regional data synchronization, which can effectively improve synchronization efficiency.

[0057] S106: The first server sends XFR requests to the servers corresponding to the N IP addresses according to the sorting results, until the first server successfully sends an XFR request to one of the servers.

[0058] The regional transmission XFR request can be either an AXFR or an IXFR request, and this application embodiment does not impose specific restrictions on it.

[0059] Specifically, following the sorting results from front to back, XFR requests are sent sequentially to the servers corresponding to the N IP addresses. If an XFR request is successfully sent to the first server, it means that regional data synchronization can be performed from the first server, and the first server synchronizes the regional data from the first server, and the process is complete. If it fails, XFR requests are sent to the second server, and so on, until an XFR request is successfully sent to one of the servers.

[0060] Therefore, in the technical solution provided by this application embodiment, the first server sends query requests for the Start of Authorization Record (SOA) to multiple servers that provide regional data to the first server. After waiting for a first duration, P response messages are obtained. When the P IP addresses corresponding to the P response messages are all IPv4 addresses, the server continues to wait for a second duration, during which Q response messages are obtained, increasing the probability of receiving response messages with IPv6 addresses. Then, from the P and Q response messages, the N IP addresses corresponding to the N response messages with sequence numbers greater than the sequence number in the query request are determined. The sequence number is used to identify the version of the regional data, that is, the N servers with updated regional data can be determined by the sequence number. Then, the N IP addresses are sorted. If the sequence numbers of the M IP addresses are the same, the IPv6 address is ranked first, and the sorting result is obtained. Finally, according to the sorting result, a Regional Transfer (XFR) request is sent to the server corresponding to the N IP addresses until an XFR request is successfully sent to one of the servers. Based on the sorting result, the first server can prioritize the server with the IPv6 address for regional data synchronization, thereby accelerating the migration of traffic to the IPv6 network.

[0061] As one possible implementation, the method further includes: a first server determining the response time corresponding to each of the P response messages and Q response messages.

[0062] The response time refers to the time from when the first server sends a query request to the server to when the first server receives the server's response information.

[0063] The first server starts timing independently from the moment it sends a query request to each of the multiple servers, and obtains the response time corresponding to the multiple response messages obtained within the first time period and the second time period.

[0064] S106 can be executed through the following steps: If the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses according to the priority of IPv6 addresses; if the M IP addresses include multiple IPv6 addresses, sort the multiple IPv6 addresses according to the order of response time from smallest to largest, and obtain the sorting result.

[0065] For example, the IP addresses are sorted in descending order of sequence number so that the servers corresponding to the top IP addresses have updated region data. If the N IP addresses include M IP addresses with the same sequence number, the type of the M IP addresses is determined to be IPv4 or IPv6. Then, the M IP addresses are sorted in order of priority for IPv6 addresses. If the M IP addresses include multiple IPv6 addresses, the multiple IPv6 addresses are further sorted in order of ascending response time to obtain the sorting result.

[0066] Therefore, based on the principle of prioritizing IPv6 when sequence numbers are the same, a response time is introduced. Multiple IP addresses with the same sequence number and IPv6 address are further sorted according to the response time from smallest to largest. This allows the first server to further improve synchronization efficiency, based on the priority of selecting the server with the IPv6 address for regional data synchronization.

[0067] As one possible implementation, during the process of the first server sorting the N IP addresses, the method further includes: if the M IP addresses do not include IPv6 addresses, sorting the M IP addresses in ascending order of response time.

[0068] When M IP addresses with the same sequence number are all IPv4 addresses, sort the M IP addresses in ascending order of response time.

[0069] Therefore, when synchronizing regional data from M servers with the same sequence number, if IPv6 priority cannot be guaranteed, synchronization efficiency should be prioritized.

[0070] To more clearly describe this dual-stack selection method for DNS zone transfer, the following steps of the dual-stack selection method for DNS zone transfer are illustrated: Step 1: The secondary server (first server) configures the primary server (multiple servers) and its IP addresses, including IPv4 and IPv6 addresses.

[0071] Step 2: When the secondary server receives the Notify message from the primary server, it initiates an SOA query request for that zone to the primary server: Step 2.1: If the Notify message comes from the IPv6 address of the primary server, then the SOA query request is sent directly to that IPv6 address.

[0072] Step 2.1.1: If an SOA response is received, check its sequence number. If it is greater than the current sequence number of the secondary server in that zone, initiate an XFR request to that IPv6 address; if it is less than or equal to the current sequence number of the secondary server in that zone, terminate the process. Step 2.1.2: If no SOA response is received, proceed to Step 4 for processing. Step 2.2: If the Notify message comes from an IPv4 address, proceed to Step 4 for processing. Step 3: When the Refresh update cycle is reached or an update is manually triggered by the administrator, proceed to Step 4 for processing. Step 4: Simultaneously initiate SOA query requests for that zone to all configured primary server IP addresses. This request is asynchronous. When an SOA response is received, record the RTT (Round Trip Time) of the primary server IP address. Step 4.1: After sending the request, without waiting for all responses, after a set waiting period, analyze the received responses and sort them according to Step 5. Step 4.2: Prioritize IPv6 addresses. 6. If only an IPv4 address response is received during the waiting period, continue waiting for a grace period; if one or more IPv6 addresses are received during the waiting period, regardless of whether an IPv4 address response is received, immediately execute step 5 after the waiting period ends; Step 5: Sort the primary server addresses: Step 5.1: Analyze the sequence number in the SOA response packet, add IP addresses with sequence numbers greater than the secondary server sequence number to the candidate address list, and sort them in descending order of sequence number; Step 5.2: For addresses with the same sequence number, prioritize IPv6 addresses; Step 5.3: If multiple addresses are all IPv6 addresses, further sort them in ascending order of RTT; Step 6: Request XFR for the primary server addresses according to the above sorting: Step 6.1: If the XFR request is successful, the process ends; Step 6.2: If an XFR request fails, continue trying the next address in sequence until success or the list polling ends.

[0073] Based on the above steps, the following is an exemplary description of a specific implementation scenario, including steps S1-S6.

[0074] S1, the secondary server is configured with multiple primary server addresses, including 1.1.1.1, 2.2.2.2, 1::1, and 2::2.

[0075] S2, the secondary server receives a Notify message from the primary server's cn zone 1.1.1.1.

[0076] S3 and the secondary server simultaneously send SOA requests for the cn zone to 1.1.1.1, 2.2.2.2, 1::1, and 2::2.

[0077] S4, the secondary server only receives SOA responses for 1.1.1.1 and 2.2.2.2 within a 60ms waiting period (first duration). It continues to wait for a 50ms grace period (second duration) and receives SOA responses for 1::1 and 2::2. It also records the RTT of each primary server. The RTTs for 1.1.1.1, 2.2.2.2, 1::1, and 2::2 are 15ms, 50ms, 90ms, and 70ms, respectively, and the corresponding IP address types are IPv4, IPv4, IPv6, and IPv6, respectively.

[0078] S5. Sort the IP addresses of the primary server. The SOA of the secondary server's cn zone is 100. Analyzing the response messages of 1.1.1.1, 2.2.2.2, 1::1, and 2::2, the SOA sequence numbers are 101, 100, 101, and 101, respectively. Sort them according to factors such as descending SOA sequence number, IPv6 address priority, and RTT from smallest to largest. The sorted result is: 2::2, 1::1, 1.1.1.1.

[0079] S6. Send an XFR request to 2::2 according to the above sorting result. If the request fails, send an XFR request to 1::1. If the regional data transmission is successful, the process ends.

[0080] Therefore, this dual-stack selection method for DNS zone transmission can prioritize IPv6 addresses to accelerate traffic migration to IPv6, while avoiding zone transmission delays caused by IPv6 link failures. It balances efficiency and IPv6 priority, and the technical solution of this application does not require modification of the original resolution software configuration, thus having good backward compatibility.

[0081] Based on the above embodiments, this application provides a dual-stack selection device for DNS zone transfer. Referring to Figure 2, which is a schematic diagram of the structure of a dual-stack selection device for DNS zone transfer provided in this application, the device 200 includes: a sending unit 201, used by a first server to send query requests for Authorisation Start Records (SOA) to multiple servers respectively, wherein the multiple servers provide zone data to the first server; a receiving unit 202, used by the first server to wait for a first duration and obtain P response messages, where P is a positive integer; the receiving unit 202 is further used to, if the P IP addresses corresponding to the P response messages are all IPv4 addresses, the first server continues to wait for a second duration and obtains Q response messages within the second duration, where Q is a positive integer; and a determining unit 203. The system is configured to: 1) determine, from the P response messages and Q response messages, N response messages whose sequence numbers are greater than the sequence number in the query request, corresponding to N Internet Protocol (IP) addresses, where the sequence number identifies the version of the region data, and N is a positive integer less than or equal to P; 2) sorting unit 204, if the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses according to IPv6 address priority, and obtain a sorting result, where M is a positive integer less than or equal to N; 3) synchronization unit 205, whereby the first server sends a Region Transfer (XFR) request to the servers corresponding to the N IP addresses according to the sorting result, until the first server successfully sends the XFR request to one of the servers.

[0082] As one possible implementation, the sorting unit is further configured to: sort the N IP addresses in descending order of sequence number; if the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses in order of IPv6 address priority to obtain a sorting result.

[0083] As one possible implementation, the determining unit is further configured to: the first server determine the response time corresponding to each of the P response messages and the Q response messages, wherein the response time refers to the time from when the first server sends the query request to the server to when the first server receives the response message from the server; the sorting unit is configured to: if the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses according to the priority of IPv6 addresses; if the M IP addresses include multiple IPv6 addresses, sort the multiple IPv6 addresses according to the order of the response time from smallest to largest, to obtain a sorting result.

[0084] As one possible implementation, the sending unit is configured to: if a preset condition is met, the first server sends a query request for the Authorization Start Record (SOA) to multiple servers respectively, wherein the preset condition includes one or more of condition 1, condition 2, condition 3, and condition 4; condition 1 is that the SOA's Refresh timer in the first server expires; condition 2 is that the first server responds to a manual zone update operation triggered by an administrator; condition 3 is that a second server sends a zone change notification to the first server via an IPv6 address, the first server sends the SOA query request to the second server, and the first server does not receive the response information from the second server, wherein the second server is one of the multiple servers; condition 4 is that a third server sends the zone change notification to the first server via an IPv4 address, wherein the third server is one of the multiple servers.

[0085] As one possible implementation, the sorting unit is further configured to: during the process of the first server sorting the N IP addresses, if the M IP addresses do not include IPv6 addresses, sort the M IP addresses in ascending order of response time.

[0086] Based on the above embodiments, this application provides a computer device, which includes a processor and a memory: the memory is used to store a computer program; the processor is used to execute the dual-stack selection method for DNS zone transfer according to the computer program.

[0087] Based on the above embodiments, this application provides a computer-readable storage medium for storing a computer program that, when executed by a computer device, implements the dual-stack selection method for DNS zone transfer described above.

[0088] Based on the above embodiments, this application provides a computer program product including a computer program, which, when run on a computer device, causes the computer device to execute the dual-stack selection method for DNS zone transfer.

[0089] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.

[0090] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A dual-stack selection method for DNS zone transfer, characterized in that, The method includes: a first server sending a query request for an Authorized Start of Account (SOA) record to multiple servers, wherein the multiple servers provide region data to the first server; the first server waiting for a first duration and receiving P response messages, where P is a positive integer; if the P IP addresses corresponding to the P response messages are all IPv4 addresses, the first server continues to wait for a second duration and receives Q response messages within the second duration, where Q is a positive integer; the first server determines N Internet Protocol (IP) addresses corresponding to N response messages among the P and Q response messages, where the sequence number is greater than the sequence number in the query request, the sequence number being used to identify the version of the region data, and N being a positive integer less than or equal to P; if the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted according to IPv6 address priority to obtain a sorting result, where M is a positive integer less than or equal to N; the first server, according to the sorting result, sends a Region Transfer (XFR) request to the servers corresponding to the N IP addresses until the first server successfully sends the XFR request to one of the servers.

2. The method according to claim 1, characterized in that, If the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted according to IPv6 address priority to obtain the sorting result. This includes: the first server sorts the N IP addresses in descending order of sequence number; if the N IP addresses include M IP addresses with the same sequence number, the M IP addresses are sorted according to IPv6 address priority to obtain the sorting result.

3. The method according to claim 1, characterized in that, The method further includes: the first server determining the response time corresponding to each of the P response messages and the Q response messages, wherein the response time refers to the time from when the first server sends the query request to the server to when the first server receives the response message from the server; the step of sorting the M IP addresses according to IPv6 address priority if the N IP addresses include M IP addresses with the same sequence number, and sorting the M IP addresses according to IPv6 address priority if the M IP addresses include multiple IPv6 addresses, and sorting the multiple IPv6 addresses according to the response time in ascending order, to obtain a sorting result.

4. The method according to claim 1, characterized in that, The first server sends query requests for the Authorization Start Record (SOA) to multiple servers respectively, including: if preset conditions are met, the first server sends query requests for the SOA to multiple servers respectively, the preset conditions including one or more of conditions 1, 2, 3, and 4; condition 1 is that the SOA's Refresh timer in the first server expires; condition 2 is that the first server responds to a manual zone update operation triggered by an administrator; condition 3 is that a second server sends a zone change notification to the first server via an IPv6 address, the first server sends the SOA query request to the second server, and the first server does not receive the response information from the second server, where the second server is one of the multiple servers; condition 4 is that a third server sends the zone change notification to the first server via an IPv4 address, where the third server is one of the multiple servers.

5. The method according to claim 3, characterized in that, During the process of the first server sorting the N IP addresses, the method further includes: if the M IP addresses do not include IPv6 addresses, sorting the M IP addresses in ascending order of response time.

6. A dual-stack selection device for DNS zone transfer, characterized in that, The apparatus includes: a sending unit, configured to send a query request for an Authorized Start Record (SOA) to multiple servers respectively, wherein the multiple servers provide region data to the first server; a receiving unit, configured to allow the first server to wait for a first duration and obtain P response messages, where P is a positive integer; the receiving unit is further configured to, if the P IP addresses corresponding to the P response messages are all IPv4 addresses, allow the first server to continue waiting for a second duration and obtain Q response messages within the second duration, where Q is a positive integer; and a determining unit, configured to allow the first server to determine, among the P response messages and the Q response messages, those with a sequence number greater than the query request... The system retrieves N Internet Protocol (IP) addresses corresponding to the N response messages for the sequence number, where the sequence number identifies the version of the region data, and N is a positive integer less than or equal to P. A sorting unit is used to sort the M IP addresses according to IPv6 address priority if the N IP addresses include M IP addresses with the same sequence number, obtaining a sorting result where M is a positive integer less than or equal to N. A synchronization unit is used to send a Region Transfer (XFR) request to the servers corresponding to the N IP addresses according to the sorting result, until the first server successfully sends the XFR request to one of the servers.

7. The apparatus according to claim 6, characterized in that, The determining unit is further configured to: the first server determine the response time corresponding to each of the P response messages and the Q response messages, wherein the response time refers to the time from when the first server sends the query request to the server to when the first server receives the response message from the server; the sorting unit is specifically configured to: if the N IP addresses include M IP addresses with the same sequence number, sort the M IP addresses according to the priority of IPv6 addresses; if the M IP addresses include multiple IPv6 addresses, sort the multiple IPv6 addresses according to the order of the response time from smallest to largest, and obtain a sorting result.

8. A computer device, characterized in that, The computer device includes a processor and a memory: the memory is used to store a computer program; the processor is used to execute the method according to any one of claims 1-5 according to the computer program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when executed by a computer device, performs the method described in any one of claims 1-5.

10. A computer program product comprising a computer program, characterized in that, When it is run on a computer device, it causes the computer device to perform the method described in any one of claims 1-5.