A DNS request processing method, apparatus, electronic device, and storage medium

By constructing a QNAME model and performing tag matching and adding rules for DNS request processing, the contradiction between privacy and success rate in DNS resolution is resolved, achieving the effect of improving resolution success rate while ensuring privacy and security.

CN119946140BActive Publication Date: 2026-01-30CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311457117.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2026-01-30
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

Existing DNS resolution methods have a low success rate in terms of ensuring privacy and security, especially in CDN scenarios where the success rate drops significantly.

Method used

By constructing a QNAME model, the target domain name in the DNS request is matched with the pre-created QNAME model, and query tags are added according to the matching tag addition rules to perform iterative queries and improve the resolution success rate.

Benefits of technology

While reducing the risk of user privacy leaks, it improves the success rate of DNS request resolution, especially significantly improving resolution efficiency in CDN scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946140B_ABST
    Figure CN119946140B_ABST
Patent Text Reader

Abstract

This application provides a DNS request processing method, apparatus, electronic device, and storage medium. The method includes: obtaining a DNS request to be resolved; matching the target domain name QNAME in the DNS request with the QNAME of a pre-created QNAME model; and, if the target domain name matches at least a portion of the QNAME in the pre-created QNAME model, adding query tags to the target domain name according to the tag addition rules of the matched QNAME model, to request a recursive query response result from the target server. This application constructs a QNAME model and performs model matching on the QNAME of the query request to obtain the most suitable QNAME tag incrementing pattern for sending iterative queries. This improves the success rate of DNS request resolution while reducing the exposure of user request data and other privacy information using DNS query minimization technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet services, and in particular to a DNS request processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] The Domain Name System (DNS) is one of the most fundamental network services on the Internet. Users' online activities must first be resolved through DNS. The efficiency, accuracy, and security of the DNS system directly affect the secure and stable operation of Internet services and user experience.

[0003] The target DNS resolution follows the iterative evolution of the RFC 1034 and RFC 1035 specifications. Due to the limitations of the original specifications, DNS resolution did not consider security and privacy issues. The DNS protocol transmits data in plaintext, and third parties can arbitrarily intercept users' DNS requests to obtain private data.

[0004] To reduce privacy breaches, the RFC 9156 standard defines a domain name minimization query method, which sends only the minimum information required for each query to the peer server to reduce the risk of privacy leaks. However, this method can lead to a significant drop in domain name query success rates in CDN (Content Delivery Network) scenarios, such as those that frequently use CNAME (Canonical Name) records, affecting normal DNS resolution. Therefore, improving the success rate of DNS request resolution while ensuring privacy and security is a pressing technical problem that needs to be solved. Summary of the Invention

[0005] In view of the above problems, embodiments of this application provide a DNS request processing method, apparatus, electronic device, and storage medium to overcome or at least partially solve the above problems.

[0006] A first aspect of this application discloses a DNS request processing method, the method comprising:

[0007] Obtain the DNS request to be resolved;

[0008] The target domain name QNAME requested in the DNS request is matched with the QNAME of the pre-created QNAME model;

[0009] If the target domain name matches at least a portion of the QNAME of a pre-created QNAME model, the query tag of the target domain name is added according to the tag addition rules of the matching QNAME model to request the response result of the recursive query from the target server.

[0010] Optionally, the pre-created QNAME model includes a newly created QNAME model, which is created according to the following steps:

[0011] Abstracting tag features from domains based on their hierarchical position and / or abstracting tag features from domains based on their content;

[0012] Based on the aforementioned tag features, a tag accumulation paradigm is extracted from the domain name to serve as the newly created QNAME model.

[0013] Optionally, the pre-created QNAME model includes a newly created QNAME model, which is created according to the following steps:

[0014] The process of domain name minimization query is analyzed to obtain the response results of domain name minimization query;

[0015] Based on the response results of the domain name minimization query, determine the tag addition rules for the QNAME model;

[0016] By using tag recognition and semantic analysis, the domain name is represented as a standard paradigm, and a new QNAME model is obtained based on the standard paradigm and the tag addition rules of the QNAME model.

[0017] Optionally, the method further includes:

[0018] If the response result of the recursive query does not match the expected response, the pre-created QNAME model is updated to obtain the updated QNAME model.

[0019] The query domain name requested in the next DNS request to be resolved will be matched with the QNAME of the updated QNAME model;

[0020] If the queried domain name matches at least a portion of the updated QNAME, a query tag is added to the queried domain name according to the tag addition rules of the matching QNAME model, in order to request a recursive query response from the target server.

[0021] Optionally, the pre-created QNAME model is a CDN model, and the tag addition rule of the CDN model is: the tags on the second-level tags and the tags on the right are added incrementally, and the tags on the left of the second-level tags are added all at once.

[0022] Optionally, the pre-created QNAME model is the default QNAME model, and the expected response of the default QNAME model is to receive at least 2 referral responses when the number of QNAME tags is greater than 2;

[0023] The default tag addition rule for the QNAME model is: to increment the tags level by level according to the tag increment method of minimizing domain name queries.

[0024] Optionally, the pre-created QNAME model is a first QNAME model, and the QNAME of the first QNAME model satisfies the requirement of adding second-level domain name tags and lower-level tags level by level, and the resulting response is the same;

[0025] The tag addition rule for the first QNAME model is: add all tags at once.

[0026] Optionally, if the response result of the recursive query does not match the expected response, the pre-created QNAME model is updated to obtain an updated QNAME model, including:

[0027] If the response result of the recursive query does not match the expected response of the first QNAME model, the first QNAME model is updated to obtain the second QNAME model and the third QNAME model.

[0028] The tag addition rule for the second QNAME model is: to add tags incrementally in a way that minimizes the domain name; the tag addition rule for the third QNAME model is: to add tags incrementally in the second-level tags and the tags on the right, and to add tags on the left of the second-level tags all at once.

[0029] Optionally, the DNS request to be resolved includes at least one of the following:

[0030] Obtain DNS requests sent by the user equipment;

[0031] After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and then initiate a DNS request again based on the standard name.

[0032] Optionally, matching the target domain name QNAME requested in the DNS request with the QNAME of a pre-created QNAME model includes:

[0033] The standard name of the request query in the re-initiated DNS request is matched with the QNAME of the CDN model;

[0034] If the target domain name matches at least a portion of the QNAME in a pre-created QNAME model, query tags for the target domain name are added according to the tag addition rules of the matching QNAME model to request a recursive query response from the target server, including:

[0035] If the standard name matches the QNAME of the CDN model, add the second-level tags and the tags on the right side of the standard name incrementally to request the NS record of the domain name server of the standard name from the first target domain name server.

[0036] Based on the NS information of the domain name server, add the second-level tag and the tag on the left at once to request the host A record of the standard name from the second target domain name server.

[0037] A second aspect of this application discloses a DNS request processing apparatus, the apparatus comprising:

[0038] The acquisition module is used to acquire DNS requests to be resolved;

[0039] The matching module is used to match the target domain name QNAME requested in the DNS request with the QNAME of the pre-created QNAME model;

[0040] An add module is used to add query tags to the target domain name according to the tag addition rules of the matching QNAME model when the target domain name matches at least a part of the QNAME of the pre-created QNAME model, so as to request the response results of the recursive query from the target server.

[0041] A third aspect of this application discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the DNS request processing method described in the first aspect of this application.

[0042] A fourth aspect of this application discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the DNS request processing method described in the first aspect of this application.

[0043] A fifth aspect of this application discloses a computer program product, including a computer program that, when executed by a processor, implements the steps of the DNS request processing method described in the first aspect of this application.

[0044] The embodiments of this application have the following advantages:

[0045] In this embodiment, the DNS request to be resolved is obtained, and the target domain name QNAME requested in the DNS request is matched with the QNAME of a pre-created QNAME model. If the target domain name matches at least a part of the QNAME of the pre-created QNAME model, query tags for the target domain name are added according to the tag addition rules of the matched QNAME model to request the response result of the recursive query from the target server. Furthermore, by constructing a QNAME model and matching the QNAME of the query request to the model, the true intent of the DNS minimization request can be accurately identified, thus obtaining the most suitable domain name tag incrementing pattern for iterative querying. Since the query tags used in each recursive query are added according to the tag addition rules of the matched QNAME model, the success rate of DNS request resolution is improved while reducing the risk of user privacy leakage using domain name minimization query technology. Attached Figure Description

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

[0047] Figure 1 This is a diagram illustrating the DNS resolution process;

[0048] Figure 2 This is a diagram illustrating the domain name minimization query process;

[0049] Figure 3 This is a schematic diagram of the domain name minimization query process in a CDN scenario;

[0050] Figure 4 This is a flowchart illustrating the steps of a DNS request processing method provided in an embodiment of this application;

[0051] Figure 5 This is a schematic diagram illustrating an application scenario of a DNS request processing method provided in an embodiment of this application;

[0052] Figure 6 This is a flowchart illustrating a DNS request processing method provided in an embodiment of this application.

[0053] Figure 7 This is a schematic diagram of the structure of a DNS request processing device provided in an embodiment of this application;

[0054] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0055] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] To facilitate understanding of the technical solutions provided in this application, the main technical concepts involved in the embodiments of this application are briefly described below.

[0057] DNS (Domain Name System) is one of the most fundamental network services on the Internet and one of the most important network elements in Internet access. A large amount of user internet activity must be processed through the DNS system first. The efficiency, accuracy, and security of the DNS system directly affect the secure and stable operation of Internet services and user experience.

[0058] QNAME(Query NAME, domain name to be queried): A field name in the DNS request that indicates the domain name that the user needs to query through DNS.

[0059] QTYPE (Query TYPE, the type of resource record requested): A field name in a DNS request. Common records include A records, NS records, CNAME records, etc.

[0060] An A record (Address record, host record) is a record used to specify the IP address corresponding to a hostname (or domain name).

[0061] NS record (Name Server record): Used to specify which DNS server should resolve the domain name.

[0062] A CNAME record (Canonical Name record, alias record) is a redirection record used to redirect a domain name (usually a subdomain) to another domain name (usually the main domain).

[0063] DNS Query Name Minimization to Improve Privacy: RFC 9156 updated and established this method as a standard protocol. This method aims to reduce privacy breaches by minimizing DNS requests, but it can lead to a significant drop in domain name query success rate, directly impacting normal DNS resolution.

[0064] DNS resolution methods:

[0065] Assuming the recursive DNS resolver is cold-started and has no entries in its cache, when an iterative DNS query is needed, taking the bacom domain as an example, the traditional DNS resolution process is as follows: Figure 1 As shown.

[0066] Step 1: When the recursive resolution program initiates an A record request for the bacom domain, it first sends a bacom A request message to the root server.

[0067] Step 2: The root server responds with a referral, returning the delegated NS record of the top-level domain (com) server (let's assume it's ns1.com) to the recursive resolver;

[0068] Step 3: The recursive resolution program sends another request for the A record of the bacom domain to the top-level domain (com) server;

[0069] Step 4: The top-level domain (.com) server contains a large number of second-level domains, such as a.com, b.com, baidu.com, etc., with delegation information. Upon receiving the request, the top-level domain (.com) server will reply with a referral response, including the second-level domains in the response.<a.com> The delegation information informs the target domain name server ns1.a.com for continued iteration;

[0070] Step 5: The recursive DNS resolver sends another A record request for the bacom domain to the second-level domain (a.com) server; the query result in the second-level domain (a.com) server will still be its subdomain.<b.a.com> The delegation information will continue to be sent to the recursive resolution program by the second-level domain (a.com) server.<b.a.com> The domain name server information ns1.bacom is used to inform the server to continue making requests to that target domain name server;

[0071] Step 6: After the second-level domain (a.com) server responds, it returns the NS record (ns1.bacom) of the third-level domain (bacom) server to the client;

[0072] Step 7: The recursive DNS resolver sends an A record request for the bacom domain name to the third-level domain (bacom) server;

[0073] Step 8: The third-level domain (bacom) server finally returns the result set of record A to the client.

[0074] As can be seen, the traditional DNS resolution process sends the full user request data (bacom A) to each level of server. An attacker could easily monitor a user's network activity by placing eavesdropping devices along any query path, posing a risk of user privacy data leakage. In reality, upper-level domain servers do not need to know the complete domain name information and request type. According to the hierarchical architecture of the DNS protocol, upper-level servers only know the delegation information of lower-level servers. The complete QNAME and original QTYPE are only necessary when requesting the authoritative server holding the client's request data. Therefore, traditional DNS resolution presents privacy issues.

[0075] Domain name minimization query method:

[0076] Based on the traditional DNS resolution approach described above, RFC 9156 defines a method for minimizing domain name lookups to improve privacy. This means that for each query, only the minimum information required for the query is sent to the peer server. Taking the bacom domain as an example, the domain name minimization query process is as follows: Figure 2 As shown.

[0077] Step 1: When the recursive resolution program makes an A record request for bacom, it first sends an NS request for the top-level domain (com) to the root server, instead of an A record request for the complete domain.

[0078] Step 2: The root server responds with a referral, returning the delegated NS record of the top-level domain (com) server (let's assume it's ns1.com) to the recursive resolver;

[0079] Step 3: After receiving the referral response, the recursive resolution program continues to send the second-level domain name to the top-level domain (com) server.<a.com> NS request;

[0080] Step 4: After the top-level domain (com) server responds, it returns the NS record (ns1.a.com) of the second-level domain (a.com) server to the recursive resolver;

[0081] Step 5: After receiving the referral response, the recursive resolution program continues to send the third-level domain name to the second-level domain (a.com) server.<b.a.com> NS request;

[0082] Step 6: After the second-level domain (a.com) server responds, it returns the NS record (ns1.bacom) of the third-level domain (bacom) server to the client;

[0083] Step 7: At this point, the recursive resolution program sends a complete domain A record request, bacom A, to the third-level domain (bacom) server.

[0084] Step 8: The third-level domain (bacom) server finally returns the A record result set of bacom to the client.

[0085] As can be seen, the domain minimization query process can run well when there is a region segmentation at each tag of the requested domain and the number of requested domain tags is small. However, in some scenarios (such as CDN scenarios using CNAME records), it will significantly reduce the DNS success rate.

[0086] Problems with domain minimization queries:

[0087] like Figure 3 As shown, if the domain name to be resolved is scheduled by CDN, then the record set obtained in step 8 is the CNAME record bacom.cdn for bacom. According to the mechanism of minimizing requests, the recursive resolution program needs to send an NS request to com.cdn to the CDN server. However, the CDN server only stores the A record of bacom.cdn. There is no region segmentation at com.cdn. This will cause the recursive resolution program to need more iterative requests to obtain the required record set. In the end, the iterative resolution itself is likely to succeed, but due to the additional iteration process, the additional RTT (round-trip time) increases the probability of the user request that initiated this recursive query request failing due to timeout.

[0088] In summary, the analysis shows that traditional DNS resolution methods cannot meet the ever-increasing security demands. While minimizing domain name queries can significantly reduce the risk of privacy breaches associated with traditional methods, it also presents the challenge of a substantial decrease in resolution success rate. To ensure domain name resolution success rate while improving the security of DNS resolution services, this application provides a DNS request processing method. By constructing a QNAME model, the QNAME of the DNS request to be resolved is matched with the QNAME of the QNAME model to obtain the most suitable incremental domain name tag pattern for iterative querying, thereby improving the query success rate.

[0089] The DNS request processing method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through some embodiments and application scenarios.

[0090] Firstly, referring to Figure 4 As shown, Figure 4 This is a flowchart illustrating the steps of a DNS request processing method provided in an embodiment of this application. The DNS request processing method may include steps S410 to S430:

[0091] Step S410: Obtain the DNS request to be resolved;

[0092] Step S420: Match the target domain name QNAME requested in the DNS request with the QNAME of the pre-created QNAME model;

[0093] Step S430: If the target domain name matches at least a part of the QNAME of the pre-created QNAME model, add the query tag of the target domain name according to the tag addition rules of the matching QNAME model to request the response result of the recursive query from the target server.

[0094] In this embodiment, a tag refers to a domain name slice. For example, taking the domain name abcom, a, b, and com are all tags, and the tag names are user-defined. Query tags refer to the tags used when performing a domain name minimization query. Query tags are added according to the tag addition rules of the matching QNAME model.

[0095] One QNAME model corresponds to one type of QNAME. Therefore, multiple target domains of the same type will match one QNAME model of that type. When matching a target domain with the QNAME of a pre-created QNAME model, if the target domain and the QNAME of the QNAME model are exactly the same, then the target domain and the QNAME of the pre-created QNAME model are considered an exact match; if the target domain and the QNAME of the QNAME model are only partially the same, then the target domain and the QNAME of the pre-created QNAME model are considered a partial match.

[0096] The tag addition rules of the QNAME model specify the incremental tag addition method for domain-minimizing queries, that is, the number of tags added in each recursive query. Therefore, for a target domain that matches the QNAME of the QNAME model, the query tags for the target domain are added according to the tag addition rules in each recursive query. For example, if the tag addition rule of the QNAME model is incremental, the query tag is based on the query tag of the previous recursive query, with a lower-level tag added (e.g., for the target domain bacom, if the query tag of the previous recursive query was a.com, then the query tag of this recursive query is bacom). As another example, if the tag addition rule of the QNAME model is to add all tags at once, then the recursive query adds all tags (e.g., for the target domain bacom, the query tag is directly bacom).

[0097] After adding a query tag for the target domain, a request message corresponding to the query tag is sent to the target server to request the response result of the recursive query. The response result of the recursive query is the query result returned by the target server based on the query tag; the target server is the server corresponding to the query tag, and different query tags correspond to different servers. The target server can be a root server, top-level domain server, second-level domain server, third-level domain server, CDN server, etc. For example, ... Figure 2 As shown, if the query tag is a.com, the target server is the top-level domain server, and the corresponding response is the query result ns1.a.com returned by the top-level domain server.

[0098] In practice, since DNS request resolution is a recursive query process, the target domain name queried in the obtained DNS request may be different for each recursive query. Therefore, after obtaining the DNS request, the QNAME model matching process in step S420 and the addition of the target domain name query label according to the label addition rule in step S430 need to be performed to ensure that each recursive query can be performed according to the most appropriate label addition rule.

[0099] In summary, this application embodiment constructs a QNAME model and performs model matching on the QNAME of the query request. This accurately identifies the true intent of the domain minimization request and obtains the most suitable domain tag increment pattern for iterative querying. Since the query tags used in each recursive query are added according to the tag addition rules of the matched QNAME model, the domain minimization query technology reduces the risk of user privacy leakage while improving the success rate of DNS request resolution.

[0100] In one optional embodiment, the pre-created QNAME model includes a newly created QNAME model, which is created according to steps A1 and A2:

[0101] Step A1: Abstract tag features from domains according to their hierarchical position, and / or abstract tag features from domains according to their content;

[0102] Step A2: Extract the tag accumulation paradigm from the domain name based on the tag features to serve as the newly created QNAME model.

[0103] In this embodiment, the tag features abstracted from the domain name according to its hierarchical position are called hierarchical tags. Hierarchical tags can be divided into top-level domain tags, intermediate (domain) tags, and lowest-level tags. Top-level domain tags are further divided into gTLD, ccTLD, sTLD, tTLD, com, and known non-existent top-level domains (such as localdomain). Intermediate (domain) tags refer to the tags between the first tag and the top-level domain tag. The lowest-level tag is the first tag. Taking the cabcom domain as an example, the .com tag is the top-level domain tag, the 'b' and 'a' tags are intermediate tags, and the 'c' tag is the lowest-level tag.

[0104] Tag features abstracted from domain names based on tag content include: underscore tags (e.g., _tcp, _http, _25), IDN tags (xn--d1alf, xn--c2br7g), pure numeric tags (112, 36, d, f (hexadecimal IP6 address)), keyword tags (cdn, pic, img, api), hostname tags (myhost-1, abcserver), and other unclassified tags (a_b_label).

[0105] After determining the tag features, a tag accumulation paradigm is extracted from the domain name based on the tag features and semantics, thus obtaining the newly created QNAME model. The tag accumulation paradigm refers to the tag incrementing method used in domain name minimization queries. For example, based on the tag features shown in Table 1, the tag accumulation paradigm corresponding to the CDN class QNAME can be expressed as:

[0106] <cdn-qname> ::= <any-label> . <hostname-label> . <cdn-label> . <gtld-label>

[0107] Table 1. Tag features extracted from domain names

[0108]

[0109] In another alternative embodiment, the pre-created QNAME model includes a newly created QNAME model, which is created according to steps B1 to B3:

[0110] Step B1: Analyze the domain name minimization query process and obtain the response results of the domain name minimization query;

[0111] Step B2: Based on the response results of the domain name minimization query, determine the tag addition rules for the QNAME model;

[0112] Step B3: Through tag recognition and semantic analysis, the domain name is represented as a standard paradigm, and a new QNAME model is obtained according to the standard paradigm and the tag addition rules of the QNAME model.

[0113] In this embodiment, the domain name minimization query refers to the method of minimizing the domain name query name as defined in the RFC9156 standard. In this query, the minimum information required for each query is sent to the target server. Therefore, the response result of the domain name minimization query is the response result corresponding to sending the minimum amount of information. By analyzing the response results of the domain name minimization query throughout the entire recursive query process, the tag addition rules for the QNAME model are determined, and thus the newly created QNAME model is obtained.

[0114] For example, this corresponds to a domain name (QNAME) in the following form:

[0115] <China-domain>::= <any-label><China IDN-tld>

[0116] <China IDN-tld>::="xn--fiqs8s

[0117] In the process of minimizing domain name queries for this type of domain, the response result for requests to the name server of "xn--fiqs8s" is the same regardless of how sub-tags are added. That is, during the process of adding sub-tags to "xn--fiqs8s", the received response result is always NO ERROR+DATA (NODATA), and it is not a referral response. This type of response result is due to the wildcard configuration in the subdomain.

[0118] In such scenarios, adding subdomain tags and their sub-tags level by level is meaningless. Therefore, for such domains, during the domain minimization query process, all unadded sub-tags can be included in the request sent to the top-level domain server. For example, the domain name server for the top-level domain "xn--fiqs8s." is ns.xn--fiqs8s. During the domain minimization query process for the domain "abcdxn--fiqs8s.", requests sent to ns.xn--fiqs8s. such as "d.xn--fiqs8s.", "cdxn--fiqs8s.", "bcdxn--fiqs8s.", and "abcdxn--fiqs8s." will all receive a response code of NOERROR+DATA (NODATA), which is different from the expected response according to the domain minimization query. Therefore, the tag addition rule for the QNAME model corresponding to such domains can be determined as: add all unadded sub-tags at once.

[0119] Because these domain names have relatively obvious characteristics (the top-level domain label is a Class A label of one or more IDNs), they can be represented as a standard paradigm through simple label recognition and semantic analysis. Then, based on this standard paradigm and the label addition rules of the QNAME model, a QNAME model is automatically built, i.e., a <China-domain> QNAME model is built. After the QNAME model is built, when a target domain matching this QNAME model is used in a domain minimization query, the corresponding scheme of this QNAME model can be adopted in the request sent to the top-level domain name server, adding all the unadded lower-level labels. Simultaneously, the expected response of the QNAME model is a response without referral below the top-level domain.

[0120] In one specific implementation, the pre-created QNAME model is a CDN model, and the tag addition rule of the CDN model is: the tags on the second-level tags and the tags on the right are added incrementally, and the tags on the left of the second-level tags are added all at once.

[0121] The secondary tags in the CDN model include tags such as "dnscdn", "cdn", or "cdnnet". For example, for the domain bacom.cdnnet.com that matches the CDN model, the query tag cdnnet.com is added first, based on the method of adding secondary tags and tags on the right in a step-by-step manner, to request the NS record of cdnnet.com from the top-level name server (target server). Then, based on the method of adding tags all at once on the left side of the secondary tags, the query tag bacom.cdnnet.com is added to request the A record of the domain bacom.cdnnet.com from the CDN server (target server).

[0122] In one specific implementation, the pre-created QNAME model is the default QNAME model, and the expected response of the default QNAME model is to receive at least 2 referral responses when the number of QNAME tags is greater than 2; the tag addition rule of the default QNAME model is: to increment the tags level by level according to the tag increment method of minimizing domain name queries.

[0123] In this embodiment, the minimized tag increment method refers to the domain name query name minimization method defined in RFC9156. In specific implementation, when the target domain name cannot match other QNAME models or matches the default QNAME model, the query tags for the target domain name are added according to the tag addition rules of the default QNAME model.

[0124] In an optional embodiment, considering that the pre-created QNAME model may not fully satisfy the domain name minimization recursive query scheme with the minimum number of DNS request resolution iterations and the highest domain name query success rate, the QNAME model also needs to be updated during the DNS request resolution process (i.e., the recursive query process) to ensure that the DNS request resolution is always based on the minimum recursive query scheme. Specifically, after step S430, the following steps are also included:

[0125] Step S440: If the response result of the recursive query does not match the expected response, update the pre-created QNAME model to obtain the updated QNAME model;

[0126] Step S450: Match the domain name requested in the next DNS request to be resolved with the QNAME of the updated QNAME model;

[0127] Step S460: If the queried domain name matches at least a part of the QNAME of the updated QNAME, add a query tag to the queried domain name according to the tag addition rules of the matching QNAME model, so as to request the response result of the recursive query from the target server.

[0128] In this embodiment, the expected response refers to the response result expected by the QNAME model. When the result of the recursive query is inconsistent with the expected response (i.e., mismatch), it indicates that the pre-created QNAME model does not satisfy the domain-minimizing recursive query scheme with the minimum number of DNS request resolution iterations and the highest domain query success rate. At this time, the QNAME model is automatically updated based on the data of this recursive query (e.g., the matching QNAME model, query tags, processing time, and response result) to obtain the updated QNAME model.

[0129] Then, after obtaining the next DNS request to be resolved, the query domain name requested in the next DNS request is matched with the QNAME of the updated QNAME model to realize recursive query based on the updated QNAME model. This ensures that the DNS request resolution is always based on the minimum recursive query scheme, thereby improving the success rate of DNS request resolution while reducing the risk of user privacy leakage by using the domain name minimization query technology.

[0130] In one specific implementation, the pre-created QNAME model is a first QNAME model. The QNAME of the first QNAME model satisfies the requirement of adding second-level domain name tags and lower-level tags level by level, and the resulting response is the same. The tag addition rule of the first QNAME model is: add all tags at once.

[0131] In this embodiment, adding second-level domain tags and their subordinate tags sequentially yields the same response result. Therefore, adding second-level domain tags and their subordinate tags sequentially is meaningless. Thus, the tag addition rule for the first QNAME model is to add all tags at once. In practical applications, for domains whose top-level domain tags are Class A tags of one or more IDNs, the sequential addition of second-level domain tags and their subordinate tags always results in the same response result.

[0132] Specifically, a recursive query process is performed based on the label addition rules of the first QNAME model. When the response result of the recursive query does not match the expected response of the first QNAME model during the recursive query process, the following steps are executed:

[0133] In the case where the response result of the recursive query does not match the expected response of the first QNAME model, update the first QNAME model to obtain a second QNAME model and a third QNAME model;

[0134] Among them, the label addition rule of the second QNAME model is: increment逐级递增 according to the label increment method of domain name minimization; the label addition rule of the third QNAME model is: increment and add the labels at and to the right of the second-level label step by step, and add the labels to the left of the second-level label一次性添加 at once.

[0135] In an embodiment of the present application, the expected response of the first QNAME model is to receive the A record set of the target domain name, rather than a referral response. When the response result of the recursive query is a referral response, it does not match the expected response of the first QNAME model, indicating that the first QNAME model does not meet the domain name minimization recursive query scheme with the minimum number of DNS request resolution iterations / highest domain name query success rate. At this time, automatically update the first QNAME model according to the data of this recursive query (for example, query label, processing duration, and response result) to obtain a second QNAME model and a third QNAME model.

[0136] Exemplarily, if the first QNAME model corresponding to the domain name <中国-domain> is:

[0137] <中国-domain>::= <any-label><China IDN-tld>.

[0138] <China IDN-tld>::="xn--fiqs8s

[0139] "xyzhost.xn--fiqs8s." matches a portion of the QNAME in the first QNAME model. Because the QNAME matches the zone cutoff point configured in the top-level domain, after adding all tags and recursively querying, a referral response is received, which does not match the expected response of the first QNAME model. Therefore, the first QNAME model <China-domain> can be updated to obtain the second QNAME model <China-subzone-domain> and the third QNAME model <China-wildcard-domain>, specifically represented as follows:

