CN113472915B - Domain name resolution method, device, equipment and storage medium - Google Patents

Domain name resolution method, device, equipment and storage medium Download PDF

Info

Publication number
CN113472915B
CN113472915B CN202110734752.0A CN202110734752A CN113472915B CN 113472915 B CN113472915 B CN 113472915B CN 202110734752 A CN202110734752 A CN 202110734752A CN 113472915 B CN113472915 B CN 113472915B
Authority
CN
China
Prior art keywords
domain name
name resolution
target
class
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110734752.0A
Other languages
Chinese (zh)
Other versions
CN113472915A (en
Inventor
周靖植
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202110734752.0A priority Critical patent/CN113472915B/en
Publication of CN113472915A publication Critical patent/CN113472915A/en
Application granted granted Critical
Publication of CN113472915B publication Critical patent/CN113472915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The application relates to the technical field of cloud analysis, and discloses a domain name analysis method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a domain name to be resolved submitted by a target application service according to a target request through a target domain name resolution class, and performing domain name resolution on the domain name to be resolved to obtain a first domain name resolution result; when the first domain name resolution result is successful, determining target domain name data according to the first domain name resolution result; when the first domain name resolution result is failure, performing domain name resolution on the domain name to be resolved according to a preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result; and when the second domain name resolution result is successful, determining target domain name data according to the second domain name resolution result, otherwise, generating a domain name resolution failure signal according to the domain name to be resolved. Therefore, the domain name resolution of the basic cloud is decoupled from the basic cloud facility, and the modification process of the domain name resolution is shortened.

Description

Domain name resolution method, device, equipment and storage medium
Technical Field
The present application relates to the field of cloud analytics, and in particular, to a domain name parsing method, apparatus, device, and storage medium.
Background
The client application service is a Java (object oriented programming language) module for accepting HTTP (HyperText transfer protocol) messages, querying HBase (distributed, column-oriented open database) tables, returning corresponding client figures and client labels. The client application service builds an interface micro-service based on a Spring (J2 EE application program framework with open source codes), an HBaseClient (API (application program interface) component provided by HBase and used as a set of comparison bottom layer) is communicated with an HBaseServer (service of HBase) cluster in a data access layer, and an adopted KV (Key-Value) database is based on the HBase of a Hadoop (distributed system infrastructure developed by Apache foundation) system. Since the Java module corresponding to the client application service is deployed in the container cloud, the Host (system file of correspondence between IP address and domain name) domain name resolution of the base cloud needs to be configured, and the domain name resolution of the base cloud needs the operation and maintenance personnel to modify the Host table or the domain name server, so that the domain name resolution of the base cloud is coupled with the infrastructure of the base cloud more greatly, which results in a longer domain name resolution modification process and affects the online speed of the application service. And when the HBaseServer node is expanded, the Host domain name resolution of the basic cloud still needs to be configured, so that the online speed of the application service is further influenced.
Disclosure of Invention
The application mainly aims to provide a domain name resolution method, a domain name resolution device, domain name resolution equipment and a storage medium, and aims to solve the technical problems that in the prior art, under the condition that an application service is deployed based on a container cloud, the domain name resolution of a base cloud is greatly coupled with a base cloud facility, and operation and maintenance personnel are required to modify a Host table or a domain name server to modify the domain name resolution, so that the domain name resolution modification process is long, and the online speed of the application service is influenced.
In order to achieve the above object, the present application provides a domain name resolution method, including:
acquiring a domain name to be analyzed submitted by a target application service according to a target request through a target domain name analysis class;
performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result;
when the first domain name resolution result is successful, determining target domain name data according to the first domain name resolution result;
when the first domain name resolution result is failure, acquiring a preset domain name resolution rule;
performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result;
and when the second domain name resolution result is successful, determining the target domain name data according to the second domain name resolution result, otherwise, generating a domain name resolution failure signal according to the domain name to be resolved.
Further, before the step of obtaining, by the target domain name resolution class, the domain name to be resolved submitted by the target application service according to the target request, the method further includes:
acquiring a domain name configuration request;
responding to the domain name configuration request, and acquiring a domain name resolution list to be updated;
updating a target Sprint configuration file of the target domain name resolution class according to the domain name resolution list to be updated;
acquiring the domain name resolution list to be updated from the target Sprint configuration file through the target domain name resolution class, writing the acquired domain name resolution list to be updated into a cache of a Java virtual machine, and generating a first cache completion signal;
and restarting the target application service according to the first cache completion signal through a service starting class of the SpringBoot.
Further, before the step of obtaining the domain name configuration request, the method further includes:
acquiring a domain name resolution generation request;
responding to the domain name resolution class generation request, and creating an engineering by adopting an engineering creation tool to obtain a domain name resolution class to be configured;
acquiring an engineering configuration file to be added and a Sprint configuration file to be added, wherein the engineering configuration file to be added comprises: the method comprises the following steps that dependent configuration data of the SpringBoot and dependent configuration data of a domain name cache operation tool are obtained, and the SpringBoot configuration file to be added comprises the following steps: opening JVM virtual domain name configuration data and a domain name resolution list to be added;
configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class;
writing a domain name resolution list in the target domain name resolution class into a cache of a Java virtual machine through the target domain name resolution class to generate a second cache completion signal;
and restarting the target application service according to the second cache completion signal through the service starting class of the SpringBoot.
Further, the step of configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class includes:
updating the project configuration file of the domain name resolution class to be configured according to the project configuration file to be added;
updating the Sprint configuration file of the domain name resolution class to be configured according to the Sprint configuration file to be added;
and taking the domain name resolution class to be configured as the target domain name resolution class.
Further, the step of performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result includes:
and searching the domain name to be analyzed in a cache of the Java virtual machine in the Java virtual machine through the target domain name analysis class, and determining that the first domain name analysis result is successful when the domain name is searched in the cache of the Java virtual machine, or determining that the first domain name analysis result is failed.
Further, the step of performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, the domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result includes:
when the preset domain name resolution rule is that domain name resolution is performed by sequentially adopting the domain name resolution server and the domain name resolution file of the local operating system, performing domain name resolution on the domain name to be resolved by adopting the domain name resolution server to obtain a domain name resolution result to be processed;
when the domain name resolution result to be processed is successful, determining that the second domain name resolution result is successful;
and when the domain name resolution result to be processed is failure, performing domain name resolution on the domain name to be resolved by adopting a domain name resolution file of the local operating system to obtain a second domain name resolution result.
Further, the step of performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, the domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result further includes:
when the preset domain name resolution rule is that domain name resolution is performed by sequentially adopting the domain name resolution file of the local operating system and the domain name resolution server, performing domain name resolution on the domain name to be resolved by adopting the domain name resolution file of the local operating system to obtain a domain name resolution result to be analyzed;
when the domain name resolution result to be analyzed is successful, determining that the second domain name resolution result is successful;
and when the domain name resolution result to be analyzed is failure, performing domain name resolution on the domain name to be analyzed by adopting the domain name resolution server to obtain a second domain name resolution result.
The application also provides a domain name resolution device, the device includes:
the domain name acquisition module to be analyzed is used for acquiring the domain name to be analyzed submitted by the target application service according to the target request through the target domain name analysis class;
the first domain name resolution result determining module is used for performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result;
the first target domain name data determining module is used for determining target domain name data according to the first domain name resolution result when the first domain name resolution result is successful;
a preset domain name resolution rule determining module, configured to obtain a preset domain name resolution rule when the first domain name resolution result is a failure;
the second domain name resolution result determining module is used for performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result;
and the second target domain name data determining module is used for determining the target domain name data according to the second domain name resolution result when the second domain name resolution result is successful, and otherwise, generating a domain name resolution failure signal according to the domain name to be resolved.
The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
The present application also proposes a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any of the above-mentioned.
According to the domain name resolution method, the domain name resolution device, the domain name resolution equipment and the storage medium, firstly, through a target domain name resolution class, a domain name to be resolved submitted by a target application service according to a target request is obtained, the domain name to be resolved is subjected to domain name resolution to obtain a first domain name resolution result, when the first domain name resolution result is successful, target domain name data are determined according to the first domain name resolution result, then when the first domain name resolution result is failed, a preset domain name resolution rule is obtained, finally, according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system, domain name resolution is carried out on the domain name to be resolved to obtain a second domain name resolution result, when the second domain name resolution result is successful, the target domain name data are determined according to the second domain name resolution result, otherwise, a domain name resolution failure signal is generated according to the domain name to be resolved, configuration of software-level domain name resolution through the target domain name resolution class is achieved, base cloud domain name resolution is decoupled with a base cloud facility, domain name resolution modification speed of the domain name resolution is shortened, and online speed of the application service is improved.
Drawings
Fig. 1 is a schematic flowchart of a domain name resolution method according to an embodiment of the present application;
fig. 2 is a block diagram illustrating a structure of a domain name resolution apparatus according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
Referring to fig. 1, an embodiment of the present application provides a domain name resolution method, where the method includes:
s1: acquiring a domain name to be analyzed submitted by a target application service according to a target request through a target domain name analysis class;
s2: performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result;
s3: when the first domain name resolution result is successful, determining target domain name data according to the first domain name resolution result;
s4: when the first domain name resolution result is failure, acquiring a preset domain name resolution rule;
s5: performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result;
s6: and when the second domain name resolution result is successful, determining the target domain name data according to the second domain name resolution result, otherwise, generating a domain name resolution failure signal according to the domain name to be resolved.
According to the embodiment, a domain name to be resolved submitted by a target application service according to a target request is obtained through a target domain name resolution class, domain name resolution is carried out on the domain name to be resolved to obtain a first domain name resolution result, when the first domain name resolution result is successful, target domain name data are determined according to the first domain name resolution result, then when the first domain name resolution result is failed, a preset domain name resolution rule is obtained, finally, domain name resolution is carried out on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result, when the second domain name resolution result is successful, the target domain name data are determined according to the second domain name resolution result, otherwise, a domain name resolution failure signal is generated according to the domain name to be resolved, configuration of software-level domain name resolution is achieved through the target domain name resolution class, the domain name of a foundation cloud is decoupled with a foundation cloud facility, the modifying process of the domain name resolution is shortened, and the online speed of the application service is improved.
And for S1, receiving the target request sent by a client through a target application service, extracting a domain name of a parameter carried by the target request, taking the extracted domain name as the domain name to be analyzed, and sending the domain name to be analyzed to the target domain name analysis class. It is to be understood that the domain name to be resolved may be sent to the target domain name resolution class using a POST request of HTTP.
The target domain name resolution class is a domain name resolution class defined by a cache based on Spring and a Java virtual machine.
The target application service is a Java module based on SpringBoot (a brand new framework provided by Pivotal team).
The target request is a request for accessing the Hbaseverer cluster to obtain data.
Optionally, the target application service is a Java module, an interface microserver is built based on a Spring framework, an hbsaseclean component is used in a data access layer to communicate with the hbsaseserver cluster, and the adopted KV database is an HBase based on a Hadoop system. The target application service needs to use the domain name of the hbaseServer cluster to locate the cluster node of the hbaseServer cluster and access the communication through the node domain name. And the target application service is deployed in a container cloud.
The target application service is used for receiving the HTTP message, inquiring an Hbase table in the Hbaseverer cluster according to the HTTP message, and returning data inquired from the Hbase table to an initiating end of the HTTP message.
Clients include, but are not limited to: a client of the mobile device and a client of the computer.
And for S2, performing software-level domain name resolution on the domain name to be resolved according to the cache of the Java virtual machine through the target domain name resolution class, determining that the first domain name resolution result is successful when the resolution is successful, and determining that the first domain name resolution result is failed when the resolution is failed.
For S3, when the first domain name resolution result is successful, it means that the domain name resolution in the software layer is successful, and at this time, the domain name and the IP address corresponding to the first domain name resolution result in the Java virtual machine may be used as the target domain name data.
For S4, when the first domain name resolution result is a failure, it means that the domain name resolution on the software level is a failure, and at this time, the domain name resolution server and the domain name resolution file of the local operating system need to be used to perform the bottom-pocketed domain name resolution, so that the preset domain name resolution rule may be obtained from the database, the preset domain name resolution rule may also be obtained from the third-party application system, and the preset domain name resolution rule may also be written into the application program implementing the present application.
Optionally, the preset domain name resolution rule includes: and performing domain name resolution by sequentially adopting the domain name resolution server and the domain name resolution file of the local operating system.
Optionally, the preset domain name resolution rule includes: and sequentially adopting the domain name resolution file of the local operating system and the domain name resolution server to carry out domain name resolution.
Domain name resolution servers include, but are not limited to: an HTTP domain name resolution system.
The domain name resolution file of the local operating system is a Host table of the operating system of the server where the target application service is located, is responsible for rapidly resolving the IP address and the domain name, and stores data obtained by resolving in an ASCII format.
And for S5, performing domain name resolution on the domain name to be resolved according to the domain name resolution file of the domain name resolution server and the local operating system by adopting the preset domain name resolution rule, determining that the second domain name resolution result is successful when the resolution is successful, and determining that the second domain name resolution result is failed when the resolution is failed.
For S6, when the second domain name resolution result is successful, it means that at least one of the domain name resolution server and the domain name resolution file of the local operating system performs successful domain name resolution on the domain name to be resolved, so that the domain name and the IP address corresponding to the successful second domain name resolution result are used as the target domain name data.
When the second domain name resolution result is failure, the domain name resolution server and the domain name resolution file of the local operating system do not perform successful domain name resolution on the domain name to be resolved, and a domain name resolution failure signal is generated according to the domain name to be resolved and used for reminding a user of domain name resolution failure.
In an embodiment, before the step of obtaining, by the target domain name resolution class, the domain name to be resolved submitted by the target application service according to the target request, the method further includes:
s11: acquiring a domain name configuration request;
s12: responding to the domain name configuration request, and acquiring a domain name resolution list to be updated;
s13: updating a target Sprint configuration file of the target domain name resolution class according to the domain name resolution list to be updated;
s14: acquiring the domain name resolution list to be updated from the target Sprint configuration file through the target domain name resolution class, writing the acquired domain name resolution list to be updated into a cache of a Java virtual machine, and generating a first cache completion signal;
s15: and restarting the target application service according to the first cache completion signal through a service starting class of the SpringBoot.
In this embodiment, the domain name resolution of the software layer is modified by modifying the Sprint configuration file of the target domain name resolution class, so that the configuration of the domain name resolution of the software layer is realized by the target domain name resolution class, the domain name resolution of the base cloud is decoupled from the infrastructure of the base cloud, the modification process of the domain name resolution is shortened, and the online speed of the application service is increased.
For S11, a domain name configuration request input by the user is acquired.
The domain name configuration request is a request for performing domain name resolution configuration in a software layer.
And S12, responding to the domain name configuration request, and acquiring a domain name resolution list to be updated, which is input by a user.
The domain name resolution list to be updated is a list of domain name data to be configured.
For S13, a domain name resolution list to be updated is imported into the target Sprint configuration file of the target domain name resolution class.
For S14, writing the domain name resolution list to be updated in the target Sprint configuration file into a cache of a Java virtual machine by adopting a KV storage format through the target domain name resolution class, and generating a first cache completion signal when the cache is completed.
That is, the KV storage format stores a domain name in Key and an IP address in Value.
A Java virtual machine, JVM, is a specification for a computing device, which is a fictitious computer implemented by emulating and simulating various computer functions on a real computer.
And S15, restarting the target application service through the service starting class of the SpringBoot when the first cache completion signal is received. It is understood that the target application service is restarted successfully to receive the target request sent by the receiving client.
The service boot class of the spring boot is a class of the spring boot used for booting the application service, and the specific implementation method is not described herein.
In an embodiment, before the step of obtaining the domain name configuration request, the method further includes:
s111: acquiring a domain name resolution generation request;
s112: responding to the domain name resolution class generation request, and adopting an engineering creation tool to create an engineering to obtain a domain name resolution class to be configured;
s113: acquiring an engineering configuration file to be added and a Sprint configuration file to be added, wherein the engineering configuration file to be added comprises: the method comprises the following steps that dependent configuration data of the SpringBoot and dependent configuration data of a domain name cache operation tool are obtained, and the SpringBoot configuration file to be added comprises the following steps: opening JVM virtual domain name configuration data and a domain name resolution list to be added;
s114: configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class;
s115: writing a domain name resolution list in the target domain name resolution class into a cache of a Java virtual machine through the target domain name resolution class to generate a second cache completion signal;
s116: and restarting the target application service according to the second cache completion signal through the service starting class of the SpringBoot.
The embodiment realizes the domain name resolution class based on the Spring and the cache customization of the Java virtual machine, thereby providing a foundation for realizing the domain name resolution of a software layer.
For S111, a domain name resolution class generation request input by the user is obtained.
The domain name resolution class generation request is a request for generating a domain name resolution class.
And S112, responding to the domain name resolution class generation request, creating a Maven project by adopting a project creation tool, and taking the created Maven project as a domain name resolution class to be configured.
It is to be understood that other projects may also be created by using the project creation tool as the domain name resolution class to be configured, which is not limited herein.
Optionally, the engineering creation tool employs Intellij IDea. It is understood that the engineering tool may also employ other tools, which are not limited herein.
The project corresponding to the domain name resolution class to be configured comprises three types of files: 3 Java configuration files, 1 Sprint configuration file, 1 project configuration file.
For step S113, the project profile to be added and the Sprint profile to be added, which are input by the user, are acquired.
The dependency configuration data of the spring boot is a program that depends on the spring boot.
The domain name cache operation tool depends on configuration data, that is, a program that depends on a DNS-cache-manager.
The configuration data of the virtual domain name of the open JVM is the configuration data of the virtual domain name of the open JVM. For example, the configuration data of the virtual domain name of the JVM is opened as follows: true, which is not specifically limited by this example.
The domain name resolution list to be added is a list of domain name resolutions to be added. The domain name resolution list to be added includes: domain name and IP address.
For step S114, configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added, and taking the configured domain name resolution class to be configured as the target domain name resolution class.
For S115, reading data from the domain name resolution list in the target domain name resolution class by using the target domain name resolution class and adopting a KV storage format, and then writing the data into the cache of the Java virtual machine, and generating a second cache completion signal when the cache is completed.
For S116, through the service boot class of the SpringBoot, when the second cache completion signal is received, the target application service is restarted.
In an embodiment, the step of configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class includes:
s1141: updating the engineering configuration file of the domain name resolution class to be configured according to the engineering configuration file to be added;
s1142: updating the Sprint configuration file of the domain name resolution class to be configured according to the Sprint configuration file to be added;
s1143: and taking the domain name resolution class to be configured as the target domain name resolution class.
In this embodiment, the domain name resolution class to be configured is configured according to the project configuration file to be added and the Sprint configuration file to be added, so that a basis is provided for implementing domain name resolution in a software layer.
For S1141, adding the to-be-added engineering configuration file to the to-be-configured engineering configuration file of the domain name resolution class, enabling the to-be-configured domain name resolution class to communicate with a target application service through the dependent configuration data of the SpringBoot of the to-be-added engineering configuration file, and enabling the to-be-configured domain name resolution class to call a domain name cache operation tool through the dependent configuration data of the domain name cache operation tool of the to-be-added engineering configuration file.
For S1142, adding the Sprint profile to be added to the Sprint profile of the domain name resolution class to be configured.
For example, the JVM virtual domain name configuration data is opened as follows: true, the domain name resolution list to be added is: www.example-1.com.
For S1143, the domain name resolution class to be configured to which the project configuration file to be added and the Sprint configuration file to be added are added is taken as the target domain name resolution class.
In an embodiment, the step of performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result includes:
s21: and searching the domain name to be analyzed in a cache of the Java virtual machine in the Java virtual machine through the target domain name analysis class, and determining that the first domain name analysis result is successful when the domain name is searched in the cache of the Java virtual machine, or determining that the first domain name analysis result is failed.
According to the embodiment, the domain name to be analyzed is subjected to software-level domain name analysis by the target domain name analysis class and the cache of the Java virtual machine, so that the domain name analysis of the foundation cloud is decoupled from the infrastructure of the foundation cloud.
For S21, by executing the target domain name resolution class, in a Java virtual machine, searching the domain name to be resolved in a cache of the Java virtual machine, and when the domain name is found in the cache of the Java virtual machine, it means that the domain name resolution of the domain name to be resolved is stored in the cache of the Java virtual machine, so that it is determined that the first domain name resolution result is successful; when the domain name is not found in the cache of the Java virtual machine, it means that the domain name resolution without the domain name to be resolved is stored in the cache of the Java virtual machine, so that it is determined that the first domain name resolution result is a failure.
In an embodiment, the step of performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, the domain name resolution server, and a domain name resolution file of the local operating system to obtain a second domain name resolution result includes:
s511: when the preset domain name resolution rule is that domain name resolution is performed by sequentially adopting the domain name resolution server and the domain name resolution file of the local operating system, performing domain name resolution on the domain name to be resolved by adopting the domain name resolution server to obtain a domain name resolution result to be processed;
s512: when the domain name resolution result to be processed is successful, determining that the second domain name resolution result is successful;
s513: and when the domain name resolution result to be processed is failure, performing domain name resolution on the domain name to be resolved by adopting a domain name resolution file of the local operating system to obtain a second domain name resolution result.
In this embodiment, the domain name resolution server and the domain name resolution file of the local operating system are sequentially adopted to perform domain name resolution, and the domain name to be resolved is subjected to domain name resolution, so that a bottom-seeking strategy is realized, and the success rate of domain name resolution is improved.
For S511, when the preset domain name resolution rule is that the domain name resolution server and the domain name resolution file of the local operating system are sequentially used to perform domain name resolution, it means that the domain name resolution server is first used to perform domain name resolution on the domain name to be resolved, when the domain name resolution server is used to perform successful domain name resolution on the domain name to be resolved, it is determined that the result of domain name resolution to be processed is successful, and when the domain name resolution server is used to perform no successful domain name resolution on the domain name to be resolved, it is determined that the result of domain name resolution to be processed is failed.
For S512, when the result of domain name resolution to be processed is successful, it means that the domain name resolution server has performed successful domain name resolution on the domain name to be resolved, so that it can be determined that the result of the second domain name resolution is successful.
For S513, when the result of the domain name resolution to be processed is a failure, it means that the domain name resolution server does not perform successful domain name resolution on the domain name to be resolved, and at this time, a domain name resolution file of the local operating system is used to perform domain name resolution on the domain name to be resolved; when the domain name resolution file of the local operating system is adopted to carry out successful domain name resolution on the domain name to be resolved, determining that the second domain name resolution result is successful; and when the domain name to be analyzed is not successfully analyzed by adopting the domain name analysis file of the local operating system, determining that the second domain name analysis result is failure.
In an embodiment, the step of performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, the domain name resolution server, and a domain name resolution file of a local operating system to obtain a second domain name resolution result further includes:
s521: when the preset domain name resolution rule is that domain name resolution is performed by sequentially adopting the domain name resolution file of the local operating system and the domain name resolution server, performing domain name resolution on the domain name to be resolved by adopting the domain name resolution file of the local operating system to obtain a domain name resolution result to be analyzed;
s522: when the domain name resolution result to be analyzed is successful, determining that the second domain name resolution result is successful;
s523: and when the domain name resolution result to be analyzed is failure, performing domain name resolution on the domain name to be analyzed by adopting the domain name resolution server to obtain a second domain name resolution result.
In this embodiment, the domain name resolution file of the local operating system and the domain name resolution server are sequentially adopted to perform domain name resolution, and the domain name to be resolved is subjected to domain name resolution, so that a bottom-seeking strategy is implemented, and the success rate of domain name resolution is improved.
For S521, when the preset domain name resolution rule is that the domain name resolution file of the local operating system and the domain name resolution server are sequentially used for domain name resolution, it means that the domain name resolution file of the local operating system is used first to perform domain name resolution on the domain name to be resolved, when the domain name resolution file of the local operating system is used to perform successful domain name resolution on the domain name to be resolved, it is determined that the domain name resolution result to be analyzed is successful, and when the domain name resolution file of the local operating system is used to perform no successful domain name resolution on the domain name to be resolved, it is determined that the domain name resolution result to be analyzed is failed.
For S522, when the result of domain name resolution to be analyzed is successful, it means that the domain name resolution file of the local operating system has already performed successful domain name resolution on the domain name to be resolved, so that it may be determined that the result of domain name resolution of the second domain name is successful.
For S523, when the result of domain name resolution to be analyzed is failure, it means that the domain name resolution file of the local operating system does not perform successful domain name resolution on the domain name to be resolved, and at this time, the domain name resolution server is adopted to perform domain name resolution on the domain name to be resolved; when the domain name to be analyzed is successfully analyzed by the domain name analysis server, determining that the second domain name analysis result is successful; and when the domain name to be analyzed is not successfully analyzed by the domain name analysis server, determining that the second domain name analysis result is failure.
Referring to fig. 2, the present application further provides a domain name resolution apparatus, including:
a domain name acquisition module 100 to be resolved, configured to acquire, through a target domain name resolution class, a domain name to be resolved that is submitted by a target application service according to a target request;
a first domain name resolution result determining module 200, configured to perform domain name resolution on the domain name to be resolved through the target domain name resolution class, so as to obtain a first domain name resolution result;
a first target domain name data determining module 300, configured to determine target domain name data according to the first domain name resolution result when the first domain name resolution result is successful;
a preset domain name resolution rule determining module 400, configured to obtain a preset domain name resolution rule when the first domain name resolution result is a failure;
a second domain name resolution result determining module 500, configured to perform domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server, and a domain name resolution file of a local operating system, so as to obtain a second domain name resolution result;
a second target domain name data determining module 600, configured to determine the target domain name data according to the second domain name resolution result when the second domain name resolution result is successful, and otherwise, generate a domain name resolution failure signal according to the domain name to be resolved.
According to the embodiment, firstly, a domain name to be resolved submitted by a target application service according to a target request is obtained through a target domain name resolution class, domain name resolution is carried out on the domain name to be resolved to obtain a first domain name resolution result, when the first domain name resolution result is successful, target domain name data are determined according to the first domain name resolution result, then, when the first domain name resolution result is failed, a preset domain name resolution rule is obtained, finally, domain name resolution is carried out on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result, when the second domain name resolution result is successful, the target domain name data are determined according to the second domain name resolution result, otherwise, a domain name resolution failure signal is generated according to the domain name to be resolved, configuration of software-level domain name resolution is achieved through the target domain name resolution class, the domain name of a foundation cloud is decoupled from a foundation cloud facility, a modification process of the domain name resolution is shortened, and the online speed of the application service is improved.
Referring to fig. 3, an embodiment of the present application further provides a computer device, where the computer device may be a server, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data such as a domain name resolution method and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a domain name resolution method. The domain name resolution method comprises the following steps: acquiring a domain name to be analyzed submitted by a target application service according to a target request through a target domain name analysis class; performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result; when the first domain name resolution result is successful, determining target domain name data according to the first domain name resolution result; when the first domain name resolution result is failure, acquiring a preset domain name resolution rule; performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result; and when the second domain name resolution result is successful, determining the target domain name data according to the second domain name resolution result, otherwise, generating a domain name resolution failure signal according to the domain name to be resolved.
According to the embodiment, firstly, a domain name to be resolved submitted by a target application service according to a target request is obtained through a target domain name resolution class, domain name resolution is carried out on the domain name to be resolved to obtain a first domain name resolution result, when the first domain name resolution result is successful, target domain name data are determined according to the first domain name resolution result, then, when the first domain name resolution result is failed, a preset domain name resolution rule is obtained, finally, domain name resolution is carried out on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result, when the second domain name resolution result is successful, the target domain name data are determined according to the second domain name resolution result, otherwise, a domain name resolution failure signal is generated according to the domain name to be resolved, configuration of software-level domain name resolution is achieved through the target domain name resolution class, the domain name of a foundation cloud is decoupled from a foundation cloud facility, a modification process of the domain name resolution is shortened, and the online speed of the application service is improved.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements a domain name resolution method, including the steps of: acquiring a domain name to be analyzed submitted by a target application service according to a target request through a target domain name analysis class; performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result; when the first domain name resolution result is successful, determining target domain name data according to the first domain name resolution result; when the first domain name resolution result is failure, acquiring a preset domain name resolution rule; performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result; and when the second domain name resolution result is successful, determining the target domain name data according to the second domain name resolution result, otherwise, generating a domain name resolution failure signal according to the domain name to be resolved.
According to the executed domain name resolution method, firstly, a domain name to be resolved submitted by a target application service according to a target request is obtained through a target domain name resolution class, domain name resolution is carried out on the domain name to be resolved, a first domain name resolution result is obtained, when the first domain name resolution result is successful, target domain name data are determined according to the first domain name resolution result, then, when the first domain name resolution result is failed, a preset domain name resolution rule is obtained, finally, domain name resolution is carried out on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system, a second domain name resolution result is obtained, when the second domain name resolution result is successful, the target domain name data are determined according to the second domain name resolution result, otherwise, a domain name resolution failure signal is generated according to the domain name to be resolved, the configuration of the domain name resolution on a software level through the target domain name resolution class is achieved, the domain name resolution of a foundation cloud is decoupled with a foundation cloud facility, the modification process of the domain name resolution is shortened, and the online speed of the application service is improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and bused dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of another identical element in a process, apparatus, article, or method comprising the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (7)

1. A domain name resolution method, the method comprising:
acquiring a domain name to be analyzed submitted by a target application service according to a target request through a target domain name analysis class;
performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result;
when the first domain name resolution result is successful, determining target domain name data according to the first domain name resolution result;
when the first domain name resolution result is failure, acquiring a preset domain name resolution rule;
performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server and a domain name resolution file of a local operating system to obtain a second domain name resolution result;
when the second domain name resolution result is successful, determining the target domain name data according to the second domain name resolution result, otherwise, generating a domain name resolution failure signal according to the domain name to be resolved;
before the step of obtaining the domain name to be resolved submitted by the target application service according to the target request through the target domain name resolution class, the method further includes:
acquiring a domain name configuration request;
responding the domain name configuration request, and acquiring a domain name resolution list to be updated;
updating a target Sprint configuration file of the target domain name resolution class according to the domain name resolution list to be updated;
acquiring the domain name resolution list to be updated from the target Sprint configuration file through the target domain name resolution class, writing the acquired domain name resolution list to be updated into a cache of a Java virtual machine, and generating a first cache completion signal;
restarting the target application service according to the first cache completion signal through a service starting class of the SpringBoot;
before the step of obtaining the domain name configuration request, the method further includes:
acquiring a domain name resolution generation request;
responding to the domain name resolution class generation request, and adopting an engineering creation tool to create an engineering to obtain a domain name resolution class to be configured;
acquiring an engineering configuration file to be added and a Sprint configuration file to be added, wherein the engineering configuration file to be added comprises: the method comprises the following steps that dependent configuration data of the SpringBoot and dependent configuration data of a domain name cache operation tool are obtained, and the SpringBoot configuration file to be added comprises the following steps: opening JVM virtual domain name configuration data and a domain name resolution list to be added;
configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class;
writing a domain name resolution list in the target domain name resolution class into a cache of a Java virtual machine through the target domain name resolution class to generate a second cache completion signal;
restarting the target application service according to the second cache completion signal through the service starting class of the SpringBoot;
the step of configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class includes:
updating the project configuration file of the domain name resolution class to be configured according to the project configuration file to be added;
updating the Sprint configuration file of the domain name resolution class to be configured according to the Sprint configuration file to be added;
and taking the domain name resolution class to be configured as the target domain name resolution class.
2. The domain name resolution method according to claim 1, wherein the step of performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result comprises:
and searching the domain name to be analyzed in a cache of the Java virtual machine in the Java virtual machine through the target domain name analysis class, and determining that the first domain name analysis result is successful when the domain name is searched in the cache of the Java virtual machine, or determining that the first domain name analysis result is failed.
3. The domain name resolution method according to claim 1, wherein the step of performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server, and a domain name resolution file of a local operating system to obtain a second domain name resolution result comprises:
when the preset domain name resolution rule is that domain name resolution is performed by sequentially adopting the domain name resolution server and the domain name resolution file of the local operating system, performing domain name resolution on the domain name to be resolved by adopting the domain name resolution server to obtain a domain name resolution result to be processed;
when the domain name resolution result to be processed is successful, determining that the second domain name resolution result is successful;
and when the domain name resolution result to be processed is failure, performing domain name resolution on the domain name to be resolved by adopting a domain name resolution file of the local operating system to obtain a second domain name resolution result.
4. The domain name resolution method according to claim 1, wherein the step of performing domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server, and a domain name resolution file of a local operating system to obtain a second domain name resolution result further comprises:
when the preset domain name resolution rule is that domain name resolution is performed by sequentially adopting the domain name resolution file of the local operating system and the domain name resolution server, performing domain name resolution on the domain name to be resolved by adopting the domain name resolution file of the local operating system to obtain a domain name resolution result to be analyzed;
when the domain name resolution result to be analyzed is successful, determining that the second domain name resolution result is successful;
and when the domain name resolution result to be analyzed is failure, performing domain name resolution on the domain name to be analyzed by adopting the domain name resolution server to obtain a second domain name resolution result.
5. A domain name resolution apparatus, the apparatus comprising:
the domain name acquisition module to be analyzed is used for acquiring the domain name to be analyzed submitted by the target application service according to the target request through the target domain name analysis class;
the first domain name resolution result determining module is used for performing domain name resolution on the domain name to be resolved through the target domain name resolution class to obtain a first domain name resolution result;
the first target domain name data determining module is used for determining target domain name data according to the first domain name resolution result when the first domain name resolution result is successful;
a preset domain name resolution rule determining module, configured to obtain a preset domain name resolution rule when the first domain name resolution result is a failure;
a second domain name resolution result determining module, configured to perform domain name resolution on the domain name to be resolved according to the preset domain name resolution rule, a domain name resolution server, and a domain name resolution file of a local operating system, so as to obtain a second domain name resolution result;
a second target domain name data determining module, configured to determine, when the second domain name resolution result is successful, the target domain name data according to the second domain name resolution result, and otherwise, generate a domain name resolution failure signal according to the domain name to be resolved;
before the step of obtaining the domain name to be resolved submitted by the target application service according to the target request through the target domain name resolution class, the method further includes:
acquiring a domain name configuration request;
responding to the domain name configuration request, and acquiring a domain name resolution list to be updated;
updating a target Sprint configuration file of the target domain name resolution class according to the domain name resolution list to be updated;
acquiring the domain name resolution list to be updated from the target Sprint configuration file through the target domain name resolution class, writing the acquired domain name resolution list to be updated into a cache of a Java virtual machine, and generating a first cache completion signal;
restarting the target application service according to the first cache completion signal through a service starting class of the SpringBoot;
before the step of obtaining the domain name configuration request, the method further includes:
acquiring a domain name resolution generation request;
responding to the domain name resolution class generation request, and adopting an engineering creation tool to create an engineering to obtain a domain name resolution class to be configured;
acquiring an engineering configuration file to be added and a Sprint configuration file to be added, wherein the engineering configuration file to be added comprises: the method comprises the following steps that dependent configuration data of the SpringBoot and dependent configuration data of a domain name cache operation tool are obtained, and the SpringBoot configuration file to be added comprises the following steps: opening JVM virtual domain name configuration data and a domain name resolution list to be added;
according to the project configuration file to be added and the Sprint configuration file to be added, configuring the domain name resolution class to be configured to obtain the target domain name resolution class;
writing a domain name resolution list in the target domain name resolution class into a cache of a Java virtual machine through the target domain name resolution class to generate a second cache completion signal;
restarting the target application service according to the second cache completion signal through the service starting class of the SpringBoot;
the step of configuring the domain name resolution class to be configured according to the project configuration file to be added and the Sprint configuration file to be added to obtain the target domain name resolution class includes:
updating the project configuration file of the domain name resolution class to be configured according to the project configuration file to be added;
updating the Sprint configuration file of the domain name resolution class to be configured according to the Sprint configuration file to be added;
and taking the domain name resolution class to be configured as the target domain name resolution class.
6. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202110734752.0A 2021-06-30 2021-06-30 Domain name resolution method, device, equipment and storage medium Active CN113472915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110734752.0A CN113472915B (en) 2021-06-30 2021-06-30 Domain name resolution method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110734752.0A CN113472915B (en) 2021-06-30 2021-06-30 Domain name resolution method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113472915A CN113472915A (en) 2021-10-01
CN113472915B true CN113472915B (en) 2023-02-07

Family

ID=77874299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110734752.0A Active CN113472915B (en) 2021-06-30 2021-06-30 Domain name resolution method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113472915B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785753B (en) * 2022-05-05 2023-10-27 上海道客网络科技有限公司 Domain name resolution method, system, medium and electronic equipment of container cloud platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10033691B1 (en) * 2016-08-24 2018-07-24 Amazon Technologies, Inc. Adaptive resolution of domain name requests in virtual private cloud network environments
CN110290233A (en) * 2019-06-27 2019-09-27 广州虎牙科技有限公司 Domain name analytic method, device, server and computer readable storage medium
CN112153166A (en) * 2019-06-27 2020-12-29 北京声智科技有限公司 DNS rapid analysis method, device, terminal and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10033691B1 (en) * 2016-08-24 2018-07-24 Amazon Technologies, Inc. Adaptive resolution of domain name requests in virtual private cloud network environments
CN110290233A (en) * 2019-06-27 2019-09-27 广州虎牙科技有限公司 Domain name analytic method, device, server and computer readable storage medium
CN112153166A (en) * 2019-06-27 2020-12-29 北京声智科技有限公司 DNS rapid analysis method, device, terminal and medium

Also Published As

Publication number Publication date
CN113472915A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN107729014B (en) Page jump method and structure based on Android
CN109729183B (en) Request processing method, device, equipment and storage medium
CN109361628B (en) Message assembling method and device, computer equipment and storage medium
CN108959384B (en) Webpage data acquisition method and device, computer equipment and storage medium
CN113472915B (en) Domain name resolution method, device, equipment and storage medium
CN114238811A (en) Page loading method, page request response method, device, equipment and medium
CN111083054B (en) Route configuration processing method and device, computer equipment and storage medium
CN113301161B (en) Seamless upgrading method, device, equipment and storage medium of application service
CN113489650B (en) Routing method, device and equipment of client and storage medium
CN113535262A (en) Method, device, equipment and storage medium for controlling starting of proxy node
CN113448640A (en) WEB application configuration detection method, device, storage medium and computer equipment
CN115640471A (en) Short link generation method and device, computer equipment and storage medium
CN113486267B (en) Method, device, equipment and storage medium for analyzing application entry page
CN114048367A (en) Metadata information query method, device, equipment and storage medium
CN113918193A (en) Gray level calling method, device, equipment and storage medium suitable for micro-service
CN114936237A (en) Behavior data analysis method, behavior data analysis device, behavior data analysis equipment and storage medium
CN112416462B (en) Offline H5 application loading method and system
CN109657178B (en) Page form processing method and device, computer equipment and storage medium
CN114237736A (en) Page resource loading method, system, device, computer equipment and storage medium
CN113867756A (en) Software upgrading method, terminal equipment and readable storage medium
CN113051299A (en) Proxy information processing method, proxy information processing device, computer equipment and storage medium
CN113360180A (en) Component configuration method and device of system, computer equipment and storage medium
CN111866203B (en) Domain name resolution method and device, readable storage medium and equipment
CN113326506A (en) Applet monitoring method and device
CN111931087A (en) Webpage request processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant