Data comparison method and device and electronic equipment
By synchronizing authoritative DNS data in the local top authoritative mirror and comparing it, the inefficiency and security threat problems caused by DNS cache poisoning attacks are solved, and an efficient and secure DNS domain name resolution process is achieved.
Patent Information
- Application Number
- CN202411095955.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-03
AI Technical Summary
DNS cache poisoning attacks lead to inefficiency in the DNS domain name resolution process, and are difficult to detect and prevent in a timely manner, affecting user access security.
By synchronizing the top-level domain data of authoritative DNS in advance in the local top-level authoritative mirror and comparing it locally, it reduces the time to obtain data from authoritative DNS, improves comparison efficiency, and ensures the accuracy of data through synchronous updates and digital signature verification. and integrity, mark exception data and clear local DNS cache to avoid the spread of malicious IP addresses.
It significantly improves the efficiency of DNS cache consistency comparison, reduces DNS domain name resolution delay, ensures the security and accuracy of client access, responds to DNS query requests in a timely manner, and prevents the adverse effects of DNS cache poisoning attacks.
Smart Images

Figure CN119071035A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network security technology, and in particular to a data comparison method, device and electronic equipment. Background Art
[0002] The Domain Name System (DNS) is an important service on the Internet, which realizes the mapping between domain names and Internet Protocol (IP) addresses. Through DNS domain name resolution, users can obtain the IP address corresponding to the domain name and access the Internet.
[0003] For example, Figure 1a As shown, when the client needs to access the target domain name, it first sends a domain name resolution query request containing the target domain name to the local DNS, that is, the client asks the local DNS what the IP address of website A is. Then, if the local DNS determines that there is no resolution record for the domain name resolution query request in the local cache, that is, there is no target IP address corresponding to the target domain name, the domain name resolution query request is finally sent to the authoritative DNS through layer-by-layer recursion. Next, the authoritative DNS returns the target domain name and the corresponding target IP address (such as abcd) in the domain name resolution query request to the local DNS, so that the local DNS returns the target domain name and the corresponding target IP address (such as abcd) in the domain name resolution query request to the client, so that the client can normally access the corresponding website or service through the target IP address (such as abcd).
[0004] However, during the DNS domain name resolution process, DNS cache poisoning attacks may occur. This DNS cache poisoning attack is a widespread security threat on the current Internet. Attackers exploit vulnerabilities in the DNS cache system to send tampered malicious response packets to the DNS forwarder, mapping the target domain name to a malicious IP address, causing the victim to be redirected to a malicious website corresponding to the malicious IP address, resulting in serious consequences such as personal information leakage, phishing attacks, and malware propagation.
[0005] For example, Figure 1b As shown, when the DNS domain name resolution process is attacked by DNS cache poisoning, the IP address corresponding to the target domain name received by the local DNS is a malicious IP address (such as efgh) instead of the original target IP address (such as abcd), resulting in the client being unable to normally access the website or service corresponding to the target IP address (such as abcd).
[0006] Therefore, in order to solve the above problem, cache consistency comparison can be performed to determine whether the local DNS and the authoritative DNS are attacked by DNS cache poisoning.
[0007] Specifically, when performing a cache consistency comparison, the local domain name data in the local cache of the local DNS can be directly compared with the authoritative top-level domain name data obtained from the authoritative DNS to determine whether the local domain name data in the local cache is consistent with the authoritative top-level domain name data in the authoritative DNS. If they are inconsistent, it is determined that the local DNS and the authoritative DNS have been attacked by DNS cache poisoning.
[0008] However, obtaining authoritative top-level domain name data from the authoritative DNS consumes a lot of time, resulting in low comparison efficiency when the local domain name data in the local cache is directly compared with the authoritative top-level domain name data obtained from the authoritative DNS. Summary of the invention
[0009] The present application provides a data comparison method, device and electronic device to improve the comparison efficiency of cache consistency comparison of local domain name data in a local DNS. The specific implementation scheme is as follows:
[0010] In a first aspect, the present application provides a data comparison method, the method comprising:
[0011] Obtaining authoritative top-level domain name data from a deployed local top-level authoritative mirror; wherein the local top-level authoritative mirror stores the authoritative top-level domain name data synchronized from the authoritative domain name system DNS;
[0012] Compare the local domain name data in the local DNS with the authoritative top-level domain name data.
[0013] Through the above-mentioned application embodiment, the authoritative top-level domain name data in the authoritative DNS is synchronized to the deployed local top-level authoritative mirror in advance. When a comparison is required, the authoritative top-level domain name data is obtained from the local top-level authoritative mirror. Compared with directly obtaining the authoritative top-level domain name data from the authoritative DNS, the time for obtaining the authoritative top-level domain name data is greatly reduced. Therefore, when the local domain name data in the local DNS is compared with the authoritative top-level domain name data obtained from the local top-level authoritative mirror, the time required for the comparison process is greatly reduced, thereby significantly improving the comparison efficiency.
[0014] In a possible implementation manner, before obtaining the authoritative top-level domain name data from the deployed local top-level authoritative mirror, the method further includes:
[0015] At first intervals, for each of the authoritative top-level domain name data in the local top-level authoritative mirror, the following synchronization update operation is performed:
[0016] Determine whether the authoritative top-level domain name data in the local top-level authoritative mirror is consistent with the real data of the authoritative top-level domain name in the authoritative DNS;
[0017] If not, update the real data of the authoritative top-level domain name to the local top-level authoritative mirror.
[0018] Through the above-mentioned application embodiment, the authoritative top-level domain name data in the local top-level authoritative mirror is compared with the real data of the authoritative top-level domain name in the authoritative DNS at the first time, and when the two are inconsistent, the real data of the authoritative top-level domain name in the authoritative DNS is updated to the local top-level authoritative mirror, so that the authoritative top-level domain name data in the local top-level authoritative mirror is the latest and most accurate real data of the authoritative top-level domain name, thereby ensuring the authenticity, accuracy, timeliness and latest of the authoritative top-level domain name data in the local top-level authoritative mirror, and helping to improve the accuracy of the comparison process between the local domain name data and the authoritative top-level domain name data in the local DNS.
[0019] In a possible implementation manner, before obtaining the authoritative top-level domain name data from the deployed local top-level authoritative mirror, the method further includes:
[0020] Every second time, check whether the authoritative top-level domain name data in the local top-level authoritative mirror has integrity through digital signature verification.
[0021] Through the above-mentioned application embodiments, the integrity of the authoritative top-level domain name data in the local top-level authoritative mirror is guaranteed, and the reliability of the authoritative top-level domain name data is ensured, thereby helping to improve the accuracy of the comparison process between the local domain name data and the authoritative top-level domain name data in the local DNS.
[0022] In a possible implementation, the method further includes:
[0023] Recording the synchronization update result corresponding to the synchronization update operation and recording the integrity check result;
[0024] A security log is generated according to the synchronous update result and the inspection result.
[0025] Through the above-mentioned application embodiment, a security log is generated according to the synchronization update results and integrity check results corresponding to the synchronization update operation for use in subsequent analysis and investigation, so that subsequent analysis and investigation can have record queries, thereby ensuring the accuracy and efficiency of subsequent analysis and investigation.
[0026] In a possible implementation manner, after comparing the local domain name data in the local DNS with the authoritative top-level domain name data, the method further includes:
[0027] If it is determined that there is local domain name data in the local DNS that is inconsistent with the authoritative top-level domain name data, marking the inconsistent local domain name data as abnormal data;
[0028] If it is determined that the amount of the abnormal data meets the abnormal condition, the local domain name data in the local DNS is cleared.
[0029] Through the above application embodiment, the local domain name data in the local DNS that is inconsistent with the authoritative top-level domain name data is marked as abnormal data, so that the local domain name data with abnormalities in the local DNS can be determined intuitively and quickly. After the number of abnormal data meets the abnormal conditions, the local domain name data in the local DNS is cleared to avoid the local DNS sending non-target IP addresses (such as malicious IP addresses) in the abnormal data to the client when the client sends a domain name resolution query request to the local DNS, thereby ensuring the security of client access.
[0030] In a possible implementation manner, after determining that the amount of abnormal data meets the abnormal condition, the method further includes:
[0031] When the client sends a domain name resolution query request to the local DNS, the target IP address corresponding to the target domain name in the domain name resolution query request is queried through the local top-level authoritative mirror.
[0032] Through the above-mentioned application embodiment, after the number of abnormal data meets the abnormal conditions, the target IP address corresponding to the target domain name in the domain name resolution query request sent by the client is queried through the local top-level authoritative mirror, thereby ensuring that the user's DNS query (such as domain name resolution query request) can obtain a timely response and avoiding the adverse effects of DNS cache poisoning attacks on the DNS domain name resolution service.
[0033] In a possible implementation, the method further includes:
[0034] Monitor the operating status and performance indicators of the local top-level authoritative image;
[0035] If it is determined that the operating state is abnormal or it is determined that the performance indicator is greater than a performance indicator threshold, a warning message indicating that the local top-level authoritative image is abnormal is issued.
[0036] Through the above application embodiments, by monitoring the operating status and performance indicators of the local top-level authoritative image, problems in the local top-level authoritative image can be discovered in time, so that the problem can be solved in time, thereby ensuring the reliability and security of the local authoritative image.
[0037] In a second aspect, the present application further provides a data comparison device, the device comprising:
[0038] An acquisition module, used to acquire authoritative top-level domain name data from a deployed local top-level authoritative mirror; wherein the local top-level authoritative mirror stores the authoritative top-level domain name data synchronized from the authoritative domain name system DNS;
[0039] The processing module is used to compare the local domain name data in the local DNS with the authoritative top-level domain name data.
[0040] In a possible implementation manner, the acquisition module is specifically configured to perform the following synchronization update operation for each of the authoritative top-level domain name data in the local top-level authoritative mirror at a first time interval:
[0041] Determine whether the authoritative top-level domain name data in the local top-level authoritative mirror is consistent with the real data of the authoritative top-level domain name in the authoritative DNS;
[0042] If not, update the real data of the authoritative top-level domain name to the local top-level authoritative mirror.
[0043] In a possible implementation manner, the acquisition module is specifically configured to check whether the authoritative top-level domain name data in the local top-level authoritative mirror has integrity through digital signature verification every second time period.
[0044] In a possible implementation, the acquisition module is specifically used to record the synchronous update result corresponding to the synchronous update operation, and record the integrity check result;
[0045] A security log is generated according to the synchronous update result and the inspection result.
[0046] In a possible implementation manner, the processing module is specifically configured to mark the inconsistent local domain name data as abnormal data if it is determined that there is local domain name data in the local DNS that is inconsistent with the authoritative top-level domain name data;
[0047] If it is determined that the amount of the abnormal data meets the abnormal condition, the local domain name data in the local DNS is cleared.
[0048] In a possible implementation, the processing module is specifically configured to query the target IP address corresponding to the target domain name in the domain name resolution query request through the local top-level authoritative mirror when the client sends the domain name resolution query request to the local DNS.
[0049] In a possible implementation, the device further includes a monitoring module, the monitoring module being used to monitor the operating status and performance indicators of the local top-level authoritative image;
[0050] If it is determined that the operating state is abnormal or it is determined that the performance indicator is greater than a performance indicator threshold, a warning message indicating that the local top-level authoritative image is abnormal is issued.
[0051] In a third aspect, the present application provides an electronic device, including:
[0052] Memory, used to store computer programs;
[0053] The processor is used to implement the above-mentioned data comparison method steps when executing the computer program stored in the memory.
[0054] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned data comparison method steps are implemented.
[0055] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1a A schematic diagram of DNS domain name resolution provided in an embodiment of the present application;
[0057] Figure 1b A schematic diagram of a DNS domain name resolution provided in an embodiment of the present application being attacked by a DNS cache poisoning attack;
[0058] Figure 2 A schematic diagram of a data comparison method provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of a processing process of a data comparison method provided in an embodiment of the present application;
[0060] Figure 4 A schematic diagram of a data comparison device provided in an embodiment of the present application;
[0061] Figure 5 A schematic diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0063] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0064] In order to determine whether the local DNS and the authoritative DNS are attacked by DNS cache poisoning, the local domain name data in the local cache of the local DNS can be compared with the authoritative top-level domain name data obtained from the authoritative DNS. When they are inconsistent, it can be determined that the local DNS and the authoritative DNS are attacked by DNS cache poisoning. However, it takes a lot of time to obtain the authoritative top-level domain name data from the authoritative DNS, resulting in the problem of low comparison efficiency in the above comparison method.
[0065] Therefore, the present application proposes a data comparison method, which synchronizes the authoritative top-level domain name data in the authoritative DNS to the deployed local top-level authoritative mirror in advance, and obtains the authoritative top-level domain name data from the local top-level authoritative mirror when a comparison is needed, which significantly reduces the time for obtaining the authoritative top-level domain name data. The local domain name data in the local DNS is then compared with the authoritative top-level domain name data obtained from the local top-level authoritative mirror, so that the time required for the comparison is greatly reduced, thereby significantly improving the comparison efficiency.
[0066] Reference Figure 2 The figure is a flow chart of a data comparison method provided in an embodiment of the present application, the method comprising:
[0067] S201, obtain authoritative top-level domain name data from the deployed local top-level authoritative mirror.
[0068] Before comparing the local domain name data in the local DNS, first deploy the local top-level authoritative mirror in the DNS Forwarder.
[0069] In an embodiment of the present application, the deployment of the local top-level authoritative image can be deployed in a distributed deployment mode, and the local top-level authoritative image is deployed on multiple nodes, thereby increasing the capacity and throughput of the system.
[0070] After deploying the local top-level authoritative mirror in the DNS Forwarder, first obtain the authoritative top-level domain name data from the authoritative DNS (the authoritative top-level domain name data is the real data of the authoritative top-level domain name), and store it in the local mirror cache in the local top-level authoritative mirror, so as to quickly query the authoritative top-level domain name data from the local top-level authoritative mirror. Therefore, the local top-level authoritative mirror stores the real data of the authoritative top-level domain name synchronized from the authoritative domain name system DNS. The authoritative top-level domain name data may include the IP address mapped to the top-level domain name (such as .com, .net).
[0071] In an embodiment of the present application, the storage of authoritative top-level domain name data in the local top-level authoritative mirror can be stored in a multi-level cache structure, thereby improving the subsequent query hit rate of the authoritative top-level domain name data, accelerating the response time, and further improving the query efficiency.
[0072] Optionally, the above-mentioned obtaining the authoritative top-level domain name data from the authoritative DNS and storing it in the local image cache in the local top-level authoritative image can be implemented in the following ways:
[0073] First, download the real data of authoritative top-level domain names from the Centralized Zone Data Service (CZDS).
[0074] Then, the downloaded authoritative top-level domain name real data is stored in the local mirror cache in the local top-level authoritative mirror. The authoritative top-level domain name real data is the authoritative top-level domain name data stored in the local top-level authoritative mirror.
[0075] Through the above method, the real data of the authoritative top-level domain name downloaded from the centralized area data service is stored in the local mirror cache in the local top-level authoritative mirror, providing the authoritative top-level domain name data for the subsequent comparison of the local domain name data in the local DNS, and the authoritative top-level domain name data can be directly obtained from the local top-level authoritative mirror, so that the time required for obtaining the authoritative top-level domain name data is greatly reduced, which is conducive to accelerating the comparison process between the local domain name data in the local DNS and the authoritative top-level domain name data, reducing the comparison delay, and improving the overall performance of the system.
[0076] When downloading the real data of the authoritative top-level domain name, the download speed and the time required for downloading the real data of the authoritative top-level domain name may also be recorded, and the download speed and the time required for downloading are correspondingly stored in the local image cache.
[0077] Optionally, the above-mentioned downloading of the real data of the authoritative top-level domain name from the CZDS can be downloaded from the CZDS provided by the Internet Corporation for Assigned Names and Numbers (English: The Internet Corporation for Assigned Names and Numbers, abbreviated as ICANN).
[0078] ICANN created CZDS to avoid users from independently applying for zone file access rights from different registries. The Zone File is a set of instructions on how to convert a network domain name into a corresponding IP address, such as the corresponding IP address of a domain name such as .com or .con. In this way, the real data of authoritative top-level domain names can be obtained based on the Zone File.
[0079] Therefore, by initiating registration with CZDS, one can request the ZoneFile file of the top-level domain (English: top-level domain, abbreviated as: TLD) including the generic top-level domain (English: Generic top-level domain, abbreviated as gTLD).
[0080] The specific download process of downloading authoritative top-level domain name data through CZDS provided by ICANN can be as follows:
[0081] First, visit CZDS.ICANN and register an account.
[0082] Then, log in to the system, enter the Dashboard, and submit an application for domain name zone file access. You can apply one by one or in batches, and you can adjust it according to the specific application scenario.
[0083] Next, wait for the review. While waiting for the review, you can check the review progress of each gTLD at any time through the CZDS Dashboard. Whether the application is accepted or rejected, you will receive a reply letter from CZDS.
[0084] If you plan to use File Transfer Protocol (FTP) to download Zone Files, create a separate key in the CZDS backend.
[0085] If you want to download Zone File through the official Python client program, create an application interface token (API Token).
[0086] Then, use an FTP client or API client to download the domain name information.
[0087] Then visit https: / / github.com / fourkitchens / czdap-tools to download the CZDS API client tool, which can decrypt the FTP login credential file or directly download the Zone File, and then obtain the real data of the authoritative top-level domain name based on the Zone File.
[0088] Optionally, after obtaining the authoritative top-level domain name data from the authoritative DNS and storing it in the local mirror cache in the local top-level authoritative mirror, the real data of the authoritative top-level domain name in the authoritative DNS is periodically synchronized and updated to the local top-level authoritative mirror, so that the authoritative top-level domain name data in the local top-level authoritative mirror is consistent with the real data of the authoritative top-level domain name in the authoritative DNS, so that the authoritative top-level domain name data obtained from the local top-level authoritative mirror is the real authoritative top-level domain name data, thereby ensuring the accuracy, timeliness, latest and reliability of the authoritative top-level domain name data in the local top-level authoritative mirror, and avoiding the inconsistency of the subsequent comparison process caused by the untimely synchronization of the authoritative top-level domain name data in the local top-level authoritative mirror, so as to avoid the misjudgment of the DNS cache poisoning attack between the local DNS and the authoritative DNS.
[0089] The above-mentioned regular synchronization of the real data of the authoritative top-level domain names in the authoritative DNS to the local top-level authoritative mirror can adopt an incremental update optimization strategy to synchronize only the real data of the authoritative top-level domain names that have changed, which is beneficial to reducing resource consumption and the comparison time of the subsequent comparison process, and reduces the amount of data transmission and saves storage space.
[0090] Specifically, at first intervals, for each authoritative top-level domain name data in the local top-level authoritative mirror, the following synchronization update operations are performed:
[0091] Determine whether the authoritative top-level domain name data in the local top-level authoritative mirror is consistent with the actual authoritative top-level domain name data in the authoritative DNS.
[0092] If it is determined that the authoritative top-level domain name data is inconsistent with the real data of the authoritative top-level domain name, the real data of the authoritative top-level domain name in the authoritative DNS is updated to the local mirror cache in the local top-level authoritative mirror. In other words, the authoritative top-level domain name data is replaced with the real data of the authoritative top-level domain name.
[0093] If it is determined that the authoritative top-level domain name data is consistent with the real data of the authoritative top-level domain name, the authoritative top-level domain name data in the local top-level authoritative mirror remains unchanged.
[0094] In an embodiment of the present application, the above-mentioned first time can be adjusted according to the specific application scenario so that the synchronous update of the authoritative top-level domain name data in the local top-level authoritative mirror meets actual needs, thereby ensuring the accuracy, timeliness and currency of the authoritative top-level domain name data.
[0095] In the above-mentioned synchronous update process of updating the real data of the authoritative top-level domain name in the authoritative DNS to the local mirror cache in the local top-level authoritative mirror, the real data of the authoritative top-level domain name is digitally signed and verified to prevent the real data of the authoritative top-level domain name from being tampered with during the synchronous update process, thereby further ensuring the accuracy of the authoritative top-level domain name data in the local top-level authoritative mirror.
[0096] The above-mentioned digital signature verification may be the digital signature verification in the prior art, which will not be described in detail here.
[0097] In addition, for large-scale authoritative top-level domain data, data compression technology can also be used to further reduce the amount of data transmission and save storage space. The data compression technology is a data compression technology in the prior art and will not be described in detail here.
[0098] Optionally, after obtaining the authoritative top-level domain name data from the authoritative DNS and storing it in the local mirror cache in the local top-level authoritative mirror, the integrity of the authoritative top-level domain name data in the local top-level authoritative mirror is checked regularly, so as to timely discover problems with the local top-level authoritative mirror and promptly repair existing problems, while preventing the authoritative top-level domain name data from being tampered with, thereby ensuring the reliability and accuracy of the authoritative top-level domain name data in the local top-level authoritative mirror.
[0099] Specifically, every second time, the local top-level authoritative image is checked for integrity through digital signature verification. The second time can be adjusted according to the specific application scenario.
[0100] In an embodiment of the present application, after the above-mentioned synchronization update operation and integrity check of the authoritative top-level domain name data in the local top-level authoritative mirror, the synchronization update result corresponding to the synchronization update operation and the integrity check result can also be recorded.
[0101] Then, based on the synchronization update results and the inspection results, a security log is generated, thereby providing data for analysis and investigation when subsequently analyzing and investigating the authoritative top-level domain name data in the local top-level authoritative mirror.
[0102] Furthermore, after performing various operations (such as download operations, synchronous update operations, and integrity check operations) on the authoritative top-level domain name data in the local top-level authoritative mirror to ensure the authenticity, accuracy, and currency of the authoritative top-level domain name data, the authoritative top-level domain name data (i.e., the real data of the authoritative top-level domain name) is obtained from the local top-level authoritative mirror.
[0103] S202, comparing the local domain name data in the local DNS with the authoritative top-level domain name data.
[0104] After obtaining the authoritative top-level domain name data from the local top-level authoritative mirror in step S201, the local domain name data in the local DNS is compared with the authoritative top-level domain name data. The local domain name data in the local DNS is stored in the local cache in the local DNS, and the local domain name data can be obtained from the authoritative DNS during the DNS domain name resolution process under normal circumstances.
[0105] Specifically, each local domain name data in the local DNS is compared with each authoritative top-level domain name data obtained from the local top-level authoritative mirror.
[0106] Optionally, the above comparison process can adopt a variety of comparison strategies, such as asynchronous comparison, parallel comparison, etc., so as to improve the comparison efficiency and system performance.
[0107] Optionally, the comparison process can also be accelerated by hardware acceleration and parallel computing technology, thereby further improving the comparison efficiency and reducing system resource consumption. The hardware acceleration and parallel computing technology are hardware acceleration and parallel computing technologies in the prior art and will not be described in detail here.
[0108] Optionally, the above comparison process can be performed using a load balancing mechanism, thereby dynamically adjusting the traffic distribution of the local top-level authoritative mirror according to the actual load situation, further improving the comparison efficiency.
[0109] Optionally, the above comparison process may be optimized to further improve the response speed and concurrent processing capability of the system. The optimization method of the performance optimization is a conventional performance optimization method in the prior art, which will not be described in detail here.
[0110] Furthermore, if it is determined that there is local domain name data in the local DNS that is inconsistent with the authoritative top-level domain name data, the inconsistent local domain name data is marked as abnormal data, and the inconsistent authoritative top-level domain name data may also be marked as abnormal data.
[0111] Optionally, if it is determined that the authoritative top-level domain name data is consistent with the local domain name data, the authoritative top-level domain name data and / or the local domain name data can be marked as non-abnormal data to facilitate determining the domain name data in the local top-level authoritative mirror or local DNS that has been verified and has not been attacked by DNS cache poisoning.
[0112] After comparing each local domain name data in the local DNS with each authoritative top-level domain name data obtained from the local top-level authoritative mirror, it is determined whether the number of abnormal data meets the abnormal condition.
[0113] If it is determined that the number of abnormal data meets the abnormal conditions, it is determined that there is a problem between the local DNS and the authoritative DNS, and the local domain name data in the local DNS is cleared.
[0114] In the embodiment of the present application, the above abnormal condition may be that the number of abnormal data is greater than the abnormal number threshold. That is to say, the above determination of whether the number of abnormal data meets the abnormal condition may be to determine whether the number of abnormal data is greater than the abnormal number threshold. If it is determined that the number of abnormal data is greater than the abnormal number threshold, it is determined that the number of abnormal data meets the abnormal condition.
[0115] The above abnormal condition may also be that the abnormal ratio of the number of abnormal data is greater than the abnormal ratio threshold. The abnormal ratio is the ratio of the number of abnormal data to the total number of local domain name data in the local cache in the local DNS. In other words, the above judgment of whether the number of abnormal data meets the abnormal condition may be to judge whether the abnormal ratio is greater than the abnormal ratio threshold. If it is determined that the abnormal ratio is greater than the abnormal ratio threshold, it is determined that the number of abnormal data meets the abnormal condition. However, the above abnormal condition is not limited to this and can be adjusted according to the specific application scenario.
[0116] The above-mentioned abnormal quantity threshold and the above-mentioned abnormal ratio threshold can be flexibly adjusted according to the specific application scenario, so that the sensitivity and tolerance of the DNS cache consistency check (i.e., the comparison of local domain name data in the local DNS with the authoritative top-level domain name data in the local top-level authoritative mirror) can be flexibly adjusted.
[0117] The above-mentioned abnormal quantity threshold and the above-mentioned abnormal proportion threshold can also be adaptively adjusted according to historical DNS query (such as domain name resolution query request) data and cache usage (such as usage of local mirror cache in local top-level authoritative mirror, usage of local cache in local DNS) to adapt to changes in different network environments and attack threats.
[0118] Optionally, after marking the abnormal data, the abnormal data is reported so as to solve the problem of the abnormal data in a timely manner.
[0119] Optionally, for abnormal data, an attempt may be made to automatically repair the abnormal data by re-requesting domain name data from the authoritative DNS and caching the obtained domain name data in a local cache in the local DNS.
[0120] Optionally, after determining that the amount of abnormal data meets the abnormal conditions, that is, after being attacked by DNS cache poisoning, during DNS domain name resolution, domain name resolution is performed through a local top-level authoritative mirror, thereby ensuring that the user's DNS query can obtain a timely response and avoiding the adverse effects of DNS cache poisoning attacks on DNS domain name resolution services.
[0121] Specifically, when the client sends a domain name resolution query request to the local DNS, the target IP address corresponding to the target domain name in the domain name resolution query request is queried through the local top-level authoritative mirror. Therefore, after being attacked by DNS cache poisoning, the DNS query is transferred to the local top-level authoritative mirror. The local top-level authoritative mirror stores the authoritative top-level domain name data that has been verified and has not been attacked by DNS cache poisoning.
[0122] Optionally, in the embodiment of the present application, the operation status and performance index of the local top-level authoritative image can also be monitored in real time. When it is determined that the operation status is abnormal or the performance index is greater than the performance index threshold, a warning message indicating that the local top-level authoritative image is abnormal is issued, so as to timely discover problems in the local top-level authoritative image and solve the problems in time to ensure the safety of the local top-level authoritative image.
[0123] The monitoring of the operating status and performance indicators of the above-mentioned local top-level authoritative mirror can be monitored by the monitoring method of the existing technology. The performance indicators are conventional performance indicators of the authoritative DNS or the local DNS, which will not be repeated here.
[0124] In addition, in an embodiment of the present application, a local top-level authoritative mirror may be connected to multiple local DNSs, and a load balancing algorithm may be used to implement the above steps S201-S202, thereby sharing the DNS query load to improve DNS query efficiency.
[0125] At the same time, for the local top-level authoritative mirror, you can also flexibly respond to DNS query traffic of different scales and performance requirements by dynamically adding or deleting backup servers.
[0126] In addition, redundant designs and backup strategies can be used to ensure high availability of local top-level authoritative mirrors to avoid single points of failure.
[0127] In addition, in the embodiment of the present application, the service layer provides the application layer with a storage interface and a monitoring interface for managing the underlying basic resources, and the authoritative top-level domain name data with update authority is poured into the storage interface according to the voting mechanism of the application layer to achieve co-governance of the authoritative top-level domain name data. In the application layer, role management, configuration management, proposal management, system monitoring and other operations can also be performed to ensure the effective operation of the DNS cache consistency comparison method (i.e., the comparison of local domain name data in the local DNS with the authoritative top-level domain name data in the local top-level authoritative mirror), further improving the reliability and stability of the DNS cache consistency comparison.
[0128] In summary, the data comparison method proposed in the present application synchronizes the real data of the authoritative top-level domain name in the authoritative DNS to the deployed local top-level authoritative mirror in advance, so that when obtaining the authoritative top-level domain name data, it can be directly obtained from the local top-level authoritative mirror, thereby accelerating the acquisition process of the authoritative top-level domain name data, and further reducing the comparison delay of the comparison process between the local domain name data in the local DNS and the authoritative top-level domain name data, so that the comparison rate of the comparison process is greatly improved, and the overall performance of the system is improved, and the response time of DNS domain name resolution is accelerated.
[0129] The technical solution of this application is further explained below in conjunction with a specific application process.
[0130] like Figure 3 The figure shows a processing diagram of the data comparison method. First, in the download module, the authoritative top-level domain name data (i.e., A, authoritative top-level domain name data) is downloaded from the authoritative DNS, and then the authoritative top-level domain name data (i.e., A, authoritative top-level domain name data) is stored in the local top-level authoritative mirror (such as the local mirror cache in the local top-level authoritative mirror).
[0131] At the same time, in the synchronization update module, the authoritative top-level domain name data (i.e. A, authoritative top-level domain name data) is obtained from the local top-level authoritative mirror at the first time, and the authoritative top-level domain name data (i.e. B, authoritative top-level domain name data) is obtained from the authoritative DNS. The two are then compared, and the changed authoritative top-level domain name data (i.e. B, authoritative top-level domain name data) in the authoritative DNS is updated to the local top-level authoritative mirror.
[0132] Then, in the comparison module, the authoritative top-level domain name data (i.e., B, authoritative top-level domain name data) is obtained from the local top-level authoritative mirror, and the local domain name data is obtained from the local DNS (such as the local cache in the local DNS). The local domain name data can be the domain name data that is continuously obtained from the authoritative DNS under normal circumstances (i.e., the domain name data obtained through route 2 and route 3). Then the local domain name data is compared with the authoritative top-level domain name data. And the comparison result is transmitted to the comparison result processing module.
[0133] In the comparison result processing module, the local domain name data that is inconsistent with the authoritative top-level domain name data is determined according to the comparison result, and the local domain name data that is inconsistent with the authoritative top-level domain name data is marked as abnormal data. If it is determined that the number of abnormal data meets the deletion condition, the local domain name data in the local DNS is cleared.
[0134] After clearing the local domain name data in the local DNS, when the client sends a domain name resolution query request to the local DNS (i.e. route 1), the local DNS forwards the domain name resolution query request to the local top-level authoritative mirror (i.e. route 5).
[0135] The local top-level authoritative mirror then determines the target IP address corresponding to the target domain name in the domain name resolution query request in the local mirror cache, and returns the target IP address to the client through the local DNS (i.e., route 6, route 4), so that the client can normally access the website or service corresponding to the target IP address.
[0136] Based on the same inventive concept, the present application also provides a data comparison device, such as Figure 4 The figure is a schematic diagram of the structure of a data comparison device provided by the present application, the device comprising:
[0137] The acquisition module 401 is used to acquire the authoritative top-level domain name data from the deployed local top-level authoritative mirror; wherein the local top-level authoritative mirror stores the authoritative top-level domain name data synchronized from the authoritative domain name system DNS;
[0138] The processing module 402 is used to compare the local domain name data in the local DNS with the authoritative top-level domain name data.
[0139] In a possible implementation, the acquisition module 401 is specifically configured to perform the following synchronization update operation for each of the authoritative top-level domain name data in the local top-level authoritative mirror at a first time interval:
[0140] Determine whether the authoritative top-level domain name data in the local top-level authoritative mirror is consistent with the real data of the authoritative top-level domain name in the authoritative DNS;
[0141] If not, update the real data of the authoritative top-level domain name to the local top-level authoritative mirror.
[0142] In a possible implementation, the acquisition module 401 is specifically configured to check, at second intervals, by digital signature verification, whether the authoritative top-level domain name data in the local top-level authoritative mirror has integrity.
[0143] In a possible implementation, the acquisition module 401 is specifically configured to record the synchronization update result corresponding to the synchronization update operation and record the integrity check result;
[0144] A security log is generated according to the synchronous update result and the inspection result.
[0145] In a possible implementation, the processing module 402 is specifically configured to mark the inconsistent local domain name data as abnormal data if it is determined that there is local domain name data in the local DNS that is inconsistent with the authoritative top-level domain name data;
[0146] If it is determined that the amount of the abnormal data meets the abnormal condition, the local domain name data in the local DNS is cleared.
[0147] In a possible implementation, the processing module 402 is specifically configured to query the target IP address corresponding to the target domain name in the domain name resolution query request through the local top-level authoritative mirror when the client sends the domain name resolution query request to the local DNS.
[0148] In a possible implementation, the device further includes a monitoring module, the monitoring module being used to monitor the operating status and performance indicators of the local top-level authoritative image;
[0149] If it is determined that the operating state is abnormal or it is determined that the performance indicator is greater than a performance indicator threshold, a warning message indicating that the local top-level authoritative image is abnormal is issued.
[0150] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application. The electronic device can realize the functions of the aforementioned data comparison device. Figure 5 , the electronic equipment includes:
[0151] At least one processor 501, and a memory 502 connected to the at least one processor 501. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 In the example, the processor 501 and the memory 502 are connected via a bus 500. The bus 500 is Figure 5 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 500 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 501 can also be called a controller, and there is no limitation on the name.
[0152] In the embodiment of the present application, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute the data comparison method discussed above by executing the instructions stored in the memory 502. The processor 501 can implement Figure 4 The functions of each module in the device shown.
[0153] Among them, the processor 501 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 502 and calling data stored in the memory 502, the various functions of the device and processing data, the device can be monitored as a whole.
[0154] In one possible design, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0155] Processor 501 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the data comparison method disclosed in the embodiments of the present application can be directly embodied as a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0156] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (English: Random Access Memory, abbreviated as RAM), a static random access memory (English: Static Random Access Memory, abbreviated as SRAM), a programmable read-only memory (English: Programmable Read Only Memory, abbreviated as PROM), a read-only memory (English: Read Only Memory, abbreviated as ROM), an electrically erasable programmable read-only memory (English: Electrically Erasable Programmable Read-Only Memory, abbreviated as EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0157] By designing and programming the processor 501, the code corresponding to the data comparison method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 The steps of the data comparison method in the embodiment shown are as follows: How to design and program the processor 501 is a technique known to those skilled in the art and will not be described in detail here.
[0158] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the data comparison method discussed above.
[0159] In some possible implementations, various aspects of the data comparison method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the data comparison method according to various exemplary implementations of the present application described above in this specification.
[0160] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0161] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0162] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0164] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data comparison method, It is characterized in that include: Obtaining authoritative top-level domain name data from a deployed local top-level authoritative mirror; wherein the local top-level authoritative mirror stores the authoritative top-level domain name data synchronized from the authoritative domain name system DNS; Compare the local domain name data in the local DNS with the authoritative top-level domain name data.
2. The method according to claim 1, It is characterized in that Before obtaining the authoritative top-level domain name data from the deployed local top-level authoritative mirror, the method further includes: At first intervals, for each of the authoritative top-level domain name data in the local top-level authoritative mirror, the following synchronization update operation is performed: Determine whether the authoritative top-level domain name data in the local top-level authoritative mirror is consistent with the real data of the authoritative top-level domain name in the authoritative DNS; If not, update the real data of the authoritative top-level domain name to the local top-level authoritative mirror.
3. The method according to claim 1, It is characterized in that Before obtaining the authoritative top-level domain name data from the deployed local top-level authoritative mirror, the method further includes: Every second time, check whether the authoritative top-level domain name data in the local top-level authoritative mirror has integrity through digital signature verification.
4. The method according to any one of claims 2 to 3, It is characterized in that The method further comprises: Recording the synchronization update result corresponding to the synchronization update operation and recording the integrity check result; A security log is generated according to the synchronous update result and the inspection result.
5. The method according to claim 1, It is characterized in that After comparing the local domain name data in the local DNS with the authoritative top-level domain name data, the method further includes: If it is determined that there is local domain name data in the local DNS that is inconsistent with the authoritative top-level domain name data, marking the inconsistent local domain name data as abnormal data; If it is determined that the amount of the abnormal data meets the abnormal condition, the local domain name data in the local DNS is cleared.
6. The method according to claim 5, It is characterized in that After determining that the amount of abnormal data meets the abnormal condition, the method further includes: When the client sends a domain name resolution query request to the local DNS, the target IP address corresponding to the target domain name in the domain name resolution query request is queried through the local top-level authoritative mirror.
7. The method according to claim 1, It is characterized in that The method further comprises: Monitor the operating status and performance indicators of the local top-level authoritative image; If it is determined that the operating state is abnormal or it is determined that the performance indicator is greater than a performance indicator threshold, a warning message indicating that the local top-level authoritative image is abnormal is issued.
8. A data comparison device, It is characterized in that include: An acquisition module, used to acquire authoritative top-level domain name data from a deployed local top-level authoritative mirror; wherein the local top-level authoritative mirror stores the authoritative top-level domain name data synchronized from the authoritative domain name system DNS; The processing module is used to compare the local domain name data in the local DNS with the authoritative top-level domain name data.
9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to implement the method steps of any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.