[0140] <China-subzone-domain>::= <any-label>.<China - zonecut - label>.<China IDN - tld>.

[0141] <China - wildcard - domain>::= <any-label><Non-China zonecut-label>.<China IDN-tld>.

[0142] <China-zonecut-label>::="host"|"acg"|"qq"|......

[0143] <China IDN-tld>::="xn--fiqs8s

[0144] The tag addition rule for the <China-subzone-domain> model is to add tags incrementally in a way that minimizes the domain name. The tag addition rule for <China-wildcard-domain> is to add tags incrementally in the second-level tags and the tags to the right, and add tags to the left of the second-level tags all at once.

[0145] In one alternative embodiment, obtaining the DNS request to be resolved includes at least one of the following:

[0146] Item A-1: ​​Obtain DNS requests sent by user equipment;

[0147] Item A-2: After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and initiate a DNS request again based on the standard name.

[0148] In this embodiment, the DNS request can be sent directly by the user equipment, in which case the target domain name requested in the DNS request is sent by the user equipment. Alternatively, the DNS request can be initiated again during a recursive query process based on the received recursive query response result (CNAME record). For example, during a recursive query of the domain name bacom, if the response result of a certain recursive query is bacom.CNAME bacom.cdnnet.com (where bacom. is the target domain name QNAME of the DNS request sent by the user equipment, and bacom.cdnnet.com is the standard name), then a DNS request can be initiated again based on the standard name bacom.cdnnet.com.

[0149] In one specific implementation, a cabinet query is performed based on the obtained DNS request. After receiving the CNAME record, a new DNS request is initiated based on the standard name. The standard name in the new DNS request is then matched with the QNAME of the pre-selected QNAME model. Recursive queries are then performed based on the tag addition rules of the newly matched QNAME model. Specifically, this includes the following steps C1 to C7:

[0150] Step C1: Obtain the DNS request to be resolved;

[0151] Step C2: Match the target domain name QNAME requested in the DNS request with the QNAME of the pre-created QNAME model;

[0152] Step C3: If the target domain name matches at least a part of the QNAME of the pre-created QNAME model, add the query tag of the target domain name according to the tag addition rules of the matching QNAME model to request the response result of the recursive query from the target server.

[0153] Step C4: After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and initiate a DNS request again based on the standard name;

[0154] Step C5: Match the standard name of the request query in the re-initiated DNS request with the QNAME of the CDN model;

[0155] Step C6: If the standard name matches the QNAME of the CDN model, add the second-level tags and the tags on the right of the standard name incrementally to request the NS record of the domain name server of the standard name from the first target domain name server.

[0156] Step C7: Based on the NS information of the domain name server, add the second-level tag and the tag on the left at once to request the host A record of the standard name from the second target domain name server.

[0157] In this embodiment of the application, different types of domain names are matched with different QNAME models, and the domain names requested in different DNS requests may be different. Therefore, after each DNS request is obtained, it is necessary to match the domain name requested in the DNS with the QNAME of the pre-created QNAME model to ensure that each subsequent recursive query can be performed according to the most suitable domain name tag increment model.

[0158] Figure 5 This application provides a DNS request processing method that is applied to a recursive resolution program on a local DNS service. This method provides faster, more secure, and more efficient domain name resolution services for user network resources within a given region. Specifically, the recursive resolution program includes a request preprocessing module, a traffic processor, and a model iteration module.

[0159] The request preprocessing module is used to obtain the DNS requests to be resolved and check whether the traffic is normal DNS query traffic. Specifically, it checks whether the QNAME, QTYPE, etc. in the DNS request are correct. The traffic processor is used to call the domain name minimization query algorithm to process the target domain name, construct the response DNS query packet to communicate with other target servers, match the target domain name with the QNAME of the pre-built QNAME model, and add query tags for the target domain name according to the tag addition rules of the matched QNAME model to request the response results of the recursive query from the target server. After each query, the traffic processor records the data of this recursive query (e.g., the matched QNAME model, query tags, processing time, and response results) and feeds it back to the model iterator. The model iterator automatically updates the current QNAME model based on the recursive query data, adjusts and generates the paradigm type, and obtains the updated QNAME model.

[0160] For example, Figure 6 This diagram illustrates the DNS request processing method provided in this application, illustrating the process of DNS request resolution. It describes the use of two different QNAME models for recursive queries during the DNS request processing: the first is the default QNAME model, and the second is the CDN model. First, a recursive query is performed using the default QNAME model that matches the target domain name (bacom) queried in the DNS request. Since the target domain name is invoked by the CDN server, after receiving the CNAME record, the target domain name is replaced with the standard domain name (bacom.cdnnet.com) in the CNAME record, and a DNS request is initiated again. Then, a recursive query is performed using the CDN model that matches the standard domain name. The specific steps are as follows:

[0161] Step 1: When the recursive resolver makes an A record request for bacom using the domain name minimization request, it first determines the characteristics of the target domain. Since the target domain: bacom matches the default QNAME model, the resolver uses the label addition rule of the default QNAME model to send an NS request for com to the root server.

[0162] Step 2: The root server responds to the referral response for the .com domain, returning the delegated NS record ns1.com from the top-level domain (.com) server to the recursive resolver;

[0163] Step 3: The recursive resolver sends a message to the top-level domain (.com) server.<a.com> NS request;

[0164] Step 4: The top-level domain (.com) server responds to the second-level domain.<a.com> The assignment information;

[0165] Step 5: The recursive parsing program sends the data to the secondary domain server.<b.a.com> NS request;

[0166] Step 6:<a.com> The area is<b.a.com> The authoritative region of a domain name<b.a.com> The domain name has a CNAME record with the content bacom.CNAME bacom.cdnnet.com.

[0167] Step 7: After receiving the CNAME record, the recursive DNS resolver needs to replace the original QNAME with the standard name in the CNAME record and initiate a DNS request again. Because of the QNAME replacement, the resolver needs to determine the QNAME type again. The new QNAME: bacom.cdnnet.com matches the CDN model, so the tag addition rule for this CDN model is selected. First, according to the scheme of "adding second-level tags and tags on the right in ascending order," a request is made to the top-level domain name server (this delegation information is already in the cache after step 3).<cdnnet.com> NS records;

[0168] Step 8: Top-level domain name server response<cdnnet.com> The assignment information;

[0169] Step 9: The recursive parsing program then requests the A record of the domain bacom.cdnnet.com from the CDN server according to the scheme of "adding the tags to the left of the secondary tags all at once";

[0170] Step 10: Based on the characteristics of CDN scheduling domain name servers, the CDN server will return the A record set of bacom.cdnnet.com.

[0171] As can be seen, the DNS request processing method provided by the embodiments of this application improves the DNS request resolution success rate by reducing unnecessary iterations, while also protecting user privacy.

[0172] Secondly, embodiments of this application also provide a DNS request processing apparatus, referring to... Figure 7 As shown, Figure 7 This is a schematic diagram of a DNS request processing device provided in an embodiment of this application. The device includes:

[0173] Module 710 is used to obtain the DNS request to be resolved;

[0174] Matching module 720 is used to match the target domain name QNAME requested in the DNS request with the QNAME of a pre-created QNAME model;

