Disclosure of Invention
In view of the above problems, embodiments of the present invention provide a domain name resolution method, apparatus, computing device and computer storage medium, which overcome or at least partially solve the above problems.
According to an aspect of an embodiment of the present invention, there is provided a domain name resolution method, including: acquiring a domain name defined according to a preset domain name format and used for connecting a service system; performing domain name resolution by applying a first domain name resolution method; and if the domain name resolution fails by applying the first domain name resolution method, resolving the domain name by applying a second domain name resolution method to obtain the IP address.
In an optional manner, before the obtaining a domain name set according to a preset domain name format for connecting to a service system, the method includes: defining the domain name in a preset domain name format; and rewriting a domain name resolution function required to be applied in the domain name resolution process.
In an optional manner, the defining the domain name in a preset domain name format includes: combining the number of IP addresses and the IP addresses into the domain name, the IP addresses including Ipv4 addresses and/or Ipv6 addresses, the domain name being defined to start with letters, end with letters or numbers, middle with letters, numbers or hyphens, and 63 characters or less in length.
In an optional manner, the combining the number of IP addresses and the IP address into the domain name includes: adding an IP protocol version number and the number of IP addresses corresponding to the IP protocol version number into the domain name; the IP addresses are combined into domain names by hyphenation.
In an optional manner, the adding, to the domain name, an IP protocol version number and an IP address number corresponding to the IP protocol version number includes: defining the initial character of the domain name as the IP protocol version number and the IP address number corresponding to the IP protocol version number;
the combining the IP address into the domain name by hyphenation includes: define in Ipv 4.use of hyphen-substitution; in definition Ipv6, replace with character z; hyphenation is used between defined addresses.
In an optional manner, the analyzing the domain name by applying the second domain name analyzing method to obtain the IP address includes: and analyzing the IP address from the domain name by applying the domain name analyzing function according to a preset domain name format.
In an optional manner, the performing domain name resolution by using the first domain name resolution method includes: and acquiring the IP address from a domain name system according to the domain name.
According to another aspect of the embodiments of the present invention, there is provided a domain name resolution apparatus, including: the domain name acquisition unit is used for acquiring a domain name which is used for connecting a service system and defined according to a preset domain name format; the first domain name resolution unit is used for performing domain name resolution by applying a first domain name resolution method; and the second domain name resolution unit is used for resolving the domain name by applying a second domain name resolution method to acquire the IP address if the domain name resolution by applying the first domain name resolution method fails.
According to another aspect of embodiments of the present invention, there is provided a computing device including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the steps of the domain name resolution method.
According to another aspect of the embodiments of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing the processor to execute the steps of the domain name resolution method.
The domain name resolution method of the embodiment of the invention comprises the following steps: acquiring a domain name defined according to a preset domain name format and used for connecting a service system; performing domain name resolution by applying a first domain name resolution method; if the domain name resolution fails by applying the first domain name resolution method, the domain name is resolved by applying the second domain name resolution method to obtain the IP address, and the IP address and the number of the servers are contained in the domain name, so that the IP address of the server can be obtained by resolving the special domain name format when the DNS fails, and the network is kept smooth.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and in order that the technical solutions of the embodiments of the present invention can be clearly understood, the embodiments of the present invention can be implemented according to the content of the description, and the above and other objects, features, and advantages of the embodiments of the present invention can be more clearly understood, the detailed description of the present invention is provided below.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 shows a schematic flowchart of a domain name resolution method provided in an embodiment of the present invention, and as shown in fig. 1, the domain name resolution method applied to a client includes:
step S11: and acquiring a domain name defined according to a preset domain name format and used for connecting a service system.
Before step S11, defining the domain name in a preset domain name format; and rewriting a domain name resolution function required to be applied in the domain name resolution process. In an embodiment of the present invention, the number of IP addresses and the IP addresses are combined into the domain name, the IP addresses include Ipv4 addresses and/or Ipv6 addresses, and the domain name is defined to start with letters and end with letters or numbers, and has a middle part of letters, numbers or hyphens and a length of 63 characters or less. Specifically, an IP protocol version number and the number of IP addresses corresponding to the IP protocol version number are added into the domain name; the IP addresses are combined into domain names by hyphenation. More specifically, the domain name satisfies the following naming rules: defining the initial character of the domain name as the IP protocol version number and the IP address number corresponding to the IP protocol version number; define in Ipv4 use hyphen-substitution; define in Ipv 6: replacing with a character z; hyphenation is used between defined addresses. The address information is a subdomain of the domain name. For example, the following steps are carried out: according to the above rules, a domain name is generated as follows: V42V 61-111-112-113-114-121-122-123-124-cdcdcz910az2222z5498z8475z1111z3900z2020. Test.com. The meaning of the domain name is as follows: v42 indicates two Ipv4 addresses, and V61 indicates one Ipv6 address; the two Ipv4 addresses involved are 111.112.113.114 and 121.122.123.124, and one Ipv6 address involved is cdcd:910a 2222. Com contains the following meanings: 1) There are 1 Ipv4 addresses, no Ipv6 address, and the Ipv4 address is 111.112.113.114.
Step S12: and performing domain name resolution by applying a first domain name resolution method.
In the embodiment of the present invention, in step S12, the first domain name resolution method is to apply a standard resolution process to resolve a domain name, that is, obtain the IP address from a domain name system according to the domain name.
Step S13: and if the domain name resolution fails by applying the first domain name resolution method, resolving the domain name by applying a second domain name resolution method to obtain an IP address.
Specifically, when the result returned by analyzing the domain name by using the standard analysis process is analysis failure, the domain name is analyzed by using a second domain name analysis method. Specifically, the IP address is resolved from the domain name by applying the domain name resolution function according to a preset domain name format. The domain name resolution function is the domain name resolution function rewritten in the front, the domain name resolution function is applied to obtain the IP information from the sub-domain name according to the self-defined domain name combination rule, and the IP information is returned. As shown in fig. 2, when a DNS fails, the IP address cannot be obtained from the domain name system, the domain name resolution function is applied to resolve the IP address from the domain name according to the defined preset domain name format, and the IP address is used to connect to a Server (Service Server), so that the network application program of the client can be used without affecting the important applications of the client.
For example, the service system uses the domain name v41v60-101-102-103-104.Test.com, and in the DNS system, a set for this domain name is recorded as 101.102.103.104. When the client program uses the domain name connection service system, the client program calls a self-defined domain name resolution method to resolve the domain name v41v60-101-102-103-104.Test. The customized domain name resolution method firstly resolves the domain name v41v60-101-102-103-104.Test.com by using a standard resolution process, and returns a result of failure in resolution; according to the failure result, the customized analysis method decomposes the domain name v41v60-101-102-103-104.Test.com, analyzes an Ipv4 address 101.102.103.104 according to the set analysis rule, and returns the IP address as the domain name analysis result. After the client program obtains the analysis result, the IP address is used for connecting a service system, so that the network is kept smooth continuously when the DNS fails, the network application program of the client can be used, and the important application of the client is not influenced.
The domain name resolution method of the embodiment of the invention comprises the following steps: acquiring a domain name defined according to a preset domain name format and used for connecting a service system; performing domain name resolution by applying a first domain name resolution method; if the domain name resolution fails by applying the first domain name resolution method, the domain name is resolved by applying the second domain name resolution method to obtain the IP address, and the IP address and the number of the servers are contained in the domain name, so that the IP address of the server can be obtained by resolving the special domain name format when the DNS fails, and the network is kept smooth.
Fig. 3 shows a schematic structural diagram of a domain name resolution device according to an embodiment of the present invention, and as shown in fig. 3, the domain name resolution device includes: a domain name obtaining unit 301, a first domain name analyzing unit 302, and a second domain name analyzing unit 303.
The domain name obtaining unit 301 is configured to obtain a domain name defined according to a preset domain name format, where the domain name is used for connecting to a service system; the first domain name resolution unit 302 is configured to perform domain name resolution by applying a first domain name resolution method; the second domain name resolution unit 303 is configured to, if domain name resolution fails by applying the first domain name resolution method, resolve the domain name by applying the second domain name resolution method, and acquire the IP address.
In an optional manner, the domain name obtaining unit 301 is configured to: defining the domain name in a preset domain name format; and rewriting a domain name resolution function required to be applied in the domain name resolution process.
In an optional manner, the domain name obtaining unit 301 is configured to: combining the number of IP addresses and the IP addresses into the domain name, the IP addresses including Ipv4 addresses and/or Ipv6 addresses, the domain name being defined to start with letters, end with letters or numbers, middle with letters, numbers or hyphens, and 63 characters or less in length.
In an optional manner, the domain name obtaining unit 301 is configured to: adding an IP protocol version number and the number of IP addresses corresponding to the IP protocol version number into the domain name; the IP addresses are combined into domain names by hyphenation.
In an optional manner, the domain name obtaining unit 301 is configured to: defining the initial character of the domain name as the IP protocol version number and the IP address number corresponding to the IP protocol version number; define in Ipv4 use hyphen-substitution; in definition Ipv6, replace with character z; hyphenation is used between defined addresses.
In an optional manner, the second domain name resolution unit 303 is configured to: and analyzing the IP address from the domain name according to a preset domain name format by applying the domain name analyzing function.
In an alternative manner, the first domain name resolution unit 302 is configured to: and acquiring the IP address from a domain name system according to the domain name.
The domain name resolution method of the embodiment of the invention comprises the following steps: acquiring a domain name defined according to a preset domain name format and used for connecting a service system; performing domain name resolution by applying a first domain name resolution method; if the domain name resolution fails by applying the first domain name resolution method, the domain name is resolved by applying the second domain name resolution method to obtain the IP address, and the IP address and the number of the servers are contained in the domain name, so that the IP address of the server can be obtained by resolving the special domain name format when the DNS fails, and the network is kept smooth.
The embodiment of the invention provides a nonvolatile computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, and the computer executable instruction can execute the domain name resolution method in any method embodiment.
The executable instructions may be specifically configured to cause the processor to perform the following operations:
acquiring a domain name defined according to a preset domain name format and used for connecting a service system;
performing domain name resolution by applying a first domain name resolution method;
and if the domain name resolution fails by applying the first domain name resolution method, resolving the domain name by applying a second domain name resolution method to obtain an IP address.
In an alternative form, the executable instructions cause the processor to:
defining the domain name in a preset domain name format;
and rewriting a domain name resolution function required to be applied in the domain name resolution process.
In an alternative, the executable instructions cause the processor to:
combining the number of IP addresses and the IP addresses into the domain name, the IP addresses including Ipv4 addresses and/or Ipv6 addresses, the domain name being defined to start with letters, end with letters or numbers, middle with letters, numbers or hyphens, and 63 characters or less in length.
In an alternative form, the executable instructions cause the processor to:
adding an IP protocol version number and the number of IP addresses corresponding to the IP protocol version number into the domain name;
the IP addresses are combined into domain names by hyphenation.
In an alternative, the executable instructions cause the processor to:
defining the initial character of the domain name as the IP protocol version number and the IP address number corresponding to the IP protocol version number;
define in Ipv4 use hyphen-substitution;
in definition Ipv6, replace with character z;
hyphenation is used between defined addresses.
In an alternative, the executable instructions cause the processor to:
and analyzing the IP address from the domain name by applying the domain name analyzing function according to a preset domain name format.
In an alternative, the executable instructions cause the processor to:
and acquiring the IP address from a domain name system according to the domain name.
The domain name resolution method of the embodiment of the invention comprises the following steps: acquiring a domain name defined according to a preset domain name format and used for connecting a service system; performing domain name resolution by applying a first domain name resolution method; if the domain name resolution fails by applying the first domain name resolution method, the domain name is resolved by applying the second domain name resolution method to obtain the IP address, and the IP address and the number of the servers are contained in the domain name, so that the IP address of the server can be obtained by resolving the special domain name format when the DNS fails, and the network is kept smooth.
Fig. 4 shows a schematic structural diagram of an embodiment of the apparatus of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the apparatus.
As shown in fig. 4, the apparatus may include: a processor (processor) 402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein: the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408. A communication interface 404 for communicating with network elements of other devices, such as clients or other servers. The processor 402 is configured to execute the program 410, and may specifically perform relevant steps in the above embodiments of the domain name resolution method.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement an embodiment of the present invention. The device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may specifically be configured to cause the processor 402 to perform the following operations:
acquiring a domain name defined according to a preset domain name format and used for connecting a service system;
performing domain name resolution by applying a first domain name resolution method;
and if the domain name resolution fails by applying the first domain name resolution method, resolving the domain name by applying a second domain name resolution method to obtain an IP address.
In an alternative, the program 410 causes the processor to:
defining the domain name in a preset domain name format;
and rewriting a domain name resolution function required to be applied in the domain name resolution process.
In an alternative, the program 410 causes the processor to perform the following operations:
combining the number of IP addresses and the IP addresses into the domain name, the IP addresses including an Ipv4 address and/or an Ipv6 address, the domain name being defined to start alphabetically, end alphabetically or numerically, have an intermediate portion of alphabetic, numeric or hyphenated characters, and be 63 characters or shorter in length.
In an alternative, the program 410 causes the processor to:
adding an IP protocol version number and the number of IP addresses corresponding to the IP protocol version number into the domain name;
the IP addresses are combined into domain names by hyphenation.
In an alternative, the program 410 causes the processor to:
defining the initial character of the domain name as the IP protocol version number and the IP address number corresponding to the IP protocol version number;
define in Ipv4 use hyphen-substitution;
in definition Ipv6, replace with character z;
hyphenation is used between defined addresses.
In an alternative, the program 410 causes the processor to perform the following operations:
and analyzing the IP address from the domain name by applying the domain name analyzing function according to a preset domain name format.
In an alternative, the program 410 causes the processor to:
and acquiring the IP address from a domain name system according to the domain name.
The domain name resolution method of the embodiment of the invention comprises the following steps: acquiring a domain name defined according to a preset domain name format and used for connecting a service system; performing domain name resolution by applying a first domain name resolution method; if the domain name resolution fails by applying the first domain name resolution method, the domain name is resolved by applying the second domain name resolution method to obtain the IP address, and the IP address and the number of the servers are contained in the domain name, so that the IP address of the server can be obtained by resolving the special domain name format when the DNS fails, and the network is kept smooth.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.