Domain name resolution method, system, electronic device and storage medium
By detecting abnormalities in the resolution capabilities of the primary DNS server and redirecting to the backup DNS server, and using pre-stored configuration data to respond to domain name resolution requests, response problems caused by DNS server abnormalities are solved, response efficiency and user experience are improved, and DNS server reconfiguration is avoided. Complexity and timeliness issues.
Patent Information
- Application Number
- CN202210179854.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-02-25
AI Technical Summary
When the authoritative DNS server is unavailable or has abnormal resolution capabilities, domain name resolution requests cannot respond normally, affecting users' network access. Existing solutions such as reconfiguring DNS servers are less timely, complex, and have low response efficiency.
By detecting abnormalities in the resolution capabilities of the primary DNS server, redirect domain name resolution requests to the backup DNS server, and use the pre-stored primary DNS server configuration data to respond, avoiding DNS server modifications and improving response efficiency and user experience.
It achieves fast and accurate response when the DNS server is abnormal, reduces the response time of domain name resolution requests, improves the user experience, and avoids the complexity and timeliness issues of DNS server modification.
Smart Images

Figure CN114666302B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet communication technology, and in particular to a domain name resolution method, system, electronic device and storage medium. Background Art
[0002] With the continuous advancement of communication technology, the number of scenarios in which users access the Internet and handle business through terminal devices is increasing day by day. When users access the Internet, they rely on DNS (Domain Name System) to resolve the corresponding IP address. DNS is a domain name resolution system that provides a method of domain name IP conversion. Generally, when a user's terminal device (such as a computer, mobile phone, etc.) is surfing the Internet, it performs domain name resolution through DNS, and then performs network access such as business handling or data query according to the specified IP returned by DNS.
[0003] Since the resolution result of the domain name resolution request depends on the domain name resolution result configured on the authoritative DNS server responsible for domain name resolution and the availability of the authoritative DNS server, if the authoritative DNS server is unavailable or the resolution capability is abnormal, it is very likely that the domain name resolution request of the user device cannot be resolved and responded normally, thereby affecting the user's network access. In order to solve this problem, a common method is to modify the configuration of the authoritative DNS server after the authoritative DNS server fails to respond to the domain name resolution request, and authorize the IP address range of the domain name resolution to the reconfigured authoritative DNS server, and re-initiate the domain name resolution request to the reconfigured authoritative DNS server. However, the reconfiguration operation of the authoritative DNS server is complicated and has poor timeliness. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a domain name resolution method, system, electronic device and storage medium, which are intended to promptly and accurately complete the response to DNS domain name resolution requests, minimize the impact of DNS server anomalies on the response speed of domain name resolution requests, and improve user experience.
[0005] To achieve the above-mentioned purpose, an embodiment of the present application provides a domain name resolution method, including: detecting the resolution capability of the primary DNS server based on the domain name resolution requests received by the primary DNS server within a first preset time period; in the case that the resolution capability of the primary DNS server is abnormal, redirecting the received domain name resolution request to a backup DNS server, so that the backup DNS server can obtain and return a response to the domain name resolution request based on pre-stored configuration data; wherein the pre-stored configuration data is backup data of the domain name configuration data in the primary DNS server.
[0006] To achieve the above-mentioned purpose, an embodiment of the present application also proposes a domain name resolution system, including: a detection module, used to detect the resolution capability of the primary DNS server based on the domain name resolution requests received by the primary DNS server within a first preset time period; a response module, used to redirect the received domain name resolution request to a backup DNS server when the resolution capability of the primary DNS server is abnormal, so that the backup DNS server can obtain and return a response to the domain name resolution request based on pre-stored configuration data; wherein the pre-stored configuration data is backup data of the domain name configuration data in the primary DNS server.
[0007] To achieve the above-mentioned purpose, an embodiment of the present application also proposes an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the domain name resolution method as described above.
[0008] To achieve the above objectives, the embodiments of the present application further provide a computer-readable storage medium storing a computer program, which implements the domain name resolution method as described above when executed by a processor.
[0009] The domain name resolution method provided in the embodiment of the present application detects and judges the resolution capability of the primary DNS server by statistically analyzing the domain name resolution requests received by the primary DNS server within the first preset time period, and redirects the received domain name resolution request to the backup DNS server when it is detected that the resolution capability of the primary DNS server is abnormal. The backup DNS server resolves and responds to the domain name resolution request according to the backup data of the domain name configuration data of the primary DNS server stored in advance. By statistically analyzing the domain name resolution requests of the primary DNS server within the first preset time period, the domain name resolution capability of the primary DNS server is accurately detected, so as to avoid the problem that the resolution capability of the primary DNS server is abnormal only after the domain name resolution request response fails, and improve the detection efficiency of the resolution capability abnormality; redirect the domain name resolution request to the backup DNS server, and the backup DNS server completes the resolution and response of the domain name resolution request on behalf of the primary DNS server according to the domain name configuration data of the pre-backed up primary DNS server, and directly uses the signaling and function replacement method to complete the response of the domain name resolution request with the help of the backup DNS server, without the need to reconfigure the DNS server, which greatly improves the response efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] One or more embodiments are exemplarily described by the pictures in the corresponding drawings, and these exemplary descriptions do not constitute limitations on the embodiments.
[0011] Figure 1 is a flowchart of a domain name resolution method in an embodiment of the present application;
[0012] Figure 2 It is a schematic diagram of the domain name resolution process in the embodiment of the present application;
[0013] Figure 3 is a structural diagram of a domain name resolution system in another embodiment of the present application;
[0014] Figure 4 It is a schematic diagram of the structure of an electronic device in another embodiment of the present application. DETAILED DESCRIPTION
[0015] As can be seen from the background technology, in order to ensure the normal resolution and response of domain name resolution requests, the common method is to reconfigure the DNS server after the DNS server fails to respond, resulting in extremely low efficiency in responding to domain name resolution requests. Therefore, how to timely and accurately complete the response to DNS domain name resolution requests and improve user experience is a technical problem that urgently needs to be solved.
[0016] In order to solve the above problems, some embodiments of the present application provide a domain name resolution method, including: detecting the resolution capability of the primary DNS server based on the domain name resolution requests received by the primary DNS server within a first preset time period; in the case that the resolution capability of the primary DNS server is abnormal, redirecting the received domain name resolution request to the backup DNS server, so that the backup DNS server can obtain and return a response to the domain name resolution request based on pre-stored configuration data; wherein the pre-stored configuration data is backup data of the domain name configuration data in the primary DNS server.
[0017] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0018] The implementation details of the domain name resolution method recorded in this application will be specifically described below in conjunction with specific embodiments. The following content is only provided for ease of understanding of the implementation details and is not necessary for implementing this solution.
[0019] The first aspect of the embodiment of the present application provides a domain name resolution method, the process of the domain name resolution method is referenced Figure 1 In some embodiments, the domain name resolution method is applied to a domain name resolution system or a control terminal that can communicate with the domain name resolution system, such as a computer or other electronic device. This embodiment is described by taking the application in the domain name resolution system as an example. The domain name resolution method includes the following steps:
[0020] Step 101: Detect the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within a first preset time period.
[0021] Specifically, after the domain name resolution system is deployed, it monitors the domain name resolution capabilities of each primary DNS server that is online. For each primary DNS server, based on the domain name resolution requests received by the primary DNS server within a first preset time period, the resolution capability of the primary DNS server is analyzed and tested to confirm whether there is any abnormality in the resolution capability of the primary DNS server.
[0022] It should be noted that the specific selection of the first preset time length can be set according to the working parameters of the domain name resolution system or actual needs, and this embodiment does not limit the specific value of the first preset time length.
[0023] In one example, the resolution capability anomaly of the primary DNS server includes one of the following or any combination thereof: resolution service anomaly, domain name configuration data loss, server under attack. Specifically, the primary DNS server may have domain name resolution capability anomaly due to a variety of reasons, such as being unable to respond to domain name resolution requests due to a distributed denial of service attack (DDOS), being unable to perform domain name resolution normally due to loss of domain name configuration data, resulting in response failure, and resolution service anomaly of the primary DNS server itself. Therefore, the domain name resolution system needs to conduct comprehensive monitoring of the common centralized resolution capability anomalies of the primary DNS server, so as to accurately judge the resolution capability of the primary DNS server through detection from multiple angles.
[0024] In another example, when the domain name resolution system has a resolution capability abnormality including a resolution service abnormality, the detection of the resolution capability of the primary DNS server is performed based on the domain name resolution requests received by the primary DNS server within a first preset time period, including: obtaining a first number of domain name resolution requests received by the primary DNS server within the first preset time period, and a second number of domain name resolution requests responded to by the primary DNS server within the first preset time period; obtaining a response ratio of the primary DNS server based on the second number and the first number; and determining that a resolution service abnormality exists in the primary DNS server when the response ratio is less than a first preset threshold.
[0025] Specifically, the domain name resolution system may include a monitoring system, which can be directly installed on the primary DNS server to monitor the domain name resolution capability of the primary DNS server. In the case where the monitored resolution capability anomaly includes a resolution service anomaly, the first number of domain name resolution requests received by the primary DNS server within the first preset time length and the second number of domain name resolution requests successfully responded to by the primary DNS server within the first preset time length are obtained. For example, the number of domain name resolution requests received by the primary DNS server within the previous second at the current moment (request query rate per second) and the number of domain name resolution requests successfully responded to by the primary DNS server (response query rate per second) are obtained. Then, according to the ratio of the response query rate per second to the request query rate per second, the response ratio of the primary DNS server at the current moment within the first preset time length is obtained, and the size relationship between the response ratio of the primary DNS server and the first preset threshold is detected. In the case where the response ratio is not less than the first preset threshold, it is determined that the resolution service of the primary DNS server is normal, and in the case where the response ratio is less than the first preset threshold, it is determined that the resolution service of the primary DNS server is abnormal. By accurately judging whether there is a resolution service anomaly on the primary DNS server based on the response ratio of the primary DNS server to the received domain name resolution requests within the first preset time period, the accuracy of resolution capability anomaly detection is improved.
[0026] It is worth mentioning that the first preset time length for obtaining the response ratio may be 1 second or other time lengths set according to actual needs or detection strictness, and this embodiment does not impose any limitation on this.
[0027] In another example, when the resolution capability abnormality includes resolution service abnormality, the domain name resolution system detects the resolution capability of the primary DNS server based on the domain name resolution requests received by the primary DNS server within a first preset time period, including: obtaining a first response ratio of the primary DNS server within the second preset time period based on a third number of domain name resolution requests received by the primary DNS server within the second preset time period and a fourth number of domain name resolution requests responded to by the primary DNS server within the second preset time period; obtaining a second response ratio of the primary DNS server within the third preset time period based on a fifth number of domain name resolution requests received by the primary DNS server within the third preset time period and a sixth number of domain name resolution requests responded to by the primary DNS server within the third preset time period; wherein the third preset time period is equal to the second preset time period, and the sum of the third preset time period and the second preset time period is less than or equal to the first preset time period; when the difference between the second response ratio and the first response ratio is greater than a sudden drop threshold, it is determined that the primary DNS server has a resolution service abnormality.
[0028] Specifically, after obtaining the domain name resolution requests received by the primary DNS server within the first preset time, the domain name resolution system performs segmented statistics on the domain name resolution requests received and the domain name resolution requests responded within the first preset time, divides the first preset time into a plurality of intervals of equal duration, and respectively uses two of the intervals as the second preset time and the third preset time. For example, the domain name resolution requests received and the domain name resolution requests responded by the primary DNS server within 3 minutes are segmented and counted, and the data within the second minute is used as the data corresponding to the second preset time, and the data within the third minute is used as the data corresponding to the third preset time. Then, according to the third number of domain name resolution requests received by the primary DNS server within the second preset time and the fourth number of domain name resolution requests responded, the ratio of the fourth number to the third number is used as the first response ratio of the primary DNS server within the second preset time; and then, in a similar manner, according to the fifth number of domain name resolution requests received by the primary DNS server within the third preset time and the sixth number of domain name resolution requests responded, the ratio of the sixth number to the fifth number is used as the second response ratio of the primary DNS server within the third preset time. Then, the response ratio deviation between the second response ratio and the first response ratio is obtained, for example, the response ratio deviation is obtained by subtracting the second response ratio from the first response ratio. The relationship between the obtained response ratio deviation and the preset sudden drop threshold is compared. When the response ratio deviation is not greater than the sudden drop threshold, it is determined that the resolution service of the primary DNS server is normal; when the response ratio deviation is greater than the sudden drop threshold, it is determined that the resolution service of the primary DNS server is abnormal. By judging whether the primary DNS server has a resolution service abnormality based on the response ratio deviation of the primary DNS server within a certain period of time, the resolution capability test is performed from the perspective of performance mutation to ensure the accuracy of the test.
[0029] In another example, when the domain name resolution system has resolution capability abnormalities including the server being under attack, the system detects the resolution capability of the primary DNS server based on the domain name resolution requests received by the primary DNS server within a first preset time period, including: obtaining a first number of domain name resolution requests received by the primary DNS server within the first preset time period; and determining that the primary DNS server is under attack when the first number is greater than an attack threshold.
[0030] Specifically, when the domain name resolution system monitors whether the primary DNS server is under DDOS attack, it directly counts the first number of domain name resolution requests received by the primary DNS server within the first preset time period, and compares the relationship between the first number counted and the preset attack threshold. When the first number is not greater than the attack threshold, it is determined that the primary DNS server is not under DDOS attack; when the first number is greater than the attack threshold, it is determined that the primary DNS server is under attack. By counting the number of domain name resolution requests received by the primary DNS server within a certain period of time and comparing it with the attack threshold, it is possible to intuitively and accurately detect whether the primary DNS server is under DDOS attack, thereby improving the efficiency of abnormal detection of resolution capabilities. It is worth mentioning that the attack threshold and the preset time period can be set according to the processing capacity and application scenario of the domain name resolution system. This embodiment does not limit the specific settings of the attack threshold and the preset time period.
[0031] In another example, when the resolution capability is abnormal including configuration data loss, the domain name resolution system detects the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within the first preset time, including: obtaining the seventh number of domain name resolution requests for deleted domain names within the first preset time; when the seventh number is greater than the second preset threshold, determining that the primary DNS server has domain name configuration data loss. Specifically, the domain name resolution system will perform preliminary resolution on the domain name resolution requests received by the primary DNS server, and count the seventh number of domain name resolution requests for deleted domain names received by the primary DNS server. Then, the size relationship between the seventh number and the second preset threshold is compared, and when the seventh number is not greater than the second preset threshold, it is determined that the configuration data of the primary DNS server is normal; when the seventh number is greater than the second preset threshold, it is determined that the domain name configuration data of the deleted domain name is lost, and the primary DNS server has domain name configuration data loss. By counting the number of domain name resolution requests for deleted domain names received by the primary DNS server within a certain period of time, and judging whether the primary DNS server has domain name configuration data loss in combination with the second preset threshold, the domain name configuration data loss problem of the primary DNS server is accurately identified. It is worth mentioning that the second preset threshold can be set according to parameters such as the working scenario and processing performance of the domain name resolution system. This embodiment does not limit the specific setting of the second preset threshold.
[0032] Step 102, when the resolution capability of the primary DNS server is abnormal, the received domain name resolution request is redirected to the backup DNS server, so that the backup DNS server can obtain and return a response to the domain name resolution request according to pre-stored configuration data.
[0033] Specifically, when the domain name resolution system detects that the primary DNS server has an abnormality in its resolution capability, it performs signaling encoding on the received domain name resolution request and redirects the domain name resolution request to the backup DNS server, for the backup DNS server to resolve the domain name resolution request according to pre-stored configuration data, and obtain and return a response to the domain name resolution request, wherein the pre-stored configuration data is backup data of the domain name configuration data in the primary DNS server.
[0034] In one example, a domain name resolution system redirects a received domain name resolution request to a backup DNS server, including: generating a wildcard domain name resolution response based on a pre-configured domain name suffix of the backup DNS server; and sending the wildcard domain name resolution response to a proxy server that initiated the domain name resolution request, so that the proxy server can re-initiate a domain name resolution request to the backup DNS server based on the wildcard domain name resolution response.
[0035] Specifically, the services processed by each primary DNS server in the domain name resolution system include the specified suffix, and after being put into use, a backup suffix will be applied for in the domain name resolution system and authorized to the backup DNS server, and the suffix configuration will be completed on the backup DNS server. For example, the suffix of the primary DNS server service is a.com, and the backup suffix applied for can be abk.com. The primary DNS server then provides all domain name configurations for the suffix a.com, and includes a series of complex scheduling behaviors. The configuration content is as follows: t1.a.com IN A 2.2.2.2; t1.a.com IN A 2.2.2.3. In addition, t1.a.com has the function of configuring a preferential response to an IP on the primary authoritative server. When the proxy server requests t1.a.com, the domain name resolution system will recursively request to the primary DNS server. The primary DNS server selects the best IP as the response to the domain name resolution request based on the client IP carried by the proxy server or its request packet.
[0036] When the monitoring system in the domain name resolution system detects that the resolution capability of the primary DNS server is abnormal, it takes over the resolution authority of the primary DNS server and obtains the domain name suffix abk.com served by the backup DNS server corresponding to the primary DNS server based on the domain name suffix a.com served by the primary DNS server. Then, based on the domain name suffix of the backup DNS server and the domain name resolution request obtained, a wildcard domain name resolution response with the suffix abk.com is generated, and the generated wildcard domain name resolution response is sent to the proxy server that initiated the domain name resolution request, so that the proxy server can re-initiate the domain name resolution request to the backup DNS server based on the wildcard domain name resolution response, thereby redirecting the domain name resolution request for the primary DNS server to the backup DNS server. After receiving the domain name resolution request for the domain name t1.a.com.abk.com, the backup DNS server strips the domain name suffix abk.com, and then queries and feeds back the configuration content of t1.a.com based on the domain name configuration data of the primary DNS server backed up in advance. By generating a wildcard domain name resolution response for the domain name resolution request based on the domain name suffix of the backup DNS server, the proxy server can re-initiate the domain name resolution request to the backup DNS server based on the wildcard domain name resolution response, accurately using the backup DNS server to replace the domain name resolution function of the primary DNS server, and timely completing the domain name resolution request response only through signaling when the resolution capability of the primary DNS server is abnormal, avoiding the need to re-set a new primary DNS server, greatly improving the response speed of domain name resolution requests.
[0037] Therefore, the entire process diagram of domain name resolution is as follows Figure 2 As shown, the user terminal initiates a domain name resolution request to the proxy server, and then the proxy server obtains the address of the primary authoritative DNS server with the corresponding domain name resolution authorization from the root server, and sends the resolution request to the primary authoritative DNS server. Under normal circumstances, the primary authoritative DNS server directly completes the response to the domain name resolution request. In the case of abnormal resolution capability of the primary authoritative DNS server, the monitoring system deployed on the primary authoritative DNS server returns a wild-name domain name resolution response with a set lifetime to the proxy server. Based on the received wild-name domain name resolution response, the proxy server re-initiates a domain name resolution request to the backup authoritative DNS server, then receives the response returned by the backup authoritative DNS server, and transmits the domain name resolution result in the response to the user device to complete the domain name resolution.
[0038] Furthermore, after the domain name resolution system generates a wild-card domain name resolution response according to the domain name suffix of the pre-configured backup DNS server, it also includes: obtaining the resolution capability abnormality type of the primary DNS server; when the resolution capability abnormality type of the primary DNS server is an attacked abnormality, setting the lifetime of the wild-card domain name resolution response to a first duration; when the resolution capability abnormality type of the primary DNS server is a non-attacked abnormality, setting the lifetime of the wild-card domain name resolution response to a second duration; wherein the first duration is greater than the second duration.
[0039] Specifically, after the domain name resolution system generates a wild-name domain name resolution response, it needs to set the lifetime of the wild-name domain name resolution response. Through the effective wild-name domain name resolution response, the proxy server can recognize that the primary DNS server cannot normally resolve and respond to the domain name resolution request corresponding to the current domain name, and then directly initiate a domain name resolution request for the current domain name to the backup DNS server. Therefore, after the domain name resolution system generates a wild-name domain name resolution response, it detects the resolution capability anomaly type of the primary DNS server and obtains the resolution capability anomaly type of the primary DNS server. When classifying the resolution capability anomaly type, the resolution capability anomaly caused by external attacks can be regarded as an attacked anomaly; the resolution capability anomaly that is not caused by external attacks can be regarded as a non-attacked anomaly. When the domain name resolution system detects that the resolution capability anomaly type of the primary DNS server is an attack anomaly, the lifetime of the wild-name resolution response is set to the first duration. For example, the effective time ttl is set to 86400, and the proxy server will not initiate a domain name resolution request for the current domain name to the primary DNS server within 86400s; when the resolution capability anomaly type of the primary DNS server is detected as a non-attack anomaly, the lifetime of the wild-name resolution response is set to a second duration shorter than the first duration. For example, the effective time ttl is set to 120, and the proxy server will not initiate a domain name resolution request for the current domain name to the primary DNS server within 120s. By setting the lifetime of the wild-name resolution response according to the resolution capability anomaly type of the primary DNS server, the domain name resolution process can be accurately controlled, and the proxy server can be prevented from initiating meaningless domain name resolution requests to the primary DNS server, thereby improving the processing speed of the domain name resolution. It should be noted that the specific durations of the first duration and the second duration can be set according to actual needs or the performance of the domain name resolution system. This embodiment does not limit the specific settings of the first duration and the second duration.
[0040] In another example, when the domain name resolution system backs up the domain name configuration data of the primary DNS server in the backup DNS server, if the domain name configuration data of the primary DNS server is added or modified, the newly added or modified domain name configuration data is backed up to the backup DNS server; if the domain name configuration data of the primary DNS server is deleted, the domain name configuration data in the backup DNS server that meets the backup deletion conditions is deleted.
[0041] Specifically, the original domain name configuration data on the primary DNS server is: t1.a.com IN A 2.2.2.2; t1.a.comIN A 2.2.2.3, then the domain name resolution system backs up and stores the domain name configuration data on the backup DNS server, and the backup DNS server will contain the domain name configuration data: t1.a.com IN A 2.2.2.2; t1.a.com IN A 2.2.2.3. After detecting that the domain name configuration data of the primary DNS server is changed to: t1.a.com IN A 2.2.2.2; t1.a.com IN A2.2.2.3; t2.a.com IN A 3.3.3.3, the domain name resolution system promptly updates the domain name configuration data stored on the backup DNS server to: t1.a.com IN A 2.2.2.2; t1.a.com IN A 2.2.2.3; t2.a.com IN A3.3.3.3. Then, after detecting that the domain name configuration data on the primary DNS server is changed to: t1.a.com IN A2.2.2.2; t1.a.com IN A 2.2.2.3, the domain name resolution system detects whether t2.a.com IN A 3.3.3.3 meets the backup deletion condition. After t2.a.com IN A 3.3.3.3 meets the backup deletion condition, the domain name configuration data stored on the backup DNS server is changed to: t1.a.com IN A 2.2.2.2; t1.a.com IN A 2.2.2.3.
[0042] In addition, when the domain name configuration data on the primary DNS server is modified, the domain name resolution system will also promptly update the domain name configuration data stored on the backup DNS server. By timely synchronizing the addition and modification of the domain name configuration data, the consistency of the domain name configuration data in the backup DNS server and the domain name configuration data in the primary DNS server is ensured; when the domain name configuration data deleted by the primary DNS server meets the backup deletion conditions, the domain name configuration data in the backup DNS server is deleted accordingly to avoid accidental deletion caused by data loss on the primary DNS server.
[0043] It is worth mentioning that when the domain name resolution system backs up the domain name configuration data of the primary DNS server on the backup DNS server, it can not only directly back up the domain name configuration data of the primary DNS server, but also perform certain domain name conversion on the domain name configuration data of the primary DNS server according to the suffix of the domain name resolution request that the backup DNS server may receive. For example, the domain name suffix of the primary DNS server is a.com, the domain name suffix of the backup DNS server is abk.com, and the domain name configuration data in the primary DNS server is t1.a.com IN A 2.2.2.2; t1.a.com IN A 2.2.2.3. The domain name resolution request that the backup DNS server may receive is initiated according to the wildcard domain name resolution response. Therefore, the structure of the domain name resolution request may be t1.a.com.abk.com or t1.abk.com. The domain name resolution system directly stores the domain name configuration data in the backup DNS server as t1.a.com.abk.com IN A 2.2.2.2; t1.a.com.abk.com IN A 2.2.2.3; or t1.abk.com IN A 2.2.2.2; t1.abk.com IN A 2.2.2.3. This avoids the need for the backup DNS server to strip the domain name suffix, further improving the response speed of the domain name resolution request.
[0044] Furthermore, the domain name configuration information in the backup DNS server that meets the backup deletion conditions is deleted, including: obtaining domain name resolution request records within a fourth preset time period, and detecting whether there is a domain name resolution request for the target domain name; wherein the target domain name is the domain name corresponding to the deleted domain name configuration information; in the absence of a domain name resolution request for the target domain name, deleting the domain name configuration information corresponding to the target domain name stored in the backup DNS server.
[0045] Specifically, when the domain name resolution system detects whether the deleted domain name configuration data meets the backup deletion condition, it obtains the domain name resolution request record received by the primary DNS server within the fourth preset time period, and analyzes the obtained domain name resolution request record to detect whether there is a domain name resolution request for the target domain name corresponding to the deleted domain name configuration data. When it is detected that there is a domain name resolution request for the target domain name, it is determined that the deleted domain name configuration data may be deleted by mistake and does not meet the backup deletion condition, and its backup on the backup DNS server is retained; when it is detected that there is no domain name resolution request for the target domain name, it is determined that the deleted domain name configuration data is deleted normally, and the backup data in the backup DNS server is deleted. By deleting the deleted domain name configuration data of the primary DNS server accordingly after detecting that there is no domain name resolution request for the domain name corresponding to the deleted domain name configuration data, the backup data can be avoided as much as possible from being deleted accidentally due to the loss of data on the primary DNS server.
[0046] In addition, it should be understood that the step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs that do not change the core design of the algorithm and process are all within the scope of protection of this patent.
[0047] Another aspect of the present application relates to a domain name resolution system. Figure 3 ,include:
[0048] The detection module 301 is used to detect the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within a first preset time period.
[0049] The response module 302 is used to redirect the received domain name resolution request to the backup DNS server when the resolution capability of the primary DNS server is abnormal, so that the backup DNS server can obtain and return the response to the domain name resolution request according to the pre-stored configuration data; wherein the pre-stored configuration data is the backup data of the domain name configuration data in the primary DNS server.
[0050] It is not difficult to find that this embodiment is a device embodiment corresponding to the method embodiment, and this embodiment can be implemented in conjunction with the method embodiment. The relevant technical details mentioned in the method embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the method embodiment.
[0051] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0052] The embodiment of the present application also provides an electronic device, referring to Figure 4 , including: at least one processor 401; and a memory 402 communicatively connected to the at least one processor 401; wherein the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401 so that the at least one processor 401 can execute the domain name resolution method described in any of the above method embodiments.
[0053] The memory 402 and the processor 401 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 401 and the memory 402 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 401 is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor 401.
[0054] The processor 401 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 402 can be used to store data used by the processor 401 when performing operations.
[0055] Another aspect of the embodiments of the present application further provides a computer-readable storage medium storing a computer program, which implements the above method embodiments when executed by a processor.
[0056] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0057] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.
Claims
1. A domain name resolution method, characterized in that: include: Detecting the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within a first preset time period; In the case where the resolution capability of the primary DNS server is abnormal, redirecting the received domain name resolution request to the backup DNS server, so that the backup DNS server can obtain and return a response to the domain name resolution request according to pre-stored configuration data; Wherein, the pre-stored configuration data is the backup data of the domain name configuration data in the primary DNS server; The step of redirecting the received domain name resolution request to a backup DNS server includes: Generate a wildcard domain name resolution response according to the pre-configured domain name suffix of the backup DNS server and the domain name resolution request; The wildcard domain name resolution response is sent to the proxy server that initiated the domain name resolution request, so that the proxy server can re-initiate the domain name resolution request to the backup DNS server according to the wildcard domain name resolution response.
2. The domain name resolution method according to claim 1, characterized in that: The analysis capability anomaly includes one or any combination of the following: The resolution service is abnormal, the domain name configuration data is lost, and the server is under attack.
3. The domain name resolution method according to claim 2, characterized in that: In the case where the resolution capability abnormality includes the resolution service abnormality, the detecting the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within the first preset time period includes: Obtaining a first number of the domain name resolution requests received by the primary DNS server within the first preset time period, and a second number of the domain name resolution requests responded to by the primary DNS server within the first preset time period; Acquire a response ratio of the primary DNS server according to the second number and the first number; When the response ratio is less than a first preset threshold, it is determined that a resolution service abnormality exists in the primary DNS server.
4. The domain name resolution method according to claim 2, characterized in that: In the case where the resolution capability abnormality includes the resolution service abnormality, the detecting the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within the first preset time period includes: Obtaining a first response ratio of the primary DNS server within the second preset time period according to a third number of the domain name resolution requests received by the primary DNS server within the second preset time period and a fourth number of the domain name resolution requests responded to by the primary DNS server within the second preset time period; Obtaining a second response ratio of the primary DNS server within the third preset time length according to a fifth number of the domain name resolution requests received by the primary DNS server within a third preset time length and a sixth number of the domain name resolution requests responded to by the primary DNS server within the third preset time length; wherein the third preset time length is equal to the second preset time length, and the sum of the third preset time length and the second preset time length is less than or equal to the first preset time length; When the difference between the second response ratio and the first response ratio is greater than a sudden drop threshold, it is determined that a resolution service abnormality exists in the primary DNS server.
5. The domain name resolution method according to claim 2, characterized in that: In the case where the resolution capability abnormality includes that the server is under attack, the detecting the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within the first preset time period includes: Obtaining a first number of the domain name resolution requests received by the primary DNS server within the first preset time period; When the first number is greater than an attack threshold, it is determined that the primary DNS server is in an attacked state.
6. The domain name resolution method according to claim 2, characterized in that: In the case where the resolution capability abnormality includes the loss of the configuration data, the detecting the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within the first preset time period includes: Obtaining a seventh number of the domain name resolution requests for the deleted domain name within the first preset time period; When the seventh number is greater than the second preset threshold, it is determined that domain name configuration data of the primary DNS server is lost.
7. The domain name resolution method according to claim 1, characterized in that: After generating a wildcard domain name resolution response according to the pre-configured domain name suffix of the backup DNS server and the domain name resolution request, the method further includes: Obtain the resolution capability anomaly type of the primary DNS server; When the resolution capability abnormality type of the primary DNS server is an attack abnormality, setting the lifetime of the wildcard domain name resolution response to a first duration; When the resolution capability abnormality type of the primary DNS server is a non-attack abnormality, setting the lifetime of the wildcard domain name resolution response to a second duration; The first duration is greater than the second duration.
8. The domain name resolution method according to any one of claims 1 to 7, characterized in that: Also includes: When the domain name configuration data of the primary DNS server is added or modified, the newly added or modified domain name configuration data is backed up to the backup DNS server; When the domain name configuration data of the primary DNS server is deleted, the domain name configuration data satisfying the backup deletion condition in the backup DNS server is deleted.
9. The domain name resolution method according to claim 8, characterized in that: The deleting the domain name configuration data satisfying the backup deletion condition in the backup DNS server includes: Obtaining a domain name resolution request record within a fourth preset time period, and detecting whether there is a domain name resolution request for a target domain name; wherein the target domain name is a domain name corresponding to the deleted domain name configuration information; In the case that there is no domain name resolution request for the target domain name, the domain name configuration information corresponding to the target domain name stored in the backup DNS server is deleted.
10. A domain name resolution system, characterized in that: include: A detection module, configured to detect the resolution capability of the primary DNS server according to the domain name resolution requests received by the primary DNS server within a first preset time period; A response module, used for redirecting the received domain name resolution request to a backup DNS server when the resolution capability of the primary DNS server is abnormal, so that the backup DNS server can obtain and return a response to the domain name resolution request according to pre-stored configuration data; Wherein, the pre-stored configuration data is the backup data of the domain name configuration data in the primary DNS server; The response module is specifically used to generate a wildcard domain name resolution response based on the pre-configured domain name suffix of the backup DNS server and the domain name resolution request; and send the wildcard domain name resolution response to the proxy server that initiated the domain name resolution request, so that the proxy server can re-initiate the domain name resolution request to the backup DNS server based on the wildcard domain name resolution response.
11. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the domain name resolution method as described in any one of claims 1 to 9.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the domain name resolution method according to any one of claims 1 to 9 is implemented.