[0175] Adding module 730 is used to add query tags to the target domain name according to the tag adding rules of the matching QNAME model when the target domain name matches at least a part of the QNAME of the pre-created QNAME model, so as to request the response result of the recursive query from the target server.

[0176] In one optional embodiment, the pre-created QNAME model includes a newly created QNAME model, and the apparatus includes a creation module for creating the newly created QNAME model, the creation module including:

[0177] The extraction module is used to abstract tag features from domains according to their hierarchical position and / or according to their content.

[0178] The extraction module is used to extract the tag accumulation paradigm from the domain name based on the tag features, so as to use it as the newly created QNAME model.

[0179] In one optional embodiment, the pre-created QNAME model includes a newly created QNAME model, and the apparatus includes a creation module for creating the newly created QNAME model, the creation module including:

[0180] The analysis module is used to analyze the domain name minimization query process and obtain the response results of the domain name minimization query.

[0181] The determination module is used to determine the tag addition rules for the QNAME model based on the response results of the domain name minimization query;

[0182] The representation module is used to represent the domain name as a standard paradigm through tag recognition and semantic analysis, and to obtain a new QNAME model based on the standard paradigm and the tag addition rules of the QNAME model.

[0183] In an optional embodiment, the device further includes:

[0184] The update module is used to update the pre-created QNAME model when the response result of the recursive query does not match the expected response, so as to obtain the updated QNAME model.

[0185] The first matching submodule is used to match the query domain name requested in the next DNS request to be resolved with the QNAME of the updated QNAME model;

[0186] The first adding submodule is used to add query tags to the query domain name according to the tag adding rules of the matching QNAME model when the query domain name matches at least a part of the QNAME of the updated QNAME, so as to request the response result of the recursive query from the target server.

[0187] In one optional embodiment, the pre-created QNAME model is a CDN model, and the tag addition rule of the CDN model is: the tags on the second-level tags and the tags on the right are added incrementally, and the tags on the left of the second-level tags are added all at once.

[0188] In one optional embodiment, the pre-created QNAME model is a default QNAME model, and the expected response of the default QNAME model is to receive at least 2 referral responses when the number of QNAME tags is greater than 2.

[0189] The default tag addition rule for the QNAME model is: to increment the tags level by level according to the tag increment method of minimizing domain name queries.

[0190] In one optional embodiment, the pre-created QNAME model is a first QNAME model, and the QNAME of the first QNAME model satisfies the requirement of adding second-level domain name tags and lower-level tags level by level, and the resulting response is the same;

[0191] The tag addition rule for the first QNAME model is: add all tags at once.

[0192] In one optional embodiment, the update module includes:

[0193] The first update submodule is used to update the first QNAME model to obtain a second QNAME model and a third QNAME model when the response result of the recursive query does not match the expected response of the first QNAME model.

[0194] The tag addition rule for the second QNAME model is: to add tags incrementally in a way that minimizes the domain name; the tag addition rule for the third QNAME model is: to add tags incrementally in the second-level tags and the tags on the right, and to add tags on the left of the second-level tags all at once.

[0195] In one optional embodiment, the acquisition module is used for at least one of the following:

[0196] Obtain DNS requests sent by the user equipment;

[0197] After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and then initiate a DNS request again based on the standard name.

[0198] In an optional embodiment, the matching module includes:

[0199] The second matching submodule is used to match the standard name of the request query in the re-initiated DNS request with the QNAME of the CDN model;

[0200] The added module includes:

[0201] The second addition submodule is used to add the second-level tags and the tags on the right side of the standard name in a step-by-step manner when the standard name matches the QNAME of the CDN model, so as to request the domain name server NS record of the standard name from the first target domain name server.

[0202] The third addition submodule is used to add secondary tags and left-side tags at once based on the NS information of the domain name server, so as to request the host A record of the standard name from the second target domain name server.

[0203] This application also provides an electronic device, which is described in reference to... Figure 8 , Figure 8 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Figure 8 As shown, the electronic device 800 includes a memory 810 and a processor 820. The memory 810 and the processor 820 are connected via a bus. The memory 810 stores a computer program that can run on the processor 820 to implement the steps of the DNS request processing method described in the embodiments of this application.

[0204] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the DNS request processing method described in this application.

[0205] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the DNS request processing method described in this application.

[0206] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0207] This application describes embodiments of methods and apparatus according to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0208] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0209] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0210] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0211] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0212] The foregoing has provided a detailed description of a DNS request processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application. It should be noted that the Chinese phrases "逐级递增" and "一次性添加" in the original text seem to be incorrect or incomplete expressions. I have translated them as literally as possible based on the context, but they may need to be further clarified in the original content for a more accurate translation. Also, the tag <any-label><China IDN-tld>.

[0138] <China IDN-tld>::="xn--fiqs8s

[0139] "xyzhost.xn--fiqs8s." matches a portion of the QNAME in the first QNAME model. Because the QNAME matches the zone cutoff point configured in the top-level domain, after adding all tags and recursively querying, a referral response is received, which does not match the expected response of the first QNAME model. Therefore, the first QNAME model <China-domain> can be updated to obtain the second QNAME model <China-subzone-domain> and the third QNAME model <China-wildcard-domain>, specifically represented as follows:

[0140] <China-subzone-domain>::= <any-label>.<China - zonecut - label>.<China IDN - tld>.

[0141] <China - wildcard - domain>::= <any-label><Non-China zonecut-label>.<China IDN-tld>.

[0142] <China-zonecut-label>::="host"|"acg"|"qq"|......

[0143] <China IDN-tld>::="xn--fiqs8s

[0144] The tag addition rule for the <China-subzone-domain> model is to add tags incrementally in a way that minimizes the domain name. The tag addition rule for <China-wildcard-domain> is to add tags incrementally in the second-level tags and the tags to the right, and add tags to the left of the second-level tags all at once.

[0145] In one alternative embodiment, obtaining the DNS request to be resolved includes at least one of the following:

[0146] Item A-1: ​​Obtain DNS requests sent by user equipment;

[0147] Item A-2: After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and initiate a DNS request again based on the standard name.

[0148] In this embodiment, the DNS request can be sent directly by the user equipment, in which case the target domain name requested in the DNS request is sent by the user equipment. Alternatively, the DNS request can be initiated again during a recursive query process based on the received recursive query response result (CNAME record). For example, during a recursive query of the domain name bacom, if the response result of a certain recursive query is bacom.CNAME bacom.cdnnet.com (where bacom. is the target domain name QNAME of the DNS request sent by the user equipment, and bacom.cdnnet.com is the standard name), then a DNS request can be initiated again based on the standard name bacom.cdnnet.com.

[0149] In one specific implementation, a cabinet query is performed based on the obtained DNS request. After receiving the CNAME record, a new DNS request is initiated based on the standard name. The standard name in the new DNS request is then matched with the QNAME of the pre-selected QNAME model. Recursive queries are then performed based on the tag addition rules of the newly matched QNAME model. Specifically, this includes the following steps C1 to C7:

[0150] Step C1: Obtain the DNS request to be resolved;

[0151] Step C2: Match the target domain name QNAME requested in the DNS request with the QNAME of the pre-created QNAME model;

