CDN service node detection method and system and readable storage medium
By performing EDNS DNS domain name resolution and CDN service database matching on CDN service nodes, the problem of inaccurate CDN node IP address acquisition in cross-border access traffic is solved, low-cost and efficient node IP address collection is achieved, and cross-border access is ensured. Traffic accuracy.
Patent Information
- Application Number
- CN202410960218.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-01
AI Technical Summary
When obtaining cross-border access traffic for important websites that use CDN technology, it is difficult to accurately obtain all node IP addresses that the CDN service provider can actually provide, resulting in inaccurate acquisition of cross-border access traffic.
By obtaining user IP addresses from different regions and operators, perform EDNS DNS domain name resolution on the domain name of the website to be detected, detect CNAME records, perform service provider matching search and data association in the CDN service database, and collect the node IP addresses of CDN service providers.
It achieves a complete and timely collection of node IP addresses that can actually be provided by CDN service providers, ensuring the accuracy of cross-border access traffic and reducing hardware and operating costs.
Smart Images

Figure CN118740794A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a CDN service node detection method and system and a readable storage medium. Background Art
[0002] With the continuous development of Internet technology and the continuous changes in the international situation, national network security issues have gradually become an important issue of increasing concern to people. Among them, achieving cross-border network traffic situation awareness, mastering cross-border network traffic situation, mastering asset information of important targets within the country, and deepening cross-border network traffic behavior analysis are some of the key issues of national network security. When describing the cross-border network traffic situation, it is still difficult to accurately obtain cross-border access traffic and describe the network situation for important websites using CDN (Content Delivery Network) technology.
[0003] At present, there are at least the following difficulties in acquiring cross-border access traffic for important websites using CDN technology: the IP (Internet Protocol) addresses that important websites using CDN technology provide services to visiting users actually belong to the IP addresses in the node IP address pool of the CDN service provider. When users from different regions and at different times visit the same important website using CDN technology, the CDN node IP addresses actually used by the important website may be different. The corresponding CDN service provider's active CDN node IP address set that provides CDN services to the important website every day will change dynamically. Therefore, how to accurately obtain all the node IP addresses that the corresponding CDN service provider can actually provide is an important technical issue in the current process of acquiring cross-border access traffic. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a CDN service node detection method and system and a readable storage medium, which can collect user IP addresses from different regions and / or operators to perform ECS (EDNS (Extension Mechanisms for DNS) Client Subnet) DNS (Domain Name System) domain name resolution for the domain name of the website to be detected, and collect node IP addresses of CDN service providers that provide effective CDN services to the domain name of the website to be detected based on the corresponding domain name resolution results, so as to accurately obtain all node IP addresses that the corresponding CDN service provider can actually provide.
[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, the present application provides a CDN service node detection method, the method comprising:
[0007] Obtain the domain name of the website to be detected, and multiple user IP addresses with different corresponding IP locations and / or IP operators;
[0008] For each user IP address, perform ECSDNS domain name resolution for the domain name of the website to be detected based on the user IP address, and obtain a target domain name resolution result that is adapted to the IP location of the user IP address;
[0009] Detect whether there is at least one CNAME (Canonical Name) record associated with the domain name of the website to be detected in the target domain name resolution result;
[0010] In the case where it is detected that the at least one CNAME record exists in the target domain name resolution result, a primary CNAME domain name matching the domain name of the website to be detected is determined based on the at least one CNAME record, and a CDN service database is called to perform a service provider matching search on the primary CNAME domain name, wherein the primary CNAME domain name is a CNAME domain name that provides effective CDN services for the domain name of the website to be detected;
[0011] When a first CDN service provider matching the primary CNAME domain name is found in the CDN service database, data association is performed in the CDN service database between the first CDN service provider and the service node IP address recorded in each domain name pointing address record in the target domain name resolution result.
[0012] In an optional embodiment, the method further comprises:
[0013] When the first CDN service provider cannot be found in the CDN service database, performing an HTTP request based on all service node IP addresses corresponding to the target domain name resolution result and the primary CNAME domain name to obtain corresponding first HTTP response information;
[0014] Extracting CDN identification attributes from the first HTTP response information, and calling the CDN service database to perform service provider feature matching on the extracted first CDN identification attribute information to determine the second CDN service provider to which the first CDN identification attribute information belongs;
[0015] Data association is performed in the CDN service database for all service node IP addresses corresponding to the second CDN service provider, the primary CNAME domain name, and the target domain name resolution result.
[0016] In an optional embodiment, the method further comprises:
[0017] In the case where it is detected that there is no CNAME record in the target domain name resolution result, detecting whether the to-be-detected website domain name actually uses the CDN service based on the target domain name resolution result;
[0018] When it is detected that the website domain name to be detected actually uses CDN service, the CDN service database is called to perform service provider matching search on all service node IP addresses corresponding to the target domain name resolution result;
[0019] When a third CDN service provider matching at least one service node IP address is found in the CDN service database, data association is performed between the third CDN service provider and all service node IP addresses corresponding to the target domain name resolution result in the CDN service database.
[0020] In an optional embodiment, the method further comprises:
[0021] In the case where the third CDN service provider cannot be found from the CDN service database, performing an HTTP request based on all service node IP addresses corresponding to the target domain name resolution result and the domain name of the website to be detected to obtain corresponding second HTTP response information;
[0022] Extracting CDN identification attributes from the second HTTP response information, and calling the CDN service database to perform service provider feature matching on the extracted second CDN identification attribute information to determine a fourth CDN service provider to which the second CDN identification attribute information belongs;
[0023] Data association is performed in the CDN service database between the fourth CDN service provider and all service node IP addresses corresponding to the target domain name resolution result.
[0024] In an optional implementation, the step of detecting whether the to-be-detected website domain name actually uses CDN services based on the target domain name resolution result includes:
[0025] Identify the record type of each domain name pointing address record in the target domain name resolution result, and obtain the actual number of records corresponding to each domain name pointing address record type in the target domain name resolution result;
[0026] For each domain name pointing to address record type, check whether the actual number of records corresponding to the domain name pointing to address record type is greater than 1;
[0027] If it is detected that the actual number of records corresponding to at least one domain name pointing to address record type is greater than 1, it is determined that the website domain name to be detected actually uses the CDN service; otherwise, it is determined that the website domain name to be detected does not actually use the CDN service.
[0028] In an optional implementation, for each user IP address, performing ECSDNS domain name resolution for the domain name of the website to be detected based on the user IP address, and obtaining a target domain name resolution result adapted to the IP location of the user IP address includes:
[0029] According to the subnet mask currently used by the user's IP address, calculate the actual subnet information of the subnet where the user's IP address currently resides;
[0030] Send a domain name resolution request to the target authoritative DNS server corresponding to the domain name of the website to be detected according to the user IP address and the actual subnet information, and receive a domain name resolution response message fed back by the target authoritative DNS server, wherein each domain name included in the domain name resolution response message points to the IP location of the service node IP address recorded in the address record closest to the IP location of the user IP address;
[0031] The domain name resolution response message is used as a target domain name resolution result corresponding to the user IP address and the domain name of the website to be detected.
[0032] In an optional implementation manner, when there is only one CNAME record associated with the website domain name to be detected in the target domain name resolution result, the step of determining the primary CNAME domain name matching the website domain name to be detected based on the at least one CNAME record includes:
[0033] Extract the target CNAME domain name directly pointed to by the website domain name to be detected from the obtained CNAME record;
[0034] The extracted target CNAME domain name is directly used as the primary CNAME domain name.
[0035] In an optional implementation, when there are multiple CNAME records associated with the website domain name to be detected in the target domain name resolution result, the step of determining the primary CNAME domain name matching the website domain name to be detected based on the at least one CNAME record includes:
[0036] Extracting domain names from the multiple CNAME records obtained respectively, and obtaining a domain name pointing transfer relationship between the domain name of the website to be detected and the multiple CNAME domain names;
[0037] Based on the domain name pointing transfer relationship, determine a target CNAME domain name at the last transfer position among the multiple CNAME domain names;
[0038] The target CNAME domain name will be directly used as the primary CNAME domain name.
[0039] In a second aspect, the present application provides a CDN service node detection system, the system comprising a scheduling center and a plurality of detection units;
[0040] The dispatch center is respectively connected to the plurality of detection units for controlling the corresponding detection unit to perform a DNS domain name resolution operation or an HTTP request operation based on a single user IP address;
[0041] The dispatch center also stores a computer program and can execute the computer program to cooperate with the plurality of detection units to implement the CDN service node detection method described in any one of the aforementioned implementations.
[0042] In a third aspect, the present application provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a communication device, the CDN service node detection method described in any one of the aforementioned implementations is implemented.
[0043] In this case, the beneficial effects of the embodiments of the present application may include the following:
[0044] The present application performs ECSDNS domain name resolution for the domain name of the website to be detected based on multiple user IP addresses with different corresponding IP locations and / or IP operators, obtains a target domain name resolution result adapted to the IP location of the corresponding user IP address, and when it is determined that there is at least one CNAME record associated with the domain name of the website to be detected in the target domain name resolution result, determines the primary CNAME domain name matching the domain name of the website to be detected based on the at least one CNAME record, and then searches the CDN service database for the first CDN service provider matching the primary CNAME domain name, and performs data association between the service node IP addresses recorded in the address records pointing to each domain name in the target domain name resolution result and the found first CDN service provider in the CDN service database, so that the node IP address collection operation can be completed at the CDN service database for the CDN service provider that provides effective CDN services to the domain name of the website to be detected, ensuring that the node IP addresses that can actually be provided by the corresponding CDN service provider are collected as completely and timely as possible, so as to facilitate the accurate acquisition of all node IP addresses that can actually be provided by the corresponding CDN service provider.
[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A schematic diagram of the composition of a CDN service node detection system provided in an embodiment of the present application;
[0048] Figure 2 One of the flow charts of the CDN service node detection method provided in the embodiment of the present application;
[0049] Figure 3 A second flowchart of a CDN service node detection method provided in an embodiment of the present application;
[0050] Figure 4 The third flowchart of the CDN service node detection method provided in the embodiment of the present application;
[0051] Figure 5 The fourth flowchart of the CDN service node detection method provided in the embodiment of the present application.
[0052] Icons: 10-CDN service node detection system; 11-dispatching center; 12-detection unit. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0054] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0056] In the description of the present application, it is to be understood that the relational terms such as the term "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "includes", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "comprising one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood by specific circumstances.
[0057] The applicant has found through hard research that the existing solutions for obtaining the node IP address of the corresponding CDN service provider for a specific website basically include the following two:
[0058] Solution 1: Deploy multiple physical detection nodes for different operators in different regions around the world, and use each physical detection node to periodically simulate real users visiting specific websites, and then perform data analysis on the website access results to determine the CDN service provider used by the specific website, as well as the node IP address provided by the corresponding CDN service provider for the specific website. It is worth noting that this solution requires dedicated personnel to operate and maintain the physical detection nodes, and has the disadvantage of high node IP address collection costs.
[0059] Solution 2: Directly ask major CDN service providers around the world for the node IP addresses associated with a specific website. However, it is worth noting that this solution often has the problem that most CDN service providers do not provide all node IP addresses, and the node IP address set associated with the specific website is dynamically updated, resulting in the node IP address finally obtained may be outdated data information, which in turn leads to inaccurate cross-border access traffic acquisition.
[0060] In this case, the embodiments of the present application provide a CDN service node detection method and system and a readable storage medium, which collects node IP addresses for CDN service providers that provide CDN services to specific websites at a relatively low cost, thereby ensuring that the node IP addresses that can actually be provided by the corresponding CDN service provider are collected as completely and timely as possible, thereby facilitating accurate acquisition of all node IP addresses that can actually be provided by the corresponding CDN service provider, and thereby ensuring that the final cross-border access traffic acquisition results have a sufficiently high accuracy.
[0061] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0062] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of the composition of the CDN service node detection system 10 provided in the embodiment of the present application. In the embodiment of the present application, the CDN service node detection system 10 may include a dispatching center 11 and a plurality of detection units 12; wherein the dispatching center 11 is respectively connected in communication with the plurality of detection units 12, and is used to control the corresponding detection unit 12 to perform a DNS domain name resolution operation or an HTTP (Hypertext Transfer Protocol) request operation based on a single user IP address, so as to obtain the website access result of the corresponding detection unit 12 for a specific website based on the user IP address, and collect CDN node IP addresses for the obtained website access result, so as to utilize a relatively low cost to perform a node IP address collection operation for a CDN service provider that provides CDN services to a specific website, ensure that the node IP addresses that the corresponding CDN service provider can actually provide are collected as completely and timely as possible, facilitate accurate acquisition of all node IP addresses that the corresponding CDN service provider can actually provide, and further ensure that the final cross-border access traffic acquisition result has a sufficiently high accuracy.
[0063] In an embodiment of the present application, the dispatching center 11 and the multiple detection units 12 can be integrated in the same communication device; the dispatching center 11 and the multiple detection units 12 can also be implemented using a distributed system to improve the accuracy, timeliness and high availability of node IP address collection, etc., wherein the number of user IP addresses used, IP locations and / or IP operators can be adjusted at any time according to the node IP address collection requirements, without being restricted by the actual detection node deployment. At the same time, the number of detection units 12 can also be increased or decreased at any time according to the node IP address collection requirements to flexibly respond to the node IP address collection business needs.
[0064] The CDN service node detection system 10 provided in the embodiment of the present application does not need to deploy multiple physical detection nodes for different operators in different regions within and outside the country, so as to effectively save the hardware cost, operation cost and operation and maintenance cost required for the node IP address collection operation.
[0065] In an embodiment of the present application, the dispatch center 11 also stores a computer program, and can drive the plurality of detection units 12 to cooperate with the dispatch center 11 to collect node IP addresses for CDN service providers that provide CDN services to specific websites at a relatively low cost by running the computer program, thereby ensuring that the node IP addresses that can actually be provided by the corresponding CDN service provider are collected as completely and timely as possible, so as to facilitate accurate acquisition of all node IP addresses that can actually be provided by the corresponding CDN service provider, thereby ensuring that the final cross-border access traffic acquisition result has a sufficiently high accuracy.
[0066] In the present application, in order to ensure that the CDN service node detection system 10 can collect node IP addresses for CDN service providers that provide CDN services to specific websites at a relatively low cost, and ensure that the node IP addresses that can actually be provided by the corresponding CDN service provider are collected as completely and timely as possible, so as to facilitate accurate acquisition of all node IP addresses that can actually be provided by the corresponding CDN service provider, the present application embodiment provides a CDN service node detection method applied to the CDN service node detection system 10 to achieve the above-mentioned purpose. The CDN service node detection method provided by the present invention is described in detail below.
[0067] Please refer to Figure 2 , Figure 2 This is one of the flow charts of the CDN service node detection method provided in the embodiment of the present application. In the embodiment of the present application, Figure 2 The CDN service node detection method shown may include steps S210 to S250.
[0068] Step S210, obtaining the domain name of the website to be detected, and a plurality of user IP addresses with different corresponding IP locations and / or IP operators.
[0069] Among them, the domain name of the website to be detected can be set by the user of the CDN service node detection system 10 according to business needs; the multiple user IP addresses can be randomly obtained from the user IP address library by the dispatch center 11 in the CDN service node detection system 10 every day, and the IP territories and / IP operators corresponding to the multiple user IP addresses are different from each other; the user IP address library records at least one user IP address of all provinces, autonomous regions and municipalities in China at operators such as China Mobile, China Unicom and China Telecom, as well as at least one user IP address of regions and countries outside China including South America, North America, Europe, East Asia, South Asia, Southeast Asia, etc. under the corresponding operator, wherein the user IP addresses recorded in the user IP address library will be regularly updated to ensure that the multiple user IP addresses obtained by the CDN service node detection system 10 every day have sufficiently high authenticity and reliability.
[0070] Step S220: For each user IP address, perform ECSDNS domain name resolution for the domain name of the website to be detected based on the user IP address to obtain a target domain name resolution result that is adapted to the IP location of the user IP address.
[0071] In this embodiment, after the dispatch center 11 obtains the domain name of the website to be detected and multiple user IP addresses, it will allocate user IP addresses for the multiple detection units 12 that are communicatively connected to the dispatch center 11, so that each detection unit 12 will use each allocated user IP address as an ECS client IP address to perform ECS DNS domain name resolution for the domain name of the website to be detected, thereby obtaining target domain name resolution results corresponding to each of the multiple user IP addresses, wherein the target domain name resolution result corresponding to a single user IP address includes at least one domain name pointing to an address record in which the service node IP address recorded is adapted to the IP location of the user IP address.
[0072] Optionally, in an implementation of this embodiment, step S220 may include:
[0073] For each user IP address, calculate the actual subnet information of the subnet where the user IP address currently resides based on the subnet mask currently used by the user IP address;
[0074] Send a domain name resolution request to the target authoritative DNS server corresponding to the domain name of the website to be detected according to the user IP address and the actual subnet information, and receive a domain name resolution response message fed back by the target authoritative DNS server, wherein each domain name included in the domain name resolution response message points to the IP location of the service node IP address recorded in the address record closest to the IP location of the user IP address;
[0075] The domain name resolution response message is used as a target domain name resolution result corresponding to the user IP address and the domain name of the website to be detected.
[0076] Among them, the target authoritative DNS server is pre-configured with a mapping relationship between multiple service node IP addresses that have been filed by major CDN service providers and the domain name of the website to be detected. At the same time, the target authoritative DNS server can also be used to store CNAME records provided by major CDN service providers for the domain name of the website to be detected, wherein the CNAME record is used to point a domain name (including the domain name of the website to be detected or the CNAME domain name) to a CNAME domain name. Therefore, when the target authoritative DNS server receives a domain name resolution request, it will perform information retrieval based on the user IP address and actual subnet information recorded in the domain name resolution request, so as to feedback to the corresponding detection unit 12 at least the service node IP address of the IP location closest to the user IP address.
[0077] Step S230, detecting whether there is at least one CNAME record associated with the domain name of the website to be detected in the target domain name resolution result.
[0078] In this embodiment, when the dispatch center 11 obtains the target domain name resolution result corresponding to a user IP address from each detection unit 12, it will perform content analysis on the target domain name resolution result to determine whether there is at least one CNAME record associated with the website domain name to be detected in the target domain name resolution result. Among them, if there is at least one CNAME record in the corresponding target domain name resolution result, it indicates that the website domain name to be detected actually uses the CDN service, and this application will execute step S240 accordingly; if there is no CNAME record in the corresponding target domain name resolution result, it indicates that the website domain name to be detected may use the CDN service, but the CDN service provider that provides effective CDN service for the website domain name to be detected has not configured a CNAME domain name for the website domain name to be detected.
[0079] Step S240: determine the primary CNAME domain name that matches the domain name of the website to be detected based on at least one CNAME record, and call the CDN service database to perform a service provider matching search on the primary CNAME domain name.
[0080] In this embodiment, when there is at least one CNAME record in the target domain name resolution result corresponding to any user IP address, the scheduling center 11 will perform content analysis on the at least one CNAME record to determine the primary CNAME domain name recorded in the target domain name resolution result that provides effective CDN service to the website domain name to be detected, and then call the CDN service database stored in itself to perform a service provider matching search on the primary CNAME domain name to determine whether the CDN service database currently records a first CDN service provider that matches the primary CNAME domain name. Among them, the CDN service database can be used to record the CNAME domain name configured for the website domain name to be detected, as well as the association relationship between the recorded CNAME domain names and major CDN service providers; when the CDN service database has a first CDN service provider that matches the primary CNAME domain name, it indicates that the first CDN service provider has been recorded in the CDN service database, and at the same time, the first CDN service provider is actually providing effective CDN services for the website domain name to be detected. At this time, the present application will execute step S250 accordingly; when the CDN service database does not have a first CDN service provider that matches the primary CNAME domain name, it indicates that the CDN service provider that configures the primary CNAME domain name for the website domain name to be detected has not yet been recorded in the CDN service database.
[0081] Optionally, in an implementation of this embodiment, when there is only one CNAME record in the target domain name resolution result corresponding to any user IP address, the step of "determining the primary CNAME domain name matching the domain name of the website to be detected based on at least one CNAME record" in step S240 may include:
[0082] Extract the target CNAME domain name directly pointed to by the website domain name to be detected from the obtained CNAME record;
[0083] The extracted target CNAME domain name is directly used as the primary CNAME domain name.
[0084] Take the example that there is only one CNAME record "domain name A→domain name B" in the target domain name resolution result corresponding to a user's IP address, where "domain name A" is used to represent the domain name of the website to be detected, and "domain name B" is used to represent the target CNAME domain name directly pointed to by the domain name of the website to be detected. At this time, "domain name B" is the primary CNAME domain name in the target domain name resolution result that matches the domain name of the website to be detected.
[0085] Optionally, in another implementation of this embodiment, when there are multiple CNAME records in the target domain name resolution result corresponding to any user IP address, the step of "determining the primary CNAME domain name matching the domain name of the website to be detected based on at least one CNAME record" in step S240 may include:
[0086] Extracting domain names from the obtained multiple CNAME records respectively to obtain a domain name pointing transfer relationship between the domain name of the website to be detected and the multiple CNAME domain names, wherein the domain name pointing transfer relationship is used to represent the domain name pointing status between the domain name of the website to be detected and the multiple CNAME domain names;
[0087] Based on the domain name pointing transfer relationship, determine a target CNAME domain name at the last transfer position among the multiple CNAME domain names;
[0088] The target CNAME domain name will be directly used as the primary CNAME domain name.
[0089] For example, if there are three CNAME records in the target domain name resolution result corresponding to a user IP address, the three CNAME records are "domain name A→domain name B", "domain name B→domain name C" and "domain name C→domain name D" respectively, where "domain name A" is used to represent the domain name of the website to be detected, "domain name B", "domain name C" and "domain name D" are all CNAME domain names of the website domain name to be detected. At this time, the domain name pointing transfer relationship between the website domain name to be detected and the three CNAME domain names can be expressed as "domain name A→domain name B→domain name C→domain name D", and the target CNAME domain name at the last transfer position in the domain name pointing transfer relationship is "domain name D", so "domain name D" is the main CNAME domain name that matches the website domain name to be detected in the target domain name resolution result.
[0090] Step S250: When a first CDN service provider matching the primary CNAME domain name is found in the CDN service database, data association is performed between the first CDN service provider and the service node IP address recorded in each domain name pointing address record in the target domain name resolution result in the CDN service database.
[0091] In this embodiment, the CDN service database is also used to store the association relationship between the recorded major CDN service providers and the IP addresses of the service nodes used to provide website services for the website domain name to be detected; the scheduling center 11 can, when determining the first CDN service provider corresponding to the target domain name resolution result corresponding to a user IP address, determine that all the service node IP addresses recorded in the domain name pointing address record of the target domain name resolution result actually belong to the first CDN service provider. At this time, the scheduling center 11 can generate a list of service node IP addresses for the website domain name to be detected for the first CDN service provider by associating data with the first CDN service provider and the corresponding target domain name resolution result in the CDN service database, and then export the list for network security personnel to view.
[0092] Therefore, the present application can execute the above-mentioned steps S210 to S250, use the user IP addresses of different regions and / or operators to perform ECSDNS domain name resolution on the domain name of the website to be detected, and collect node IP addresses of CDN service providers that provide effective CDN services to the domain name of the website to be detected based on the corresponding domain name resolution results, so as to achieve the effect of "collecting node IP addresses for CDN service providers that provide CDN services to specific websites at a relatively low cost, ensuring that the node IP addresses that can actually be provided by the corresponding CDN service providers are collected as completely and timely as possible, so as to facilitate the accurate acquisition of all node IP addresses that can actually be provided by the corresponding CDN service providers". There is no need to deploy multiple physical detection nodes for different operators in different regions within and outside the country, which effectively saves the hardware cost, operating cost and operation and maintenance cost required for the node IP address collection operation.
[0093] Optionally, see Figure 3 , Figure 3 This is the second flow chart of the CDN service node detection method provided in the embodiment of the present application. In the embodiment of the present application, Figure 3 The CDN service node detection method shown is similar to Figure 2 The CDN service node detection method shown in FIG. 1 has the same steps S210 to S240, but Figure 3 The CDN service node detection method shown is similar to Figure 2 The differences between the CDN service node detection methods shown are: Figure 3 The actual steps of the CDN service node detection method shown in the figure, which are performed after step S240, include steps S260 to S280, so as to further improve the comprehensiveness of collecting node IP addresses of CDN service providers involved in the website domain name to be detected through steps S260 to S280.
[0094] Step S260: When the first CDN service provider cannot be found from the CDN service database, an HTTP request is made based on all service node IP addresses and primary CNAME domain names corresponding to the target domain name resolution result to obtain corresponding first HTTP response information.
[0095] In this embodiment, when the scheduling center 11 completes the step S240 for the target domain name resolution result corresponding to any user IP address, and determines that the primary CNAME domain name corresponding to the target domain name resolution result does not have a matching first CDN service provider in the CDN service database, it indicates that the CDN service provider that configures the primary CNAME domain name for the website domain name to be detected is not temporarily recorded in the CDN service database. At this time, the scheduling center 11 will control the detection unit 12 responsible for the user IP address to execute the step S260 accordingly.
[0096] Step S270: extract CDN identification attributes from the first HTTP response information, and call the CDN service database to perform service provider feature matching on the extracted first CDN identification attribute information to determine the second CDN service provider to which the first CDN identification attribute information belongs.
[0097] In this embodiment, the CDN service database is also used to store information such as the service provider names and CDN service technical characteristics of major CDN service providers; after obtaining the first HTTP response information corresponding to any user IP address, the dispatch center 11 will extract the first CDN identification attribute information related to the CDN service provider from the first HTTP response information (including the response header content and the response body content of the first HTTP response information), and determine the second CDN service provider to which the first CDN identification attribute information actually belongs by calling the CDN service database to match the service provider characteristics of the first CDN identification attribute information. At this time, the second CDN service provider is a CDN service provider that has configured the primary CNAME domain name for the domain name of the website to be detected but has not been recorded in the CDN service database.
[0098] Step S280: Data association is performed on all service node IP addresses corresponding to the second CDN service provider, the primary CNAME domain name, and the target domain name resolution result in the CDN service database.
[0099] In this embodiment, the scheduling center 11 can, when determining the primary CNAME domain name and the second CDN service provider involved in the target domain name resolution result corresponding to a user IP address, determine that all service node IP addresses recorded in the domain name pointing address record of the target domain name resolution result actually belong to the second CDN service provider. At this time, the scheduling center 11 can generate a list of service node IP addresses for the website domain name to be detected for the second CDN service provider by associating data between the second CDN service provider and the primary CNAME domain name and each service node IP address involved in the corresponding target domain name resolution result in the CDN service database, so as to facilitate network security personnel to view.
[0100] Therefore, the present application can further improve the comprehensiveness of collecting node IP addresses of the CDN service provider involved in the website domain name to be detected by executing the above steps S210 to S240 and steps S260 to S280.
[0101] Optionally, see Figure 4 , Figure 4 This is the third flow chart of the CDN service node detection method provided in the embodiment of the present application. Figure 4 The CDN service node detection method shown is similar to Figure 2 The CDN service node detection method shown in FIG. 1 has the same steps S210 to S230, but Figure 4 The CDN service node detection method shown is similar to Figure 2 The differences between the CDN service node detection methods shown are: Figure 4 The actual steps of the CDN service node detection method shown in the figure after step S230 include steps S310 to S330, so as to collect more comprehensive node IP addresses for CDN service providers that provide CDN services for the website domain to be detected but do not configure CNAME domain names.
[0102] Step S310: Detect whether the website domain name to be detected actually uses the CDN service based on the target domain name resolution result.
[0103] In this embodiment, when the dispatch center 11 can perform step S230 after determining the target domain name resolution result corresponding to any user IP address, and determines that there is no CNAME record in the target domain name resolution result, it means that the website domain name to be detected may use CDN service, but the CDN service provider that provides effective CDN service for the website domain name to be detected has not configured CNAME domain name for the website domain name to be detected, and the dispatch center 11 will execute step S310 accordingly. Among them, the dispatch center 11 will determine whether the website domain name to be detected actually uses CDN service based on all domain name pointing address records recorded in the target domain name resolution result, and if it is determined that the website domain name to be detected actually uses CDN service, it will execute step S320 accordingly.
[0104] Optionally, in an implementation of this embodiment, step S310 may include:
[0105] Identify the record type of each domain name pointing address record in the target domain name resolution result, and obtain the actual number of records corresponding to each domain name pointing address record type in the target domain name resolution result;
[0106] For each domain name pointing to address record type, check whether the actual number of records corresponding to the domain name pointing to address record type is greater than 1;
[0107] If it is detected that the actual number of records corresponding to at least one domain name pointing to address record type is greater than 1, it is determined that the website domain name to be detected actually uses the CDN service; otherwise, it is determined that the website domain name to be detected does not actually use the CDN service.
[0108] The domain name pointing to address record types involved in the above record type identification operation may include A record (Address Record) and AAAA record, wherein the A record is used to map the domain name to an IPv4 address, and the AAAA record is used to map the domain name to an IPv6 address.
[0109] Step S320: When it is detected that the domain name of the website to be detected actually uses the CDN service, the CDN service database is called to perform service provider matching searches on all service node IP addresses corresponding to the target domain name resolution result.
[0110] In this embodiment, when the scheduling center 11 determines that the domain name of the website to be detected actually uses the CDN service, it means that the CDN service provider pointed to by the target domain name resolution result without CNAME record currently provides CDN service for the domain name of the website to be detected. At this time, the scheduling center 11 can perform service provider matching search in the CDN service database for all service node IP addresses involved in the target domain name resolution result to determine whether the CDN service database currently records a third CDN service provider that matches any service node IP address involved in the target domain name resolution result. Among them, when the CDN service database contains a third CDN service provider that matches any service node IP address involved in the target domain name resolution result, it indicates that the third CDN service provider has been recorded in the CDN service database, and the third CDN service provider is actually providing effective CDN services for the website domain name to be detected. At this time, the present application will execute step S330 accordingly; when the CDN service database does not contain a third CDN service provider that matches any service node IP address involved in the target domain name resolution result, it indicates that the CDN service provider that provides CDN services for the website domain name to be detected but has not configured a CNAME domain name has not been recorded in the CDN service database for the time being.
[0111] Step S330: when a third CDN service provider matching at least one service node IP address is found in the CDN service database, data association is performed on the third CDN service provider and all service node IP addresses corresponding to the target domain name resolution result in the CDN service database.
[0112] In this embodiment, when the scheduling center 11 finds a third CDN service provider that matches at least one service node IP address involved in a target domain name resolution result in the CDN service database, it can be determined that all service node IP addresses recorded in the domain name pointing address record of the target domain name resolution result actually belong to the third CDN service provider. At this time, the scheduling center 11 can generate a list of service node IP addresses for the website domain name to be detected for the third CDN service provider by associating data with the third CDN service provider and the corresponding service node IP addresses involved in the target domain name resolution result in the CDN service database, so that network security personnel can view it easily.
[0113] Therefore, the present application can perform a more comprehensive node IP address collection for the CDN service provider that provides CDN services for the website domain name to be detected but does not configure the CNAME domain name by executing the above steps S210 to S230 and steps S310 to S330.
[0114] Optionally, see Figure 5 , Figure 5 This is the fourth flow chart of the CDN service node detection method provided in the embodiment of the present application. In the embodiment of the present application, Figure 5 The CDN service node detection method shown is similar to Figure 4 The CDN service node detection method shown in FIG. 1 has the same steps S210 to S230 and steps S310 to S320, but Figure 5 The CDN service node detection method shown is similar to Figure 4 The differences between the CDN service node detection methods shown are: Figure 5 The actual steps performed by the CDN service node detection method shown after step S320 include steps S340 to S360, so as to further improve the comprehensiveness of node IP address collection for CDN service providers that provide CDN services to the website domain name to be detected but have not configured a CNAME domain name through steps S340 to S360.
[0115] Step S340, when the third CDN service provider cannot be found in the CDN service database, an HTTP request is made based on all service node IP addresses corresponding to the target domain name resolution result and the domain name of the website to be detected to obtain the corresponding second HTTP response information.
[0116] In this embodiment, when the scheduling center 11 completes the step S320 for the target domain name resolution result corresponding to any user IP address, and determines that there is no third CDN service provider in the CDN service database that matches any service node IP address involved in the target domain name resolution result, it means that the CDN service provider corresponding to the target domain name resolution result is not temporarily recorded in the CDN service database. At this time, the scheduling center 11 will control the detection unit 12 responsible for the user IP address to execute the step S340 accordingly.
[0117] Step S350: extract CDN identification attributes from the second HTTP response information, and call the CDN service database to perform service provider feature matching on the extracted second CDN identification attribute information to determine the fourth CDN service provider to which the second CDN identification attribute information belongs.
[0118] In this embodiment, after obtaining the second HTTP response information corresponding to any user IP address, the scheduling center 11 will extract the second CDN identification attribute information related to the CDN service provider from the second HTTP response information (including the response header content and the response body content of the second HTTP response information), and determine the fourth CDN service provider to which the second CDN identification attribute information actually belongs by calling the CDN service database to match the service provider characteristics of the second CDN identification attribute information. At this time, the fourth CDN service provider is a CDN service provider that has provided CDN services for the website domain name to be detected but has not been recorded in the CDN service database and has not been configured with a CNAME domain name.
[0119] Step S360: Data association is performed on all service node IP addresses corresponding to the fourth CDN service provider and the target domain name resolution result in the CDN service database.
[0120] In this embodiment, when determining the fourth CDN service provider corresponding to the target domain name resolution result corresponding to a user IP address, the scheduling center 11 can determine that all service node IP addresses recorded in the target domain name resolution result through the domain name pointing address record actually belong to the fourth CDN service provider. At this time, the scheduling center 11 can generate a list of service node IP addresses for the website domain name to be detected for the fourth CDN service provider by associating data with the fourth CDN service provider and each service node IP address involved in the corresponding target domain name resolution result in the CDN service database, so as to facilitate network security personnel to view.
[0121] Therefore, the present application can further improve the comprehensiveness of node IP address collection for CDN service providers that provide CDN services to the website domain name to be detected but do not configure the CNAME domain name by executing the above steps S210 to S230, steps S310 to S320 and steps S340 to S360.
[0122] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0123] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or communication device deployed with the above-mentioned CDN service node detection system 10) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned readable 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 code.
[0124] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A CDN service node detection method, characterized in that: The method comprises: Obtain the domain name of the website to be detected, and multiple user IP addresses with different corresponding IP locations and / or IP operators; For each user IP address, perform ECSDNS domain name resolution for the domain name of the website to be detected based on the user IP address, and obtain a target domain name resolution result that is adapted to the IP location of the user IP address; Detecting whether there is at least one CNAME record associated with the domain name of the website to be detected in the target domain name resolution result; In the case where it is detected that the at least one CNAME record exists in the target domain name resolution result, a primary CNAME domain name matching the domain name of the website to be detected is determined based on the at least one CNAME record, and a CDN service database is called to perform a service provider matching search on the primary CNAME domain name, wherein the primary CNAME domain name is a CNAME domain name that provides effective CDN services for the domain name of the website to be detected; When a first CDN service provider matching the primary CNAME domain name is found in the CDN service database, data association is performed in the CDN service database between the first CDN service provider and the service node IP address recorded in each domain name pointing address record in the target domain name resolution result.
2. The method according to claim 1, characterized in that The method further comprises: When the first CDN service provider cannot be found in the CDN service database, performing an HTTP request based on all service node IP addresses corresponding to the target domain name resolution result and the primary CNAME domain name to obtain corresponding first HTTP response information; Extracting CDN identification attributes from the first HTTP response information, and calling the CDN service database to perform service provider feature matching on the extracted first CDN identification attribute information to determine the second CDN service provider to which the first CDN identification attribute information belongs; Data association is performed in the CDN service database for all service node IP addresses corresponding to the second CDN service provider, the primary CNAME domain name, and the target domain name resolution result.
3. The method according to claim 1, characterized in that The method further comprises: In the case where it is detected that there is no CNAME record in the target domain name resolution result, detecting whether the to-be-detected website domain name actually uses the CDN service based on the target domain name resolution result; When it is detected that the domain name of the website to be detected actually uses the CDN service, the CDN service database is called to perform service provider matching and search for all service node IP addresses corresponding to the target domain name resolution result; When a third CDN service provider matching at least one service node IP address is found in the CDN service database, data association is performed between the third CDN service provider and all service node IP addresses corresponding to the target domain name resolution result in the CDN service database.
4. The method according to claim 3, characterized in that The method further comprises: In the case where the third CDN service provider cannot be found from the CDN service database, performing an HTTP request based on all service node IP addresses corresponding to the target domain name resolution result and the domain name of the website to be detected to obtain corresponding second HTTP response information; Extracting CDN identification attributes from the second HTTP response information, and calling the CDN service database to perform service provider feature matching on the extracted second CDN identification attribute information to determine a fourth CDN service provider to which the second CDN identification attribute information belongs; Data association is performed in the CDN service database between the fourth CDN service provider and all service node IP addresses corresponding to the target domain name resolution result.
5. The method according to claim 3, characterized in that: The step of detecting whether the website domain name to be detected actually uses the CDN service based on the target domain name resolution result includes: Identify the record type of each domain name pointing address record in the target domain name resolution result, and obtain the actual number of records corresponding to each domain name pointing address record type in the target domain name resolution result; For each domain name pointing to address record type, check whether the actual number of records corresponding to the domain name pointing to address record type is greater than 1; If it is detected that the actual number of records corresponding to at least one domain name pointing to address record type is greater than 1, it is determined that the website domain name to be detected actually uses the CDN service; otherwise, it is determined that the website domain name to be detected does not actually use the CDN service.
6. The method according to any one of claims 1 to 5, characterized in that: For each user IP address, based on the user IP address, an ECSDNS domain name resolution is performed for the domain name of the website to be detected to obtain a target domain name resolution result that matches the IP location of the user IP address, including: Calculate the actual subnet information of the subnet where the user's IP address currently resides based on the subnet mask currently used by the user's IP address; Send a domain name resolution request to the target authoritative DNS server corresponding to the domain name of the website to be detected according to the user IP address and the actual subnet information, and receive a domain name resolution response message fed back by the target authoritative DNS server, wherein each domain name included in the domain name resolution response message points to the IP location of the service node IP address recorded in the address record closest to the IP location of the user IP address; The domain name resolution response message is used as a target domain name resolution result corresponding to the user IP address and the domain name of the website to be detected.
7. The method according to any one of claims 1 to 5, characterized in that: In the case that there is only one CNAME record associated with the website domain name to be detected in the target domain name resolution result, the step of determining the primary CNAME domain name matching the website domain name to be detected based on the at least one CNAME record includes: Extract the target CNAME domain name directly pointed to by the website domain name to be detected from the obtained CNAME record; The extracted target CNAME domain name is directly used as the primary CNAME domain name.
8. The method according to any one of claims 1 to 5, characterized in that: In the case that there are multiple CNAME records associated with the website domain name to be detected in the target domain name resolution result, the step of determining the primary CNAME domain name matching the website domain name to be detected based on the at least one CNAME record includes: Extracting domain names from the multiple CNAME records obtained respectively, and obtaining a domain name pointing transfer relationship between the domain name of the website to be detected and the multiple CNAME domain names; Based on the domain name pointing transfer relationship, determine a target CNAME domain name at the last transfer position among the multiple CNAME domain names; The target CNAME domain name will be directly used as the primary CNAME domain name.
9. A CDN service node detection system, characterized in that: The system includes a dispatch center and a plurality of detection units; The dispatch center is respectively connected to the plurality of detection units for controlling the corresponding detection unit to perform a DNS domain name resolution operation or an HTTP request operation based on a single user IP address; The dispatch center also stores a computer program and can execute the computer program to cooperate with the multiple detection units to implement the CDN service node detection method described in any one of claims 1-8.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a communication device, the CDN service node detection method described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Method and system for recording and identifying specific CDN (Content Delivery Network) traffic based on domain name CANME
CN121217622A
