Domain name query method, device, non-volatile storage medium and electronic device
By using a preset cache space and a preset algorithm mapping table to convert IPv4 domain name addresses into IPv6 domain name addresses, the problem that IPv4 services cannot support the use of IPv6 single stack is solved, and IPv6 single stack support for IPv4 services is realized.
Patent Information
- Application Number
- CN202310946774.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-07-28
AI Technical Summary
Existing technologies cannot enable services that only support IPv4 to support the use of IPv6 single stack, resulting in the difficulty of IPv6 single stack network deployment remaining unresolved.
By using a preset cache space and a preset algorithm mapping table, IPv4 domain name addresses are converted into IPv6 domain name addresses, enabling IPv6 single-stack support for IPv4 services.
It enables services that only support IPv4 to support IPv6 single stack usage, meets IPv6 single stack query requests, and solves the difficulties in IPv6 single stack network deployment.
Smart Images

Figure CN116800718B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a domain name query method, device, non-volatile storage medium, and electronic device. Background Art
[0002] A dual-stack network represents a transitional phase in the evolution toward IPv6 and is not suitable for long-term deployment and operation. Pure IPv6 is the clear evolutionary trend for 5G standalone networks. The 5G standards organization, 3GPP, has mandated support for IPv6 in both standard design and device implementation, and equipment deployed on existing networks also supports IPv6. With the widespread deployment of IPv6, most internet services have undergone dual-stack transformation, but some still support IPv4 exclusively. Considering the current network landscape, the challenge of large-scale single-stack IPv6 deployment lies in maintaining the normal operation of IPv4-only services.
[0003] With respect to the problem that the above-mentioned existing technologies cannot enable services that only support IPv4 to support the use of IPv6 single stack, no effective solution has been proposed so far. Summary of the Invention
[0004] The embodiments of the present invention provide a domain name query method, device, non-volatile storage medium and electronic device to at least solve the technical problem that the existing technology cannot enable services that only support IPv4 to support the use of IPv6 single stack.
[0005] According to one aspect of an embodiment of the present invention, a domain name query method is provided, comprising: obtaining a first domain name query request for a target domain name based on a first domain name type, wherein the first domain name query request is used to instruct a query in a preset cache space for a first domain name address corresponding to the target domain name and the first domain name type, the preset cache space being used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships being used to record a set of preset domain name addresses corresponding to a preset domain name and a preset domain name type, the preset domain name types comprising a first domain name type and a second domain name type, the preset domain name addresses comprising a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type; if the first domain name address cannot be found in the preset cache space, converting the first domain name request to a second domain name query request based on a second domain name type, wherein the second domain name query request is used to instruct a query in the preset cache space for a second domain name address corresponding to the target domain name and the second domain name type; and converting the second domain name address to the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent a domain name address conversion relationship between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).
[0006] Optionally, obtaining a first domain name query request for a target domain name based on a first domain name type includes: receiving a target domain name query request for the target domain name; identifying a user type that initiates the target domain name query request, wherein the user type includes: a dual-stack user, a first single-stack user based on Internet Protocol version 6 IPv6, and a second single-stack user based on Internet Protocol version 4 IPv4; when the user type is the first single-stack user, determining that the target domain name query request is the first domain name query request.
[0007] Optionally, when the user type is the first single-stack user, the method further includes: determining whether the target user who initiates the target domain name query request is a preset differentiated user; when the target user is the preset differentiated user, determining whether the target domain name is a preset differentiated domain name; when the target domain name is the preset differentiated domain name, determining that the target domain name query request is a third domain name query request, wherein the third domain name query request is used to indicate querying a first domain name address corresponding to the target domain name and the first domain name type in a customized cache space, and the customized cache space is the same as the preset cache space.
[0008] Optionally, after identifying the user type that initiates the target domain name query request, the method further includes: when the user type is the dual-stack user or the second single-stack user, determining that the target domain name query request is a fourth domain name query request; in response to the fourth domain name query request, querying a third domain name address corresponding to the target domain name in a public cache space, wherein the public cache space is used to record the correspondence between at least one preset domain name and a third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 IPv4 corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 IPv6 corresponding to the second domain name type.
[0009] Optionally, the method further includes: if the third domain name address cannot be found in the public cache space, sending the fourth domain name query request to a recursive server, wherein the recursive server is used to resolve the fourth domain name query request to obtain the third domain name address; receiving the third domain name address returned by the recursive server; and storing the target domain name and the corresponding third domain name address in the public cache space.
[0010] Optionally, the method further includes: obtaining at least one preset domain name stored in the public cache space, and the corresponding third domain name address; identifying the preset domain name type corresponding to the third domain name address; and determining each third domain name address with the corresponding preset domain name and the preset domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0011] Optionally, if the first domain name address cannot be queried in the preset cache space, converting the first domain name request into a second domain name query request based on the second domain name type includes: if the first domain name address cannot be queried in the preset cache space, sending the first domain name query request to a recursive server, wherein the recursive server is used to resolve the first domain name query request to obtain the first domain name address; if the recursive server fails to obtain the first domain name address, converting the first domain name request into a second domain name query request based on the second domain name type.
[0012] Optionally, after sending the first domain name query request to the recursive server, the method further includes: receiving the first domain name address returned by the recursive server; identifying that the preset domain name type corresponding to the first domain name address is the first domain name type; and determining each first domain name address with the corresponding preset domain name and the first domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0013] Optionally, converting the second domain name address into the first domain name address according to a preset algorithm mapping table includes: obtaining the second domain name address, wherein the address digits of the second domain name address are 32 bits; adding a preset address prefix to the second domain name address according to the preset algorithm mapping table to obtain a target domain name address; detecting whether the address digits of the target domain name address reach the preset address digits, wherein the preset address digits are 128 bits; in the case that the address digits of the target domain name address do not reach the preset address digits, supplementing the last digit of the target domain name address with a preset value until the preset address digits are reached; and determining that the target domain name address that reaches the preset address digits is the first domain name address.
[0014] Optionally, the method further includes: if the second domain name address cannot be queried in the preset cache space, sending the second domain name query request to a recursive server, wherein the recursive server is used to resolve the second domain name query request to obtain the second domain name address; and receiving the second domain name address returned by the recursive server.
[0015] Optionally, after receiving the second domain name address returned by the recursive server, the method further includes: identifying that the preset domain name type corresponding to the second domain name address is the second domain name type; and determining each second domain name address and the corresponding preset domain name and the second domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0016] Optionally, after converting the second domain name address into the first domain name address according to a preset algorithm mapping table, the method further includes: identifying that the preset domain name type corresponding to the first domain name address is the first domain name type; and determining each first domain name address and the corresponding preset domain name and the first domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0017] According to another aspect of an embodiment of the present invention, a domain name query device is further provided, including: an acquisition module, configured to acquire a first domain name query request based on a first domain name type for a target domain name, wherein the first domain name query request is used to instruct to query a first domain name address corresponding to the target domain name and the first domain name type in a preset cache space, the preset cache space is used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships is used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types include: a first domain name type and a second domain name type, the preset domain name addresses include: a first domain name address based on Internet Protocol version 6 IPv6 corresponding to the first domain name type, and a first domain name address based on Internet Protocol version 6 IPv6 corresponding to the first domain name type. a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type; a type conversion module, configured to convert the first domain name request into a second domain name query request based on the second domain name type if the first domain name address cannot be queried in the preset cache space, wherein the second domain name query request is used to indicate querying the preset cache space for the second domain name address corresponding to the target domain name and the second domain name type; an address conversion module, configured to convert the second domain name address into the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent a domain name address conversion relationship between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).
[0018] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium is used to store a program. When the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned domain name query method.
[0019] According to another aspect of an embodiment of the present invention, an electronic device is provided, characterized in that it includes: a memory and a processor, the processor is used to run a program stored in the processor, wherein the above-mentioned domain name query method is executed when the program is run.
[0020] In an embodiment of the present invention, a preset cache space is utilized to store and query corresponding preset domain name addresses based on "preset domain names and preset domain name types." The first domain name query request may be an IPv6 single-stack domain name query request, and the query result of the first domain name query request can only be a first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, the preset cache space can be utilized to respond to the first domain name query request of the first domain name type and query the first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, if the first domain name address cannot be queried, the first domain name query request of the first domain name type is converted into a second domain name query request of the second domain name type, and then, in response to the second domain name query request, queries for a second domain name address based on Internet Protocol version 4 (IPv4). The second domain name address is then converted into the first domain name address using a preset algorithm mapping table. This achieves the technical effect of enabling services that only support IPv4 to support IPv6 single-stack usage using the preset cache space and the preset algorithm mapping table. The query result can satisfy the first domain name query request, thereby resolving the technical problem in the prior art of being unable to enable services that only support IPv4 to support IPv6 single-stack usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a flow chart of a domain name query method according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of an architecture according to an embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of DNS64 standard resolution according to an embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of an optimized DNS64 resolution process according to an embodiment of the present invention;
[0026] Figure 5 is a schematic diagram of a cache data synchronization process according to an embodiment of the present invention;
[0027] Figure 6 is a schematic diagram of a user identification process according to an embodiment of the present invention;
[0028] Figure 7 is a schematic diagram of a customized partition update process according to an embodiment of the present invention;
[0029] Figure 8is a schematic diagram of providing a prefix for a non-domain name application according to an embodiment of the present invention;
[0030] Figure 9 is a schematic diagram of a domain name query device according to an embodiment of the present invention;
[0031] Figure 10 It is a structural block diagram of a computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] According to an embodiment of the present invention, an embodiment of a domain name query method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions. Moreover, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in a different order than shown.
[0035] Figure 1 is a flow chart of a domain name query method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0036] Step S102: Obtain a first domain name query request for a target domain name based on a first domain name type, wherein the first domain name query request is used to instruct a query for a first domain name address corresponding to the target domain name and the first domain name type in a preset cache space, the preset cache space is used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships is used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types include: a first domain name type and a second domain name type, and the preset domain name addresses include: a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type;
[0037] Step S104: If the first domain name address cannot be found in the preset cache space, convert the first domain name request into a second domain name query request based on the second domain name type, wherein the second domain name query request is used to instruct to query the preset cache space for a second domain name address corresponding to the target domain name and the second domain name type;
[0038] Step S106: convert the second domain name address into the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent the domain name address conversion relationship between Internet Protocol version 4 IPv4 and Internet Protocol version 6 IPv6.
[0039] In an embodiment of the present invention, a preset cache space is utilized to store and query corresponding preset domain name addresses based on "preset domain names and preset domain name types." The first domain name query request may be an IPv6 single-stack domain name query request, and the query result of the first domain name query request can only be a first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, the preset cache space can be utilized to respond to the first domain name query request of the first domain name type and query the first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, if the first domain name address cannot be queried, the first domain name query request of the first domain name type is converted into a second domain name query request of the second domain name type, and then, in response to the second domain name query request, queries for a second domain name address based on Internet Protocol version 4 (IPv4). The second domain name address is then converted into the first domain name address using a preset algorithm mapping table. This achieves the technical effect of enabling services that only support IPv4 to support IPv6 single-stack usage using the preset cache space and the preset algorithm mapping table. The query result can satisfy the first domain name query request, thereby resolving the technical problem in the prior art of being unable to enable services that only support IPv4 to support IPv6 single-stack usage.
[0040] In the above step S102, the first domain name query request may be sent by an IPv6 single stack user, and is used to instruct to obtain a first domain name based on IPv6 of the target domain name.
[0041] In the above step S102 , the preset cache space may be a cache space based on DNS64.
[0042] In the above step S102, the preset cache space is dedicated to responding to the first domain name query request sent by the IPv6 single stack user.
[0043] In the above step S102, the preset cache space uses "preset domain name and preset domain name type" as the basic unit of storage and query, and records the corresponding preset domain name address, wherein the preset domain name type includes a first domain name type representing a request to obtain an IPv6 address based on Internet Protocol version 6, and a second domain name type based on Internet Protocol version 4 IPv4 address.
[0044] In the above step S102, the preset cache space may store respectively: the preset domain name and the first domain name address corresponding to the first domain name type, and the second domain name address corresponding to the preset domain name and the second domain name type.
[0045] Optionally, the first domain name address based on Internet Protocol version 6 IPv6 can be stored in the preset cache space as a record in the AAAA format, that is, the record in the AAAA format corresponds to the first domain name type; the second domain name address based on Internet Protocol version 4 IPv4 can be stored in the preset cache space as a record in the A format, that is, the record in the A format corresponds to the second domain name type.
[0046] In the above step S102, after obtaining the first domain name query request, the "target domain name and first domain name type" can be determined from the multiple "preset domain names and preset domain name types" recorded in the preset cache space, and then the first domain name address of the target domain name can be determined according to the mapping relationship.
[0047] In the above step S104, if the preset cache space fails to query the first domain name address indicated by the first domain name query request, the first domain name request can be converted into a second domain name query request based on the second domain name type, and then the preset cache space is queried for the second domain name address that has a mapping relationship between the target domain name and the second domain name type.
[0048] In the above step S106, the preset algorithm mapping table is used to record the domain name address conversion relationship of converting the domain name address based on Internet Protocol version 4 IPv4 into the domain name address based on Internet Protocol version 6 IPv6. When the second domain name address can be obtained, the obtained second domain name address can be converted into the first domain name address to respond to the first domain name query request.
[0049] As an optional embodiment, obtaining a first domain name query request for a target domain name based on a first domain name type includes: receiving a target domain name query request for a target domain name; identifying a user type that initiates the target domain name query request, wherein the user type includes: a dual-stack user, a first single-stack user based on Internet Protocol version 6 IPv6, and a second single-stack user based on Internet Protocol version 4 IPv4; when the user type is a first single-stack user, determining that the target domain name query request is a first domain name query request.
[0050] In the above embodiment of the present invention, the user initiating the domain name query can be a dual-stack user, a first single-stack user based on Internet Protocol version 6 IPv6, and a second single-stack user based on Internet Protocol version 4 IPv4, wherein the target domain name query request initiated by the dual-stack user indicates to obtain the domain name address of the target domain name based on Internet Protocol version 6 IPv6 or the domain name address based on Internet Protocol version 4 IPv4; the target domain name query request initiated by the second single-stack user indicates to obtain the domain name address of the target domain name based on Internet Protocol version 4 IPv4; the target domain name query request initiated by the first single-stack user indicates to obtain the domain name address of the target domain name based on Internet Protocol version 6 IPv6. Therefore, the first single-stack user can be used as the first domain name query request based on the first domain name type, thereby realizing the identification of the preset domain name type of the target domain name query request.
[0051] As an optional embodiment, when the user type is a first single-stack user, the method further includes: determining whether the target user who initiates the target domain name query request is a preset differentiated user; when the target user is a preset differentiated user, determining whether the target domain name is a preset differentiated domain name; when the target domain name is a preset differentiated domain name, determining that the target domain name query request is a third domain name query request, wherein the third domain name query request is used to indicate querying a first domain name address corresponding to the target domain name and the first domain name type in a customized cache space, and the customized cache space is the same as the preset cache space.
[0052] In the above embodiment of the present invention, when the user type is a first single-stack user, a preset cache space is instructed to be used to respond to a first domain name query request issued by the first single-stack user. However, the preset cache space needs to process a large number of first domain name query requests issued by multiple first single-stack users. Therefore, the response speed to the first domain name query request is affected by the number of first domain name query requests, and a response cannot be made quickly. To improve the response speed, a preset differentiated user and a preset differentiated domain name can be pre-set. The target domain name query request issued by the preset differentiated user for the preset differentiated domain name is used as a third domain name query request, and a customized cache space is configured to respond to the third domain name query request. Since the customized cache space only responds to the third domain name query request, the number of third domain name query requests that require a response from the customized cache space is far less than the number of first domain name query requests that require a response from the preset cache space. Therefore, the third domain name query request can be quickly responded to based on the customized cache space.
[0053] Optionally, the customized cache space is the same as the preset cache space, and can use "preset domain name and preset domain name type" as the basic unit of storage and query, and record the corresponding preset domain name address, wherein the preset domain name type includes a first domain name type representing a request to obtain an IPv6 address based on Internet Protocol version 6, and a second domain name type based on Internet Protocol version 4 IPv4 address.
[0054] Optionally, the preset domain name stored in the customized cache space may be a preset differentiated domain name.
[0055] Optionally, the preset differentiated user may be a user with a high priority, and the preset differentiated domain name may be a domain name with a high priority.
[0056] As an optional embodiment, after identifying the user type that initiates the target domain name query request, the method also includes: when the user type is a dual-stack user or a second single-stack user, determining that the target domain name query request is a fourth domain name query request; in response to the fourth domain name query request, querying a third domain name address corresponding to the target domain name in a public cache space, wherein the public cache space is used to record the correspondence between at least one preset domain name and the third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 IPv4 corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 IPv6 corresponding to the second domain name type.
[0057] In the above embodiment of the present invention, the public cache space uses the preset domain name as a mapping unit to record the preset domain name and the corresponding first-class third domain name address based on Internet Protocol version 4 IPv4, and the second-class third domain name address based on Internet Protocol version 6 IPv6. When the target object of the target domain name query request is a dual-stack user or a second single-stack user, the public cache space can be used to respond to the fourth domain name query request issued by the dual-stack user or the second single-stack user, thereby achieving a response to the fourth domain name query request.
[0058] Optionally, although the public cache space can provide both a first-class third domain name address based on Internet Protocol version 4 IPv4 and a second-class third domain name address based on Internet Protocol version 6 IPv6, it mainly uses a first-class third domain name address based on Internet Protocol version 4 IPv4. Dual-stack users can use both a first-class third domain name address based on Internet Protocol version 4 IPv4 and a second-class third domain name address based on Internet Protocol version 6 IPv6. Therefore, the public cache space can meet the usage needs of dual-stack users and second single-stack users.
[0059] However, the first single-stack user can only use domain name addresses based on Internet Protocol version 6 (IPv6). If the target domain name does not have a domain name address based on Internet Protocol version 6 (IPv6), the public cache space cannot respond to the first domain name query request of the first single-stack user.
[0060] As an optional embodiment, the method further includes: if the third domain name address cannot be queried in the public cache space, sending a fourth domain name query request to a recursive server, wherein the recursive server is used to resolve the fourth domain name query request to obtain the third domain name address; receiving the third domain name address returned by the recursive server; and storing the target domain name and the corresponding third domain name address in the public cache space.
[0061] In the above embodiment of the present invention, the preset domain name stored in the public cache space may be a domain name frequently accessed by users. When the public cache space cannot provide the third domain name address for the fourth domain name query request, the fourth domain name query request may be sent to the recursive server, which is used to resolve the fourth domain name query request to obtain the third domain name address, complete the acquisition of the third domain name address, and store the obtained third domain name address in the public cache space, so that when the public cache space subsequently responds to the fourth domain name query request, the third domain name address obtained in this recursion can be quickly called.
[0062] As an optional embodiment, the method also includes: obtaining at least one preset domain name stored in the public cache space, and a corresponding third domain name address; identifying the preset domain name type corresponding to the third domain name address; and determining each third domain name address with the corresponding preset domain name and preset domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0063] The above-mentioned embodiment of the present invention can adjust the correspondence between the preset domain name and the third domain name address stored in the public cache space to a domain name mapping relationship between the preset domain name and the preset domain name type and the preset domain name address, thereby realizing the synchronization of the domain name address between the public cache space and the preset cache space.
[0064] Optionally, each third domain name address and the corresponding preset domain name and preset domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space, including: when the preset domain name type corresponding to the third domain name address is the first domain name type, the third domain name address is used as the first domain name address, and then the domain name mapping relationship is established.
[0065] Optionally, each third domain name address and the corresponding preset domain name and preset domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space, including: when the preset domain name type corresponding to the third domain name address is the second domain name type, the third domain name address is used as the second domain name address, and then a domain name mapping relationship is established.
[0066] Optionally, each third domain name address and the corresponding preset domain name and preset domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space, including: when the preset domain name type corresponding to the third domain name address is the second domain name type, the third domain name address is used as the second domain name address; according to the preset algorithm mapping table, the second domain name address is converted into the first domain name address, and then the domain name mapping relationship is established.
[0067] As an optional embodiment, when the first domain name address cannot be queried in the preset cache space, converting the first domain name request into a second domain name query request based on the second domain name type includes: when the first domain name address cannot be queried in the preset cache space, sending the first domain name query request to a recursive server, wherein the recursive server is used to resolve the first domain name query request to obtain the first domain name address; when the recursive server fails to obtain the first domain name address, converting the first domain name request into a second domain name query request based on the second domain name type.
[0068] In the above embodiment of the present invention, the preset domain name stored in the preset cache space may be a domain name frequently accessed by users. When the preset cache space cannot provide the first domain name address for the first domain name query request, the first domain name query request may be sent to a recursive server, which is used by the recursive server to resolve the first domain name query request to obtain the first domain name address, thereby completing the acquisition of the first domain name address.
[0069] In the above embodiment of the present invention, directly using the first domain name address based on Internet Protocol version 6 IPv6 is better than using the first domain name address converted from the second domain name address. Therefore, when the target domain name has a first domain name address based on Internet Protocol version 6 IPv6, it is necessary to obtain the first domain name address of the target domain name first. Furthermore, if the first domain name address of the target domain name cannot be obtained through the recursive server, it means that the target domain name is not configured with the first domain name address. However, in order to enable the first single-stack user that issues the first domain name query request to use the target domain name, it is necessary to convert the second domain name address of the target domain name into the first domain name address.
[0070] As an optional embodiment, after sending the first domain name query request to the recursive server, the method also includes: receiving the first domain name address returned by the recursive server; identifying that the preset domain name type corresponding to the first domain name address is the first domain name type; and determining each first domain name address with the corresponding preset domain name and the first domain name type as a set of domain name mapping relationships and storing them in a preset cache space.
[0071] In the above embodiment of the present invention, when the first domain name address is obtained through a recursive server, the first domain name address obtained through the recursive server can be stored in a preset cache space, so that when the preset cache space subsequently responds to the first domain name query request, the first domain name address obtained through this recursion can be called to quickly respond to the first domain name query request.
[0072] As an optional embodiment, the method further includes: if the second domain name address cannot be queried in the preset cache space, sending the second domain name query request to the recursive server, wherein the recursive server is used to resolve the second domain name query request to obtain the second domain name address; receiving the second domain name address returned by the recursive server; and converting the second domain name address into the first domain name address according to a preset algorithm mapping table.
[0073] In the above embodiment of the present invention, the preset domain name stored in the preset cache space may be a domain name frequently accessed by users. If the preset cache space cannot provide the second domain name address for the second domain name query request, the second domain name query request may be sent to the recursive server, which is used to resolve the second domain name query request to obtain the second domain name address, thereby completing the acquisition of the second domain name address. The second domain name address returned by the recursive server is then converted into the first domain name address, thereby completing the response to the first domain name query request.
[0074] As an optional embodiment, after receiving the second domain name address returned by the recursive server, the method also includes: identifying that the preset domain name type corresponding to the second domain name address is the second domain name type; determining each second domain name address and the corresponding preset domain name and second domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0075] In the above embodiment of the present invention, when the second domain name address is obtained through a recursive server, the second domain name address obtained through the recursive server can be stored in a preset cache space, so that when the preset cache space subsequently responds to a second domain name query request, the second domain name address obtained through this recursion can be called to quickly respond to the second domain name query request.
[0076] As an optional embodiment, after receiving the second domain name address returned by the recursive server, the method also includes: converting the second domain name address into the first domain name address according to a preset algorithm mapping table, identifying the preset domain name type corresponding to the first domain name address as the first domain name type; and determining each first domain name address and the corresponding preset domain name and first domain name type as a set of domain name mapping relationships and storing them in a preset cache space.
[0077] In the above embodiment of the present invention, when the second domain name address is obtained through a recursive server, the second domain name address obtained through the recursive server can be converted into a first domain name address, and then the first domain name address can be stored in a preset cache space, so that when the preset cache space subsequently responds to the first domain name query request, the converted first domain name address can be directly called to quickly respond to the first domain name query request.
[0078] As an optional embodiment, converting the second domain name address into the first domain name address according to a preset algorithm mapping table includes: obtaining the second domain name address, wherein the address digits of the second domain name address are 32 bits; adding a preset address prefix in front of the second domain name address according to the preset algorithm mapping table to obtain the target domain name address; detecting whether the address digits of the target domain name address reach the preset address digits, wherein the preset address digits are 128 bits; if it is detected that the address digits of the target domain name address do not reach the preset address digits, supplementing the last digit of the target domain name address with a preset value until the preset address digits are reached; and determining that the target domain name address that reaches the preset address digits is the first domain name address.
[0079] In the above embodiment of the present invention, the preset algorithm mapping table records the conversion rules for converting the second domain name address into the first domain name address, wherein the second domain name address based on the Internet Protocol version 4 IPv4 is 32 bits, and the first domain name address based on the Internet Protocol version 6 IPv6 is 128 bits. Therefore, to convert the second domain name address into the first domain name address, it is necessary to adjust the domain name address from 32 bits to 128 bits, and then add a preset address prefix in front of the 32-bit second domain name address, and then use the preset value to fill the second domain name address, so as to obtain the 128-bit first domain name address, thereby achieving the technical effect of converting the second domain name address into the first domain name address.
[0080] The present invention also provides a preferred embodiment, which provides a DNS64 implementation method based on intelligent cache.
[0081] Based on technical maturity and deployment experience of other global operators, 464XLAT technology is currently the best solution for single-stack mobile network migration. This technology requires terminals to support CLAT and the deployment of NAT64 and DNS64 on the network side. Currently, products from companies like Microsoft, Google, Apple, and Cisco all support IPv6 single-stack. iOS and Android terminals have long supported IPv6 single-stack. Firewalls generally support NAT64, but carrier DNS servers have generally yet to achieve commercial success. Operator DNS servers need to be upgraded to support DNS64 and RFC7050 for commercial use.
[0082] Currently, the main open-source software with DNS resolution capabilities include BIND and UNBOUND. However, these software are still some distance away from full-scale commercial use, mainly due to the following aspects:
[0083] In terms of DNS performance, operators' DNS request traffic is very large. For example, the telecommunications DNS in a certain region has exceeded 12 million QPS. Operators generally adopt a two-level architecture of cache + recursion, with the cache carrying more than 95% of common domain name resolution requests. However, existing mainstream open source software cannot yet support this two-level architecture well.
[0084] In terms of DNS functions, Bind only supports configuration based on views, not configuration based on domain name prefixes. Ubound does not support views and can only support global prefix configuration, so it cannot support some customized resolution requirements of operators.
[0085] In terms of DNS security, the separation of caching and recursion reduces the impact of single failures on the system and allows for the development of different protection strategies. The cache system primarily provides cache resolution services and related strategies, including forced resolution, blocking, intelligent routing redirection, incorrect domain name redirection, forward forwarding, and security protection modules. The security protection module primarily includes ACL access control, IP rate limiting (precise and global), domain name rate limiting (precise and global), amplification and recursive attacks, and domain name type access control. The recursive subsystem primarily provides recursive resolution services, focusing on the implementation of DNS protocol functions. The recursive system does not directly provide services to the outside world and has better anti-attack capabilities. These open source DNS software also cannot be implemented in terms of network security.
[0086] In summary, operators cannot directly use off-the-shelf DNS software to achieve large-scale commercial use of DNS64. They need to customize and optimize the cache and recursion of the existing network.
[0087] The technical solution claimed in this application analyzes the technical characteristics of DNS64+NAT64 and the shortcomings of the current DNS64 open source software, combines the mainstream DNS system architecture of operators and IPv6 single-stack service requirements, and proposes a method for transforming the operator-level DNS64 system.
[0088] It should be noted that traditional caching software does not support the DNS64 function. When a user initiates an AAAA type (that is, the first domain name type) domain name request and no cache is found and no recursive result is found, the user cannot obtain the IPv6 address of the domain name (that is, the first domain name address cannot be queried based on the first domain name query request). Therefore, in order to meet the resolution needs of single-stack users, the DNS64 cache software needs to increase the DNS64 function and add three new functional modules: DNS64 configuration module, DNS64 judgment and execution module, and DNS64 storage module.
[0089] Figure 2is a schematic diagram of an architecture according to an embodiment of the present invention, such as Figure 2 As shown, it at least includes: a DNS64 configuration module, a DNS64 judgment execution module and a DNS64 storage module.
[0090] Optionally, the DNS64 configuration module includes the DNS64 function switch and the DNS64 matching policy. The DNS64 function switch is further divided into the "DNS64 function master switch" and the "nxdomain recursion result DNS64 control switch." If the "DNS64 function master switch" is off, the system maintains the same cache functionality as the existing network. The "nxdomain recursion result DNS64 control switch" controls whether DNS64 is enabled when the recursion result of an AAAA request for a domain name is nxdomain. The DNS64 matching policy primarily includes prefix address configuration, VIP client configuration, and partition configuration.
[0091] Optionally, the DNS64 judgment execution module includes:
[0092] DNS64 execution conditions: "DNS64 function master switch" is turned on; the domain name AAAA type recursive request (such as the first domain name query request based on the first domain name type) does not obtain the corresponding address result set (such as the first domain name address);.
[0093] DNS64 recursive request execution: Change the AAAA type request of the domain name to an A type request (such as converting the first domain name request into a second domain name query request based on the second domain name type) and perform recursion again.
[0094] DNS64 policy matching execution: For the recursive response result, determine whether it is a response to a DNS64 recursive request. If it is a response to a DNS64 recursive request, map the IPv4 address in the response result to an IPv6 address (such as converting the second domain name address to the first domain name address).
[0095] Optionally, the DNS64 storage module (i.e., the preset cache space) caches and stores information in units of "domain name + record type" (i.e., the preset domain name and the preset domain name type). This differs from the original DNS well-known open source software BIND, which stores and queries in units of domains. After the DNS64 policy is executed, the result set of "domain name + A type" (i.e., the target domain name and the second domain name address corresponding to the second domain name type) and the mapping result set of "domain name + AAAA type" (i.e., the target domain name and the first domain name address corresponding to the first domain name type) are recorded respectively.
[0096] Optionally, in order to improve the cache hit rate and reduce the recursive load, the cache (i.e., the preset cache space) will actively synchronize the non-empty AAAA record data newly received in the public cache space (i.e., the first domain name address associated with the first domain name type in the public cache space) to the DNS64 general cache space (i.e., the preset cache space) through the cache data synchronization sub-module.
[0097] As an optional embodiment, the mapping method of A records and AAAA records (i.e., converting the second domain name address to the first domain name address) includes: converting the IPv4 address to the IPv6 address using prefix conversion, adding an address prefix to the IPv4 address according to certain rules to achieve IPv4 to IPv6 mapping, and embedding the IPv4 address in the mapped IPv6 address. The DNS64 cache software defines an IPv4 and IPv6 conversion algorithm mapping table (i.e., a preset algorithm mapping table). According to this algorithm mapping table, the IPv4 address can be converted to the IPv6 address. As long as the algorithm mapping table is not modified, the mapping relationship between IPv4 and IPv6 will not change, and it is a stable and reliable conversion relationship.
[0098] It should be noted that IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses. The DNS64 cache software limits address prefixes to a maximum of 96 bits. If an invalid address prefix is encountered, the DNS64 cache software will report an error upon loading. The mapped IPv6 address consists of the following format: address prefix (also known as the default address prefix) + IPv4 address. After assembly, if the IPv6 address is less than 128 bits long, zeros are appended to the end of the IPv6 address until the IPv6 address reaches 128 bits.
[0099] Alternatively, as Figure 2 As shown, when the DNS64 cache software receives an AAAA type domain name request (i.e., receives a first domain name query request), it will first obtain an AAAA type IPv6 response result set for the domain name (i.e., query the first domain name address according to the first domain name query request). If it cannot be obtained, the AAAA request type is modified to an A request type (i.e., the first domain name request is converted into a second domain name query request based on the second domain name type), and an A type IPv4 response result set for the domain name is obtained (i.e., query the second domain name address according to the second domain name query request). The obtained IPv4 response result set (i.e., the second domain name address) is subjected to an address mapping, mapped to an IPv6 result set (i.e., the first domain name address), and finally the IPv6 result set is responded to the client.
[0100] Optionally, the recursive software processing method of DNS64 is similar to the cache software processing method of DNS64. If the domain name request cannot obtain the AAAA type IPv6 response result set (that is, the first domain name address cannot be recursively obtained according to the first domain name query request), then the domain name obtains the A type IPv4 response result set (that is, the second domain name address is recursively obtained according to the second domain name query request), and then maps the IPv4 response result to the IPv6 result set (that is, converting the second domain name address into the first domain name address), and finally uses the IPv6 result set (that is, the first domain name address) to respond to the AAAA type request of the domain name (that is, the first domain name query request).
[0101] Figure 3 Schematic diagram of a DNS64 standard resolution according to an embodiment of the present invention. Figure 3 As shown, when the DNS request resolves the IPv6 address of example.abc.com (that is, the first domain name address), the DNS64 server can forward the request for the IPv6 address to the DNS server to determine whether example.abc.com has an IPv6 address. Then, if it is determined that the IPv6 address exists, the DNS server can perform a DNS response through the DNS64 server and return the IPv6 address of example.abc.com.
[0102] Optionally, when it is determined that there is no IPv6 address, the IPv4 address of example.abc.com (that is, the second domain name address) is resolved through the DNS64 server, and then the request for the IPv4 address is forwarded to the DNS server. The DNS server can then perform a DNS response through the DNS64 server to determine the IPv address of example.abc.com. The DNS64 server then converts the IPv4 address of example.abc.com into an IPv6 address and returns the IPv6 address of example.abc.com.
[0103] Figure 4 Schematic diagram of an optimized DNS64 resolution process according to an embodiment of the present invention. Figure 4 As shown, the steps include:
[0104] S41, receiving a DNS request (ie, receiving a target domain name query request).
[0105] S42, determine whether it is a single stack address segment (ie, determine whether the user type that issues the target domain name query request is the first single stack user), if so, execute S43; if not, execute S421, and the public cache space responds.
[0106] S421, determine whether the domain name request hits the common cache (ie, determine whether the third domain name address can be found in the public cache space). If so, execute S46; if not, execute S422.
[0107] S422, normal recursion / forwarding (ie, sending the fourth domain name query request to the recursive server).
[0108] S423, updating the common area cache (ie, storing the target domain name and the corresponding third domain name address into the public cache space).
[0109] S424, synchronizing data to the DNS64 cache (ie, determining each third domain name address and the corresponding preset domain name and preset domain name type as a set of domain name mapping relationships and storing them in the preset cache space).
[0110] S43, determine whether it is a differentiated domain name for a differentiated customer (determine whether the target user who initiates the target domain name query request is a preset differentiated user, and determine whether the target domain name is a preset differentiated domain name). If so, execute S44, otherwise execute S431, and respond from the preset cache space.
[0111] S431, determine whether the DNS64 general cache is hit (that is, determine whether a response from the preset cache space is required). If so, determine the first domain name address through the preset cache space and execute S46, otherwise execute S432.
[0112] S432, recursive AAAA record (ie, sending the first domain name query request to the recursive server to obtain the first domain name address).
[0113] S433, requesting whether the AAAA record is empty, if so, that is, when the recursive server fails to obtain the first domain name address, executing S434; if not, that is, when the recursive server returns the first domain name address, executing S45.
[0114] S434, recursive A record (ie, sending the second domain name query request to the recursive server to obtain the second domain name address).
[0115] S435, combining the resolution results (ie, converting the second domain name address into the first domain name address), and then executing S45.
[0116] S44, determine whether the DNS64 partition cache is hit (that is, determine whether the customized cache space is responded to). If so, execute S46; otherwise, initiate ECS recursion and execute S45 after receiving the ECS recursion result.
[0117] Optionally, ECS recursion can deploy cloud servers as recursive servers, and perform recursive processes through cloud servers to improve recursive efficiency.
[0118] S45, updating the DNS64 cache (ie, storing the domain name address returned by the recursive server into a preset cache space), and then executing S46.
[0119] S46, a cache response is used to respond to the target domain name query request and return a corresponding preset domain name address.
[0120] Optionally, in order to meet the customized resolution requirements of different customer businesses, the DNS system has been improved in terms of policy matching. It can support the configuration of different resolution prefixes for different source IPs (views), and also supports the configuration of different resolution prefixes for different domain names in the same view. In terms of caching logic, after the DNS64 cache obtains the recursive return result, it will write the domain name + request type (A or AAAA, etc.) combination into the cache area, that is, the same domain name + different request types will have different cache entries.
[0121] Figure 5 FIG. 1 is a schematic diagram of a cache data synchronization process according to an embodiment of the present invention. Figure 5 As shown, the steps include:
[0122] S51, module starts.
[0123] S52: Receive a new recursive AAAA response message (equivalent to receiving the third domain name address, that is, receiving the second-class third domain name address).
[0124] S53, updating the public cache (ie, storing the target domain name and the corresponding third domain name address into the public cache space).
[0125] S54, determine whether the AAAA record is empty (that is, determine whether the third domain name address can be queried in the public cache space), if so, execute S55, if not, execute S56.
[0126] S55: respond to the user request (ie, respond to the fourth domain name query request).
[0127] S56, updating the DNS64 general cache (ie, determining each third domain name address and the corresponding preset domain name and preset domain name type as a set of domain name mapping relationships and storing them in the preset cache space), and then executing S57.
[0128] S57: respond to the user request (ie, respond to the first domain name query request).
[0129] Figure 6 FIG. 1 is a schematic diagram of a user identification process according to an embodiment of the present invention. Figure 6 As shown, the steps include:
[0130] S61, receiving a user request (ie, receiving a target domain name query request).
[0131] S62, determine whether it is an IPv6 single stack user (that is, determine whether it is a first single stack user), if not, execute S63, if so, execute S64.
[0132] S63, the public cache responds (ie, determines that the target domain name query request is the fourth domain name query request, and responds to the fourth domain name query request from the public cache space).
[0133] S64, determine whether it is a differentiated user (ie, determine whether the target user who initiated the target domain name query request is a preset differentiated user), if not, execute S65, if yes, execute S66.
[0134] S65, DNS64 general cache response (i.e., determining that the target domain name query request is the first domain name query request, and using the preset cache space to respond to the first domain name query request)
[0135] S66, determine whether it is a differentiated domain name (ie, determine whether the target domain name is a preset differentiated domain name), if not, execute S65, if yes, execute S67.
[0136] S66, customizing the partition cache response (ie, determining that the target domain name query request is a third domain name query request, and using the customized cache space to respond to the third domain name query request).
[0137] Figure 7 is a schematic diagram of a customized partition update process according to an embodiment of the present invention, such as Figure 7 As shown, if the address segment is a differentiated address segment for a single stack, but the accessed domain name is a non-differentiated domain name, the DNS64 universal cache module will respond (i.e., the preset cache space will respond to the first domain name query request). When the domain name is a differentiated domain name, a request is made to the customized partition (i.e., the customized cache space will respond to the third domain name query request). If the customized partition request does not hit the cache, the customized partition will make a request to the ECS recursion. If ECS recursion is authorized to support, ECS recursion will be directly initiated. If ECS recursion is not supported, ECS recursion will directly force resolution according to the policy.
[0138] Figure 8 is a schematic diagram of providing a prefix for a non-domain name application according to an embodiment of the present invention, such as Figure 8As shown, it includes: In order to facilitate non-domain name applications to accurately obtain IPv6 prefixes, a new RFC7050 business sub-process is added. This process is mainly used to detect whether DNS64 is running and how to find the IPv6 prefix for network connection protocol conversion. Non-IPv6 single-stack users directly respond with an empty message when requesting the AAAA record of the domain name ipv4only.arpa. Ordinary IPv6 single-stack users directly use the common prefix ::+192.0.0.170 / 192.0.0.170, and differentiated IPv6 single-stack users directly use the agreed prefix ::+192.0.0.170 / 192.0.0.170.
[0139] Optionally, in terms of user identification, if the address segment is a non-single-stack address segment (for dual-stack users), it will be responded directly by the public cache; if the address segment is a single-stack differentiated address segment (for preset differentiated users), and the access domain name is a differentiated domain name (such as the preset differentiated domain name), it will be responded by the differentiated customized partition cache (that is, the customized cache space); other requests will be responded by the DNS64 general cache module (such as the preset cache space).
[0140] Optionally, in terms of data synchronization, the cache will actively synchronize the newly received non-empty AAAA record data in the public cache space to the DNS64 general cache space (that is, synchronize the third domain name address in the public cache space to the preset cache space). The unit information of cache search and storage is "domain name + record type" (that is, the preset domain name and the preset domain name type). Different from the original DNS famous open source software BIND which stores and queries in units of domains, after the DNS64 policy is executed, the mapping result set of "domain name + A type" (such as the preset domain name and the second domain name type) (such as the second domain name address) and the mapping result set of "domain name + AAAA type" (such as the preset domain name and the first domain name type) (such as the first domain name address) are recorded respectively.
[0141] The above-mentioned embodiments of the present application change the traditional practice of implementing DNS64 with open source recursive software, and implement DNS64 by transforming the cache, which not only greatly improves the service capabilities of DNS64, but also can share the existing recursive system; realizes the fusion of ordinary cache and DNS64 cache, which not only saves equipment resources but also improves the cache hit rate; utilizes the ECS function to provide differentiated resolution for VIP customers, such as differentiated resolution results, different IPV6 prefixes, etc., and this function can be used to carry out some value-added services in the future; utilizes cache partition data synchronization technology to effectively improve the efficiency of recursive resolution; and has been adapted to Huawei's Kirin chip and Tongxin operating system.
[0142] In terms of deployment effect, the above-mentioned embodiments of the present application utilize a fusion bearer solution of intelligent cache + ordinary recursion + ECS recursion, which not only meets the resolution needs of ordinary customers, but also meets the resolution needs of DNS64 and differentiated customers; provides DNS64 services for the full IPV6 transformation of mobile Internet of People and Internet of Things; provides differentiated resolution services for VIP customers; has a wide range of applications and is applicable to the DNS systems of operators at all levels; and can effectively promote the popularization of IPV6 services.
[0143] As an optional example, take the two domain names www.xxxx123.com and www.xxxx456.com as examples. www.xxxx123.com has both corresponding A records (such as the second domain name type) and AAAA records (such as the first domain name type), while www.xxxx456.com only has A records (such as the second domain name type).
[0144] When an ordinary dual-stack user resolves www.xxxx123.com, he can obtain both an IPv4 address (such as the second domain name address) and an IPv6 address (such as the first domain name address). At this time, the user can access the website through IPv4 (such as the second domain name address) or IPv6 (such as the first domain name address). When this user resolves www.xxxx456.com, he can only obtain an IPv4 address (such as the second domain name address), so he can only access the website through the IPv4 address (such as the second domain name address).
[0145] Alternatively, in a DNS64+NAT networking environment, a single-stack IPv6 user (such as the first single-stack user) can directly access the AAAA-resolved IPv6 address (such as the first domain name address) when accessing www.xxxx123com. However, when accessing www.xxxx456.com, DNS64 is required to provide the corresponding IPv6 resolution result (such as the first domain name address), and then NAT64 performs the corresponding NAT conversion. The DNS64 resolution process is as follows:
[0146] 1. If an ordinary user (such as a dual-stack user or a second single-stack user) accesses the two domain names www.xxxx123.com and www.xxxx456.com, the public cache of the cache (such as the public cache space) will respond directly. If the cache is not hit, the general cache will initiate recursion to obtain the result and then respond to the user (that is, if the third domain name address cannot be queried in the public cache space, the fourth domain name query request will be sent to the recursive server); in order to improve the cache resolution success rate, the AAAA non-empty record will automatically synchronize a copy of the data to the DNS4 cache (that is, synchronization between the public cache space and the preset cache space).
[0147] 2. If an IPV6 single-stack user (such as the first single-stack user) accesses www.xxxx123.com, the DNS64 cache responds to the AAAA request (such as the first domain name query request). If the cache is not hit, the cache initiates recursion to obtain the result and then responds to the user (that is, if the first domain name address cannot be queried in the preset cache space, the first domain name query request is sent to the recursive server).
[0148] 3. If an IPV6 single-stack user (such as the first single-stack user) visits www.xxxx456.com, the DNS64 cache responds to the AAAA request (such as the first domain name query request). If the cache is hit, the cache directly feeds back the result. If it is not hit, the cache initiates an AAAA recursive query (that is, when the first domain name address cannot be found in the preset cache space, the first domain name query request is sent to the recursive server). When the DNS64 cache obtains the recursive result, it finds that the AAAA result is empty (that is, the recursive server fails to obtain the first domain name address), and initiates a recursive query of the A record (that is, converts the first domain name request into a second domain name query request based on the second domain name type). After obtaining the A record response, the agreed IPv6 prefix is used to construct an AAAA response message. After the construction is completed, the result is fed back to the user (that is, the second domain name address is converted into the first domain name address), and the result is stored in the DNS64 cache (that is, stored in the preset cache space).
[0149] 4. If the single-stack user is a VIP customer (i.e., a pre-defined differentiated user) and www.xxxx456.com is a designated differentiated domain name (i.e., a pre-defined differentiated domain name), a dedicated customized cache partition (i.e., a customized cache space) will respond. If the cache hits, the customized cache (i.e., the customized cache space) will respond directly. If the cache misses, the cache will recursively request the ECS, which will then perform ECS recursion or domain name strong resolution according to the agreement. After the cache obtains the recursive resolution result, it constructs an AAAA response message based on the agreed prefix and feeds the result back to the customer. For VIP customers, DNS64 can specify a specific prefix or resolution result for a specific domain name.
[0150] The above technical solution of this application realizes the fusion of ordinary cache and DNS64 cache, which not only saves equipment resources but also improves the cache hit rate; the ECS function can provide differentiated resolution for VIP customers. If the resolution results are differentiated, different IPv6 prefixes, etc., this function can be used to carry out some value-added services in the future; the cache partition data synchronization technology is used to effectively improve the efficiency of recursive resolution.
[0151] According to an embodiment of the present invention, a domain name query device embodiment is also provided. It should be noted that the domain name query device can be used to execute the domain name query method in the embodiment of the present invention, and the domain name query method in the embodiment of the present invention can be executed in the domain name query device.
[0152] Figure 9 is a schematic diagram of a domain name query device according to an embodiment of the present invention. Figure 9 As shown, the device may include: an acquisition module 92, configured to acquire a first domain name query request for a target domain name based on a first domain name type, wherein the first domain name query request is used to instruct to query a first domain name address corresponding to the target domain name and the first domain name type in a preset cache space, the preset cache space is used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships is used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types include: a first domain name type and a second domain name type, the preset domain name addresses include: a first domain name address based on Internet Protocol Version 6 IPv6 corresponding to the first domain name type, and a first domain name address based on Internet Protocol Version 6 IPv6 corresponding to the first domain name type. a second domain name address based on Internet Protocol version 4 IPv4; a type conversion module 94, configured to convert the first domain name request into a second domain name query request based on the second domain name type when the first domain name address cannot be queried in the preset cache space, wherein the second domain name query request is used to indicate querying the preset cache space for a second domain name address corresponding to the target domain name and the second domain name type; an address conversion module 96, configured to convert the second domain name address into the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent the domain name address conversion relationship between Internet Protocol version 4 IPv4 and Internet Protocol version 6 IPv6.
[0153] It should be noted that the acquisition module 92 in this embodiment can be used to execute step S102 in the embodiment of the present application, the type conversion module 94 in this embodiment can be used to execute step S104 in the embodiment of the present application, and the address conversion module 96 in this embodiment can be used to execute step S106 in the embodiment of the present application. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments.
[0154] In an embodiment of the present invention, a preset cache space is utilized to store and query corresponding preset domain name addresses based on "preset domain names and preset domain name types." The first domain name query request may be an IPv6 single-stack domain name query request, and the query result of the first domain name query request can only be a first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, the preset cache space can be utilized to respond to the first domain name query request of the first domain name type and query the first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, if the first domain name address cannot be queried, the first domain name query request of the first domain name type is converted into a second domain name query request of the second domain name type, and then, in response to the second domain name query request, queries for a second domain name address based on Internet Protocol version 4 (IPv4). The second domain name address is then converted into the first domain name address using a preset algorithm mapping table. This achieves the technical effect of enabling services that only support IPv4 to support IPv6 single-stack usage using the preset cache space and the preset algorithm mapping table. The query result can satisfy the first domain name query request, thereby resolving the technical problem in the prior art of being unable to enable services that only support IPv4 to support IPv6 single-stack usage.
[0155] As an optional embodiment, the acquisition module includes: a first receiving unit, used to receive a target domain name query request for a target domain name; a first identification unit, used to identify the user type that initiates the target domain name query request, wherein the user type includes: a dual-stack user, a first single-stack user based on Internet Protocol version 6 IPv6, and a second single-stack user based on Internet Protocol version 4 IPv4; a first determination unit, used to determine that the target domain name query request is a first domain name query request when the user type is a first single-stack user.
[0156] As an optional embodiment, when the user type is a first single-stack user, the device further includes: a first judgment unit, used to judge whether the target user who initiates the target domain name query request is a preset differentiated user; a second judgment unit, used to judge whether the target domain name is a preset differentiated domain name when the target user is a preset differentiated user; a second determination unit, used to determine that the target domain name query request is a third domain name query request when the target domain name is a preset differentiated domain name, wherein the third domain name query request is used to indicate querying a first domain name address corresponding to the target domain name and the first domain name type in a customized cache space, and the customized cache space is the same as the preset cache space.
[0157] As an optional embodiment, the device also includes: a third determination unit, used to, after identifying the user type that initiates the target domain name query request, determine that the target domain name query request is a fourth domain name query request when the user type is a dual-stack user or a second single-stack user; a query unit, used to respond to the fourth domain name query request and query a third domain name address corresponding to the target domain name in the public cache space, wherein the public cache space is used to record the correspondence between at least one preset domain name and the third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 IPv4 corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 IPv6 corresponding to the second domain name type.
[0158] As an optional embodiment, the device also includes: a sending unit, used to send a fourth domain name query request to a recursive server when the third domain name address cannot be queried in the public cache space, wherein the recursive server is used to resolve the fourth domain name query request to obtain the third domain name address; a second receiving unit, used to receive the third domain name address returned by the recursive server; and a first storage unit, used to store the target domain name and the corresponding third domain name address in the public cache space.
[0159] As an optional embodiment, the device also includes: a first acquisition unit, used to obtain at least one preset domain name and a corresponding third domain name address stored in the public cache space; a second identification unit, used to identify the preset domain name type corresponding to the third domain name address; and a second storage unit, used to determine each third domain name address and the corresponding preset domain name and preset domain name type as a set of domain name mapping relationships and store them in the preset cache space.
[0160] As an optional embodiment, the type conversion module includes: a first sending submodule, used to send the first domain name query request to the recursive server when the first domain name address cannot be queried in the preset cache space, wherein the recursive server is used to resolve the first domain name query request to obtain the first domain name address; a type conversion submodule, used to convert the first domain name request into a second domain name query request based on the second domain name type when the recursive server fails to obtain the first domain name address.
[0161] As an optional embodiment, the device also includes: a first receiving submodule, used to receive the first domain name address returned by the recursive server after sending the first domain name query request to the recursive server; a first identification submodule, used to identify that the preset domain name type corresponding to the first domain name address is the first domain name type; and a first storage submodule, used to determine each first domain name address with the corresponding preset domain name and first domain name type as a set of domain name mapping relationships and store them in a preset cache space.
[0162] As an optional embodiment, the address conversion module includes: a second acquisition unit, used to obtain a second domain name address, wherein the address digits of the second domain name address are 32 bits; an adding unit, used to add a preset address prefix in front of the second domain name address according to a preset algorithm mapping table to obtain a target domain name address; a detection unit, used to detect whether the address digits of the target domain name address reach the preset address digits, wherein the preset address digits are 128 bits; a supplementing unit, used to supplement the last digit of the target domain name address with a preset value until the preset address digits are reached when detecting that the address digits of the target domain name address do not reach the preset address digits; a fourth determination unit, used to determine that the target domain name address that reaches the preset address digits is the first domain name address.
[0163] As an optional embodiment, the device also includes: a second sending submodule, used to send a second domain name query request to a recursive server when the second domain name address cannot be queried in the preset cache space, wherein the recursive server is used to resolve the second domain name query request to obtain the second domain name address; a second receiving submodule, used to receive the second domain name address returned by the recursive server; and a first address conversion submodule, used to convert the second domain name address into the first domain address according to a preset algorithm mapping table.
[0164] As an optional embodiment, the device also includes: a second identification submodule, used to identify the preset domain name type corresponding to the second domain name address as the second domain name type after receiving the second domain name address returned by the recursive server; a second storage submodule, used to determine each second domain name address and the corresponding preset domain name and second domain name type as a set of domain name mapping relationships and store them in a preset cache space.
[0165] As an optional embodiment, the device also includes: a second address conversion submodule, used to convert the second domain name address into the first domain name address according to a preset algorithm mapping table after receiving the second domain name address returned by the recursive server; a third identification submodule, used to identify that the preset domain name type corresponding to the first domain name address is the first domain name type; and a third storage submodule, used to determine each first domain name address with the corresponding preset domain name and first domain name type as a set of domain name mapping relationships and store them in a preset cache space.
[0166] The embodiment of the present invention can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.
[0167] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.
[0168] In this embodiment, the computer terminal can execute program code for the following steps in the domain name query method: obtaining a first domain name query request based on a first domain name type for a target domain name, wherein the first domain name query request is used to instruct a query for a first domain name address corresponding to the target domain name and the first domain name type in a preset cache space, the preset cache space being used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships being used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types including: a first domain name type and a second domain name type, and the preset domain name addresses including: a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type; if the first domain name address cannot be found in the preset cache space, converting the first domain name request to a second domain name query request based on a second domain name type, wherein the second domain name query request is used to instruct a query for a second domain name address corresponding to the target domain name and the second domain name type in the preset cache space; and converting the second domain name address to the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent a domain name address conversion relationship between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).
[0169] Optionally, Figure 10 1 is a block diagram of a computer terminal according to an embodiment of the present invention. Figure 10 As shown, the computer terminal 1000 may include: one or more (only one is shown in the figure) processors 1002 and a memory 1004.
[0170] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the domain name query method and apparatus in the embodiments of the present invention. The processor executes the software programs and modules stored in the memory to perform various functional applications and data processing, thereby implementing the aforementioned domain name query method. The memory can include high-speed random access memory (RAM) and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory can further include memory remotely located from the processor, which can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0171] The processor may call information and an application stored in the memory through a transmission device to perform the following steps: obtaining a first domain name query request for a target domain name based on a first domain name type, wherein the first domain name query request is used to instruct a query for a first domain name address corresponding to the target domain name and the first domain name type in a preset cache space, the preset cache space being used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships being used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types including: a first domain name type and a second domain name type, and the preset domain name addresses including: a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type; if the first domain name address cannot be queried in the preset cache space, converting the first domain name request to a second domain name query request based on the second domain name type, wherein the second domain name query request is used to instruct a query for a second domain name address corresponding to the target domain name and the second domain name type in the preset cache space; and converting the second domain name address to the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent a domain name address conversion relationship between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).
[0172] Optionally, the processor may further execute program code of the following steps: receiving a target domain name query request for a target domain name; identifying a user type that initiates the target domain name query request, wherein the user types include: a dual-stack user, a first single-stack user based on Internet Protocol version 6 IPv6, and a second single-stack user based on Internet Protocol version 4 IPv4; and when the user type is a first single-stack user, determining that the target domain name query request is a first domain name query request.
[0173] Optionally, the processor may further execute program code of the following steps: when the user type is a first single-stack user, determining whether the target user initiating the target domain name query request is a preset differentiated user; when the target user is a preset differentiated user, determining whether the target domain name is a preset differentiated domain name; when the target domain name is a preset differentiated domain name, determining that the target domain name query request is a third domain name query request, wherein the third domain name query request is used to indicate querying a first domain name address corresponding to the target domain name and the first domain name type in a customized cache space, and the customized cache space is the same as the preset cache space.
[0174] Optionally, the processor may also execute program code of the following steps: after identifying the user type that initiates the target domain name query request, if the user type is a dual-stack user or a second single-stack user, determining that the target domain name query request is a fourth domain name query request; in response to the fourth domain name query request, querying a third domain name address corresponding to the target domain name in the public cache space, wherein the public cache space is used to record the correspondence between at least one preset domain name and the third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 IPv4 corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 IPv6 corresponding to the second domain name type.
[0175] Optionally, the processor may further execute program code of the following steps: if the third domain name address cannot be found in the public cache space, sending a fourth domain name query request to the recursive server, wherein the recursive server is used to resolve the fourth domain name query request to obtain the third domain name address; receiving the third domain name address returned by the recursive server; and storing the target domain name and the corresponding third domain name address in the public cache space.
[0176] Optionally, the processor may also execute the program code of the following steps: obtaining at least one preset domain name and a corresponding third domain name address stored in the public cache space; identifying the preset domain name type corresponding to the third domain name address; and determining each third domain name address and the corresponding preset domain name and preset domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0177] Optionally, the processor may further execute program code of the following steps: if the first domain name address cannot be found in the preset cache space, sending the first domain name query request to the recursive server, wherein the recursive server is used to resolve the first domain name query request to obtain the first domain name address; if the recursive server fails to obtain the first domain name address, converting the first domain name request into a second domain name query request based on the second domain name type.
[0178] Optionally, the processor may also execute the program code of the following steps: after sending the first domain name query request to the recursive server, receiving the first domain name address returned by the recursive server; identifying the preset domain name type corresponding to the first domain name address as the first domain name type; determining each first domain name address with the corresponding preset domain name and the first domain name type as a set of domain name mapping relationships and storing them in a preset cache space.
[0179] Optionally, the processor may also execute the following program code: obtaining a second domain name address, wherein the address digits of the second domain name address are 32 bits; adding a preset address prefix in front of the second domain name address according to a preset algorithm mapping table to obtain a target domain name address; detecting whether the address digits of the target domain name address reach the preset address digits, wherein the preset address digits are 128 bits; if it is detected that the address digits of the target domain name address do not reach the preset address digits, supplementing the last digit of the target domain name address with a preset value until the preset address digits are reached; and determining that the target domain name address that reaches the preset address digits is the first domain name address.
[0180] Optionally, the processor may further execute program code of the following steps: if the second domain name address cannot be found in the preset cache space, sending the second domain name query request to the recursive server, wherein the recursive server is used to resolve the second domain name query request to obtain the second domain name address; receiving the second domain name address returned by the recursive server; and converting the second domain name address into the first domain name address according to a preset algorithm mapping table.
[0181] Optionally, the above-mentioned processor can also execute the program code of the following steps: after receiving the second domain name address returned by the recursive server, identify the preset domain name type corresponding to the second domain name address as the second domain name type; determine each second domain name address and the corresponding preset domain name and second domain name type as a set of domain name mapping relationships and store them in the preset cache space.
[0182] Optionally, the above-mentioned processor can also execute the program code of the following steps: after receiving the second domain name address returned by the recursive server, identify the preset domain name type corresponding to the first domain name address as the first domain name type; determine each first domain name address and the corresponding preset domain name and first domain name type as a set of domain name mapping relationships and store them in the preset cache space.
[0183] An embodiment of the present invention provides a domain name query solution. Using a preset cache space, a corresponding preset domain name address can be stored and queried based on "preset domain name and preset domain name type." A first domain name query request can be an IPv6 single-stack domain name query request, and the query result of the first domain name query request can only be a first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, using the preset cache space, a first domain name query request of the first domain name type can be responded to, querying the first domain name address based on Internet Protocol version 6 (IPv6). Furthermore, if the first domain name address cannot be queried, the first domain name query request of the first domain name type can be converted into a second domain name query request of the second domain name type, and then, in response to the second domain name query request, querying a second domain name address based on Internet Protocol version 4 (IPv4). A preset algorithm mapping table is then used to convert the second domain name address into the first domain name address. This achieves the technical effect of enabling services that only support IPv4 to support IPv6 single-stack usage by using the preset cache space and the preset algorithm mapping table, ensuring that the query result can satisfy the first domain name query request, thereby resolving the technical problem in the prior art of being unable to enable services that only support IPv4 to support IPv6 single-stack usage.
[0184] It can be understood by those skilled in the art that Figure 10 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 10 It does not limit the structure of the above electronic device. For example, the computer terminal 1000 may also include Figure 10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 10 Different configurations shown.
[0185] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile medium. The non-volatile storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0186] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the domain name query method provided in the embodiment.
[0187] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0188] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining a first domain name query request for a target domain name based on a first domain name type, wherein the first domain name query request is used to instruct a query in a preset cache space for a first domain name address corresponding to the target domain name and the first domain name type, the preset cache space is used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships is used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types include: a first domain name type and a second domain name type, and the preset domain name addresses include: a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type; if the first domain name address cannot be queried in the preset cache space, converting the first domain name request into a second domain name query request based on the second domain name type, wherein the second domain name query request is used to instruct a query in the preset cache space for a second domain name address corresponding to the target domain name and the second domain name type; and converting the second domain name address into the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent the domain name address conversion relationship between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).
[0189] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: receiving a target domain name query request for a target domain name; identifying a user type that initiates the target domain name query request, wherein the user type includes: a dual-stack user, a first single-stack user based on Internet Protocol version 6 IPv6, and a second single-stack user based on Internet Protocol version 4 IPv4; when the user type is a first single-stack user, determining that the target domain name query request is a first domain name query request.
[0190] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: when the user type is a first single-stack user, determining whether the target user who initiates the target domain name query request is a preset differentiated user; when the target user is a preset differentiated user, determining whether the target domain name is a preset differentiated domain name; when the target domain name is a preset differentiated domain name, determining that the target domain name query request is a third domain name query request, wherein the third domain name query request is used to indicate querying a first domain name address corresponding to the target domain name and the first domain name type in a customized cache space, and the customized cache space is the same as the preset cache space.
[0191] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: after identifying the user type that initiates the target domain name query request, if the user type is a dual-stack user or a second single-stack user, determining that the target domain name query request is a fourth domain name query request; in response to the fourth domain name query request, querying a third domain name address corresponding to the target domain name in the public cache space, wherein the public cache space is used to record the correspondence between at least one preset domain name and the third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 IPv4 corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 IPv6 corresponding to the second domain name type.
[0192] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: if the third domain name address cannot be queried in the public cache space, sending a fourth domain name query request to the recursive server, wherein the recursive server is used to resolve the fourth domain name query request to obtain the third domain name address; receiving the third domain name address returned by the recursive server; and storing the target domain name and the corresponding third domain name address in the public cache space.
[0193] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining at least one preset domain name and a corresponding third domain name address stored in the public cache space; identifying the preset domain name type corresponding to the third domain name address; and determining each third domain name address with the corresponding preset domain name and preset domain name type as a set of domain name mapping relationships and storing them in the preset cache space.
[0194] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: if the first domain name address cannot be queried in the preset cache space, sending the first domain name query request to the recursive server, wherein the recursive server is used to resolve the first domain name query request to obtain the first domain name address; if the recursive server fails to obtain the first domain name address, converting the first domain name request into a second domain name query request based on the second domain name type.
[0195] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: after sending the first domain name query request to the recursive server, receiving the first domain name address returned by the recursive server; identifying the preset domain name type corresponding to the first domain name address as the first domain name type; and determining each first domain name address with the corresponding preset domain name and the first domain name type as a set of domain name mapping relationships and storing them in a preset cache space.
[0196] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining a second domain name address, wherein the address digits of the second domain name address are 32 bits; adding a preset address prefix to the second domain name address according to a preset algorithm mapping table to obtain a target domain name address; detecting whether the address digits of the target domain name address reach the preset address digits, wherein the preset address digits are 128 bits; if it is detected that the address digits of the target domain name address do not reach the preset address digits, supplementing the last digit of the target domain name address with a preset value until the preset address digits are reached; and determining that the target domain name address that reaches the preset address digits is the first domain name address.
[0197] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: if the second domain name address cannot be queried in the preset cache space, sending the second domain name query request to the recursive server, wherein the recursive server is used to resolve the second domain name query request to obtain the second domain name address; and receiving the second domain name address returned by the recursive server.
[0198] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: receiving the second domain name address returned by the recursive server, identifying the preset domain name type corresponding to the second domain name address as the second domain name type; determining each second domain name address and the corresponding preset domain name and second domain name type as a set of domain name mapping relationships and storing them in a preset cache space.
[0199] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: after converting the second domain name address into the first domain name address according to a preset algorithm mapping table, identifying the preset domain name type corresponding to the first domain name address as the first domain name type; determining each first domain name address with the corresponding preset domain name and first domain name type as a set of domain name mapping relationships and storing them in a preset cache space.
[0200] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0201] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0202] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0203] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0204] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0205] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a non-volatile storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned non-volatile storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0206] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A domain name query method, characterized in that: include: Receive a target domain name query request for a target domain name; Identifying a user type that initiates the target domain name query request, wherein the user type includes: a dual-stack user, a first single-stack user based on Internet Protocol version 6 (IPv6), and a second single-stack user based on Internet Protocol version 4 (IPv4); When the user type is the first single-stack user, determining that the target domain name query request is a first domain name query request; Determining whether the target user who initiated the first domain name query request is a preset differentiated user; In a case where the target user is the preset differentiated user, determining whether the target domain name is a preset differentiated domain name; If the target domain name is the preset differentiated domain name, determining that the first domain name query request is a third domain name query request, wherein the third domain name query request is used to instruct to query a first domain name address corresponding to the target domain name and the first domain name type in a customized cache space, where the customized cache space is the same as the preset cache space; When the user type is the dual-stack user or the second single-stack user, determining that the target domain name query request is a fourth domain name query request; In response to the fourth domain name query request, querying a public cache space for a third domain name address corresponding to the target domain name, wherein the public cache space is used to record a correspondence between at least one preset domain name and a third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 (IPv6) corresponding to the second domain name type; Obtaining the first domain name query request for the target domain name based on the first domain name type, wherein the first domain name query request is used to instruct a query in a preset cache space for a first domain name address corresponding to the target domain name and the first domain name type, the preset cache space is used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships is used to record a set of preset domain names and preset domain name addresses corresponding to a preset domain name type, the preset domain name types including: the first domain name type and the second domain name type, the preset domain name addresses including: a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the second domain name type; If the first domain name address cannot be found in the preset cache space, converting the first domain name request into a second domain name query request based on a second domain name type, wherein the second domain name query request is used to instruct to query the preset cache space for the second domain name address corresponding to the target domain name and the second domain name type; According to a preset algorithm mapping table, the second domain name address is converted into the first domain name address, wherein the preset algorithm mapping table is used to represent the domain name address conversion relationship between Internet Protocol version 4 IPv4 and Internet Protocol version 6 IPv6.
2. The method according to claim 1, characterized in that The method further comprises: If the third domain name address cannot be found in the public cache space, sending the fourth domain name query request to a recursive server, wherein the recursive server is configured to resolve the fourth domain name query request to obtain the third domain name address; Receiving the third domain name address returned by the recursive server; The target domain name and the corresponding third domain name address are stored in the public cache space.
3. The method according to claim 1 or 2, characterized in that The method further comprises: Obtaining at least one preset domain name stored in the public cache space and the corresponding third domain name address; Identifying the preset domain name type corresponding to the third domain name address; Each of the third domain name addresses, the corresponding preset domain name and the preset domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space.
4. The method according to claim 1, wherein When the first domain name address cannot be found in the preset cache space, converting the first domain name request into a second domain name query request based on a second domain name type includes: If the first domain name address cannot be found in the preset cache space, sending the first domain name query request to a recursive server, wherein the recursive server is configured to resolve the first domain name query request to obtain the first domain name address; In the case that the recursive server fails to obtain the first domain name address, the first domain name request is converted into a second domain name query request based on a second domain name type.
5. The method according to claim 4, characterized in that After sending the first domain name query request to the recursive server, the method further includes: Receiving the first domain name address returned by the recursive server; Identify that the preset domain name type corresponding to the first domain name address is the first domain name type; Each first domain name address, the corresponding preset domain name and the first domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space.
6. The method according to claim 1, characterized in that Converting the second domain name address to the first domain name address according to a preset algorithm mapping table includes: Obtain the second domain name address, wherein the address digits of the second domain name address are 32 bits; Adding a preset address prefix before the second domain name address according to the preset algorithm mapping table to obtain a target domain name address; Detecting whether the address digits of the target domain name address reach a preset address digit, wherein the preset address digits are 128 bits; If the detected address digit of the target domain name address does not reach the preset address digit, add a preset value to the end of the target domain name address until the preset address digit is reached; The target domain name address reaching the preset address digit is determined to be the first domain name address.
7. The method according to claim 1, characterized in that The method further comprises: If the second domain name address cannot be found in the preset cache space, sending the second domain name query request to a recursive server, wherein the recursive server is used to resolve the second domain name query request to obtain the second domain name address; Receiving the second domain name address returned by the recursive server; According to a preset algorithm mapping table, the second domain name address is converted into the first domain name address.
8. The method according to claim 7, characterized in that After receiving the second domain name address returned by the recursive server, the method further includes: Identify that the preset domain name type corresponding to the second domain name address is the second domain name type; Each second domain name address, the corresponding preset domain name and the second domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space.
9. The method according to claim 7, characterized in that After receiving the second domain name address returned by the recursive server, the method further includes: Convert the second domain name address to the first domain name address according to a preset algorithm mapping table; Identify that the preset domain name type corresponding to the first domain name address is the first domain name type; Each first domain name address, the corresponding preset domain name and the first domain name type are determined as a set of domain name mapping relationships and stored in the preset cache space.
10. A domain name query device, characterized in that: include: A first receiving unit, configured to receive a target domain name query request for a target domain name; a first identification unit, configured to identify a user type initiating the target domain name query request, wherein the user type includes: a dual-stack user, a first single-stack user based on Internet Protocol version 6 (IPv6), and a second single-stack user based on Internet Protocol version 4 (IPv4); a first determining unit, configured to, when the user type is the first single-stack user, determine that the target domain name query request is a first domain name query request; a first determining unit, configured to determine whether a target user initiating the first domain name query request is a preset differentiated user; a second determining unit, configured to determine whether the target domain name is a preset differentiated domain name when the target user is the preset differentiated user; a second determining unit, configured to, when the target domain name is the preset differentiated domain name, determine that the first domain name query request is a third domain name query request, wherein the third domain name query request is used to instruct a query for a first domain name address corresponding to the target domain name and a first domain name type in a customized cache space, the customized cache space being the same as the preset cache space; a third determining unit, configured to, when the user type is the dual-stack user or the second single-stack user, determine that the target domain name query request is a fourth domain name query request; a query unit, configured to respond to the fourth domain name query request and query a third domain name address corresponding to the target domain name in a public cache space, wherein the public cache space is used to record a correspondence between at least one preset domain name and a third domain name address, and the third domain name address includes: a first-class third domain name address based on Internet Protocol version 4 (IPv4) corresponding to the first domain name type, and a second-class third domain name address based on Internet Protocol version 6 (IPv6) corresponding to the second domain name type; an acquisition module, configured to acquire the first domain name query request for the target domain name based on the first domain name type, wherein the first domain name query request is used to instruct a query in the preset cache space for a first domain name address corresponding to the target domain name and the first domain name type, the preset cache space is used to record at least one set of domain name mapping relationships, each set of domain name mapping relationships is used to record a set of preset domain name addresses corresponding to a preset domain name and a preset domain name type, the preset domain name types include: the first domain name type and the second domain name type, the preset domain name addresses include: a first domain name address based on Internet Protocol version 6 (IPv6) corresponding to the first domain name type, and a second domain name address based on Internet Protocol version 4 (IPv4) corresponding to the second domain name type; a type conversion module, configured to, if the first domain name address cannot be found in the preset cache space, convert the first domain name request into a second domain name query request based on a second domain name type, wherein the second domain name query request is used to instruct to query the preset cache space for the second domain name address corresponding to the target domain name and the second domain name type; An address conversion module is used to convert the second domain name address into the first domain name address according to a preset algorithm mapping table, wherein the preset algorithm mapping table is used to represent the domain name address conversion relationship between Internet Protocol version 4 IPv4 and Internet Protocol version 6 IPv6.
11. A non-volatile storage medium, characterized in that: The non-volatile storage medium is used to store a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the domain name query method according to any one of claims 1 to 9.
12. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is configured to run a program stored in the processor, wherein the domain name query method according to any one of claims 1 to 9 is executed when the program is run.
Citation Information
Patent Citations
Domain name inquiry method and system
CN105306607A
Message forwarding method and device, domain name address query method and device, equipment and medium
CN110784562A