[0152] Step C3: If the target domain name matches at least a part of the QNAME of the pre-created QNAME model, add the query tag of the target domain name according to the tag addition rules of the matching QNAME model to request the response result of the recursive query from the target server.

[0153] Step C4: After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and initiate a DNS request again based on the standard name;

[0154] Step C5: Match the standard name of the request query in the re-initiated DNS request with the QNAME of the CDN model;

[0155] Step C6: If the standard name matches the QNAME of the CDN model, add the second-level tags and the tags on the right of the standard name incrementally to request the NS record of the domain name server of the standard name from the first target domain name server.

[0156] Step C7: Based on the NS information of the domain name server, add the second-level tag and the tag on the left at once to request the host A record of the standard name from the second target domain name server.

[0157] In this embodiment of the application, different types of domain names are matched with different QNAME models, and the domain names requested in different DNS requests may be different. Therefore, after each DNS request is obtained, it is necessary to match the domain name requested in the DNS with the QNAME of the pre-created QNAME model to ensure that each subsequent recursive query can be performed according to the most suitable domain name tag increment model.

[0158] Figure 5 This application provides a DNS request processing method that is applied to a recursive resolution program on a local DNS service. This method provides faster, more secure, and more efficient domain name resolution services for user network resources within a given region. Specifically, the recursive resolution program includes a request preprocessing module, a traffic processor, and a model iteration module.

[0159] The request preprocessing module is used to obtain the DNS requests to be resolved and check whether the traffic is normal DNS query traffic. Specifically, it checks whether the QNAME, QTYPE, etc. in the DNS request are correct. The traffic processor is used to call the domain name minimization query algorithm to process the target domain name, construct the response DNS query packet to communicate with other target servers, match the target domain name with the QNAME of the pre-built QNAME model, and add query tags for the target domain name according to the tag addition rules of the matched QNAME model to request the response results of the recursive query from the target server. After each query, the traffic processor records the data of this recursive query (e.g., the matched QNAME model, query tags, processing time, and response results) and feeds it back to the model iterator. The model iterator automatically updates the current QNAME model based on the recursive query data, adjusts and generates the paradigm type, and obtains the updated QNAME model.

[0160] For example, Figure 6 This diagram illustrates the DNS request processing method provided in this application, illustrating the process of DNS request resolution. It describes the use of two different QNAME models for recursive queries during the DNS request processing: the first is the default QNAME model, and the second is the CDN model. First, a recursive query is performed using the default QNAME model that matches the target domain name (bacom) queried in the DNS request. Since the target domain name is invoked by the CDN server, after receiving the CNAME record, the target domain name is replaced with the standard domain name (bacom.cdnnet.com) in the CNAME record, and a DNS request is initiated again. Then, a recursive query is performed using the CDN model that matches the standard domain name. The specific steps are as follows:

[0161] Step 1: When the recursive resolver makes an A record request for bacom using the domain name minimization request, it first determines the characteristics of the target domain. Since the target domain: bacom matches the default QNAME model, the resolver uses the label addition rule of the default QNAME model to send an NS request for com to the root server.

[0162] Step 2: The root server responds to the referral response for the .com domain, returning the delegated NS record ns1.com from the top-level domain (.com) server to the recursive resolver;

[0163] Step 3: The recursive resolver sends a message to the top-level domain (.com) server.<a.com> NS request;

[0164] Step 4: The top-level domain (.com) server responds to the second-level domain.<a.com> The assignment information;

[0165] Step 5: The recursive parsing program sends the data to the secondary domain server.<b.a.com> NS request;

[0166] Step 6:<a.com> The area is<b.a.com> The authoritative region of a domain name<b.a.com> The domain name has a CNAME record with the content bacom.CNAME bacom.cdnnet.com.

[0167] Step 7: After receiving the CNAME record, the recursive DNS resolver needs to replace the original QNAME with the standard name in the CNAME record and initiate a DNS request again. Because of the QNAME replacement, the resolver needs to determine the QNAME type again. The new QNAME: bacom.cdnnet.com matches the CDN model, so the tag addition rule for this CDN model is selected. First, according to the scheme of "adding second-level tags and tags on the right in ascending order," a request is made to the top-level domain name server (this delegation information is already in the cache after step 3).<cdnnet.com> NS records;

[0168] Step 8: Top-level domain name server response<cdnnet.com> The assignment information;

[0169] Step 9: The recursive parsing program then requests the A record of the domain bacom.cdnnet.com from the CDN server according to the scheme of "adding the tags to the left of the secondary tags all at once";

[0170] Step 10: Based on the characteristics of CDN scheduling domain name servers, the CDN server will return the A record set of bacom.cdnnet.com.

[0171] As can be seen, the DNS request processing method provided by the embodiments of this application improves the DNS request resolution success rate by reducing unnecessary iterations, while also protecting user privacy.

[0172] Secondly, embodiments of this application also provide a DNS request processing apparatus, referring to... Figure 7 As shown, Figure 7 This is a schematic diagram of a DNS request processing device provided in an embodiment of this application. The device includes:

[0173] Module 710 is used to obtain the DNS request to be resolved;

[0174] Matching module 720 is used to match the target domain name QNAME requested in the DNS request with the QNAME of a pre-created QNAME model;

[0175] Adding module 730 is used to add query tags to the target domain name according to the tag adding rules of the matching QNAME model when the target domain name matches at least a part of the QNAME of the pre-created QNAME model, so as to request the response result of the recursive query from the target server.

[0176] In one optional embodiment, the pre-created QNAME model includes a newly created QNAME model, and the apparatus includes a creation module for creating the newly created QNAME model, the creation module including:

[0177] The extraction module is used to abstract tag features from domains according to their hierarchical position and / or according to their content.

[0178] The extraction module is used to extract the tag accumulation paradigm from the domain name based on the tag features, so as to use it as the newly created QNAME model.

[0179] In one optional embodiment, the pre-created QNAME model includes a newly created QNAME model, and the apparatus includes a creation module for creating the newly created QNAME model, the creation module including:

[0180] The analysis module is used to analyze the domain name minimization query process and obtain the response results of the domain name minimization query.

[0181] The determination module is used to determine the tag addition rules for the QNAME model based on the response results of the domain name minimization query;

[0182] The representation module is used to represent the domain name as a standard paradigm through tag recognition and semantic analysis, and to obtain a new QNAME model based on the standard paradigm and the tag addition rules of the QNAME model.

[0183] In an optional embodiment, the device further includes:

[0184] The update module is used to update the pre-created QNAME model when the response result of the recursive query does not match the expected response, so as to obtain the updated QNAME model.

[0185] The first matching submodule is used to match the query domain name requested in the next DNS request to be resolved with the QNAME of the updated QNAME model;

[0186] The first adding submodule is used to add query tags to the query domain name according to the tag adding rules of the matching QNAME model when the query domain name matches at least a part of the QNAME of the updated QNAME, so as to request the response result of the recursive query from the target server.

[0187] In one optional embodiment, the pre-created QNAME model is a CDN model, and the tag addition rule of the CDN model is: the tags on the second-level tags and the tags on the right are added incrementally, and the tags on the left of the second-level tags are added all at once.

[0188] In one optional embodiment, the pre-created QNAME model is a default QNAME model, and the expected response of the default QNAME model is to receive at least 2 referral responses when the number of QNAME tags is greater than 2.

[0189] The default tag addition rule for the QNAME model is: to increment the tags level by level according to the tag increment method of minimizing domain name queries.

[0190] In one optional embodiment, the pre-created QNAME model is a first QNAME model, and the QNAME of the first QNAME model satisfies the requirement of adding second-level domain name tags and lower-level tags level by level, and the resulting response is the same;

[0191] The tag addition rule for the first QNAME model is: add all tags at once.

[0192] In one optional embodiment, the update module includes:

[0193] The first update submodule is used to update the first QNAME model to obtain a second QNAME model and a third QNAME model when the response result of the recursive query does not match the expected response of the first QNAME model.

[0194] The tag addition rule for the second QNAME model is: to add tags incrementally in a way that minimizes the domain name; the tag addition rule for the third QNAME model is: to add tags incrementally in the second-level tags and the tags on the right, and to add tags on the left of the second-level tags all at once.

[0195] In one optional embodiment, the acquisition module is used for at least one of the following:

[0196] Obtain DNS requests sent by the user equipment;

[0197] After receiving the CNAME record, replace the QNAME with the standard name in the CNAME record, and then initiate a DNS request again based on the standard name.

[0198] In an optional embodiment, the matching module includes:

[0199] The second matching submodule is used to match the standard name of the request query in the re-initiated DNS request with the QNAME of the CDN model;

[0200] The added module includes:

[0201] The second addition submodule is used to add the second-level tags and the tags on the right side of the standard name in a step-by-step manner when the standard name matches the QNAME of the CDN model, so as to request the domain name server NS record of the standard name from the first target domain name server.

[0202] The third addition submodule is used to add secondary tags and left-side tags at once based on the NS information of the domain name server, so as to request the host A record of the standard name from the second target domain name server.

[0203] This application also provides an electronic device, which is described in reference to... Figure 8 , Figure 8 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Figure 8 As shown, the electronic device 800 includes a memory 810 and a processor 820. The memory 810 and the processor 820 are connected via a bus. The memory 810 stores a computer program that can run on the processor 820 to implement the steps of the DNS request processing method described in the embodiments of this application.

[0204] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the DNS request processing method described in this application.

[0205] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the DNS request processing method described in this application.

[0206] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0207] This application describes embodiments of methods and apparatus according to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0208] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0209] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0210] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0211] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0212] The foregoing has provided a detailed description of a DNS request processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application. is left unchanged as it is a 7-digit tag. < / cdn-label> < / hostname-label> < / any-label> < / cdn-qname>

Claims

1. A DNS request processing method, characterized by, The method comprises: acquiring a DNS request to be parsed; matching a target domain name QNAME requested in the DNS request with a QNAME of a pre-created QNAME model; in a case where the target domain name matches at least a part of the QNAME of the pre-created QNAME model, adding a query label of the target domain name according to a label adding rule of the matched QNAME model to request a response result of a recursive query from a target server.

2. The method of claim 1, wherein, The pre-created QNAME model comprises a newly created QNAME model, and the newly created QNAME model is created according to the following steps: abstracting a label feature from a domain name according to a domain name hierarchical position and / or a label content; extracting a label accumulation paradigm from the domain name according to the label feature to serve as the newly created QNAME model.

3. The method of claim 1, wherein, The pre-created QNAME model comprises a newly created QNAME model, and the newly created QNAME model is created according to the following steps: analyzing a domain name minimization query process of a domain name to obtain a response result of the domain name minimization query; determining a label adding rule of a QNAME model according to the response result of the domain name minimization query; characterizing the domain name as a standard paradigm through label recognition and semantic analysis, and obtaining the newly created QNAME model according to the standard paradigm and the label adding rule of the QNAME model.

4. The method of claim 1, wherein, The method further comprises: in a case where the response result of the recursive query does not match an expected response, updating the pre-created QNAME model to obtain an updated QNAME model; matching a query domain name requested in a next DNS request to be parsed with a QNAME of the updated QNAME model; in a case where the query domain name matches at least a part of the QNAME of the updated QNAME model, adding a query label of the query domain name according to a label adding rule of the matched QNAME model to request a response result of a recursive query from a target server.

5. The method of claim 1, wherein, The pre-created QNAME model is a CDN model, and the label adding rule of the CDN model is to add labels on a secondary label and right side labels in a step-by-step incremental manner, and to add labels on the left side of the secondary label in a one-time manner.

6. The method of claim 1, wherein, The pre-created QNAME model is a default QNAME model, and an expected response of the default QNAME model is to receive at least two referral responses when a number of QNAME labels is greater than 2; a label adding rule of the default QNAME model is to increment labels in a step-by-step incremental manner according to a label incremental manner of a domain name minimization query.

7. The method of claim 1, wherein, The pre-created QNAME model is a first QNAME model, and a QNAME of the first QNAME model satisfies a step-by-step addition of a secondary domain name label and a lower level label to obtain a same response result; a label adding rule of the first QNAME model is to add all labels in a one-time manner.

8. The method of claim 7, wherein, In a case where the response result of the recursive query does not match the expected response, the pre-created QNAME model is updated to obtain an updated QNAME model, including: In a case where the response result of the recursive query does not match the expected response of the first QNAME model, the first QNAME model is updated to obtain a second QNAME model and a third QNAME model; The label adding rule of the second QNAME model is to incrementally increase the labels in a domain name minimization label increment manner; and the label adding rule of the third QNAME model is to incrementally add the labels on the right side of a second label and to add the labels on the left side of the second label at one time.

9. The method of claim 1, wherein, The DNS request to be parsed is obtained, including at least one of the following: The DNS request sent by the user equipment is obtained; After receiving the CNAME record, the QNAME is replaced with a standard name in the CNAME record, and a DNS request is initiated again according to the standard name.

10. The method of claim 9, wherein, The target domain name QNAME in the DNS request is matched with the QNAME of the pre-created QNAME model, including: The standard name in the DNS request initiated again is matched with the QNAME of the CDN model; In a case where the target domain name matches at least part of the QNAME of the pre-created QNAME model, the query label of the target domain name is added according to the label adding rule of the matched QNAME model, to request a response result of a recursive query from a target server, including: In a case where the standard name matches the QNAME of the CDN model, the second label and the labels on the right side of the standard name are incrementally added, to request a domain name server NS record of the standard name from a first target domain name server; According to the domain name server NS information, the second label and the labels on the left side of the standard name are added at one time, to request a host A record of the standard name from a second target domain name server.

11. A DNS request processing apparatus characterized by comprising: The apparatus includes: An obtaining module configured to obtain a DNS request to be parsed; A matching module configured to match a target domain name QNAME in the DNS request with a QNAME of a pre-created QNAME model; An adding module configured to, in a case where the target domain name matches at least part of the QNAME of the pre-created QNAME model, add a query label of the target domain name according to a label adding rule of a matched QNAME model, to request a response result of a recursive query from a target server.

12. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the DNS request processing method in any one of claims 1-10.

13. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the DNS request processing method in any one of claims 1-10.

14. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the DNS request processing method in any one of claims 1-10.

Citation Information

Patent Citations

  • Domain name resolution method, system and device and storage medium

    CN111953802A

  • Domain name recursive query method and device, recursive server and DNS system

    CN114363287A