CN112804371A - Domain name resolution processing method and device - Google Patents

Domain name resolution processing method and device Download PDF

Info

Publication number
CN112804371A
CN112804371A CN202011627166.8A CN202011627166A CN112804371A CN 112804371 A CN112804371 A CN 112804371A CN 202011627166 A CN202011627166 A CN 202011627166A CN 112804371 A CN112804371 A CN 112804371A
Authority
CN
China
Prior art keywords
domain name
target
address
mapping table
mapping
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.)
Granted
Application number
CN202011627166.8A
Other languages
Chinese (zh)
Other versions
CN112804371B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011627166.8A priority Critical patent/CN112804371B/en
Publication of CN112804371A publication Critical patent/CN112804371A/en
Application granted granted Critical
Publication of CN112804371B publication Critical patent/CN112804371B/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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a domain name resolution processing method and a domain name resolution processing device, wherein the method comprises the following steps: pre-resolving a registered and/or stored domain name in a domain name table when equipment is started to obtain an IP address corresponding to the domain name, and caching a mapping relation between the domain name and the IP address into a mapping table; when the IP address of the domain name is requested to be applied, the IP address corresponding to the domain name is obtained according to the mapping table, the problems that in the related technology, the DNS message is accelerated when being received, and the time consumption in the process of sending and receiving the DNS message cannot be accelerated under the condition of large network delay can be solved, and the method and the device can be used for reducing the time consumption in the process of domain name resolution and increasing the success rate of domain name resolution under the condition of large network delay.

Description

Domain name resolution processing method and device
Technical Field
The present invention relates to the field of communications, and in particular, to a domain name resolution processing method and apparatus.
Background
Compared with a common computer, the embedded equipment has the characteristic of definite service, and the domain name to be analyzed is fixed or limited. Although the cache is selected to be prioritized when performing Domain Name System (DNS) resolution for reducing network delay, network DNS resolution is triggered to increase delay of service communication when a mapping relationship between a Domain Name and an Internet Protocol (IP) in a DNS server is changed, service interaction occurs when a device is started, and the like. Furthermore, since the cache is given priority, the DNS traffic balancing function of the DNS server is disabled, thereby increasing the pressure on the DNS server.
The method for analyzing and accelerating the cache and the device for analyzing and accelerating the cache are provided in the related technology, and the method is used for controlling a kernel-mode DNS cache server to analyze the DNS cache when the domain name of the DNS message is received and needs to be cached and accelerated. The acceleration processing is only performed when the DNS message is received, and when the service performs domain name resolution for the first time, the DNS message generally needs to be sent and resolved, and even if the acceleration is started when the DNS message is received, the time consumption in the process of sending and receiving the DNS message cannot be accelerated under the condition of large network delay.
For the problem that the acceleration is started when the DNS message is received in the related art, and the time consumption in the process of sending and receiving the DNS message cannot be accelerated under the condition of large network delay, no solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a domain name resolution processing method and a domain name resolution processing device, which are used for at least solving the problems that in the related art, the speed is increased when a DNS message is received, and the time consumption in the process of sending and receiving the DNS message cannot be increased under the condition of large network delay.
According to an embodiment of the present invention, there is provided a domain name resolution processing method including:
pre-resolving a registered and/or stored domain name in a domain name table when equipment is started to obtain an IP address corresponding to the domain name;
caching the mapping relation between the domain name and the IP address into a mapping table, wherein the mapping table is used for acquiring the IP address corresponding to the domain name when receiving a domain name resolution request of the domain name.
Optionally, after caching the mapping relationship between the domain name and the IP address, the method further includes:
receiving the domain name resolution request, wherein the domain name request carries a target domain name;
judging whether the target domain name exists in the mapping table or not;
and under the condition that the target domain name exists in the mapping table, acquiring a target IP address corresponding to the target domain name according to the cached mapping relation.
Optionally, the method further comprises:
sending a domain name resolution request to a server under the condition that the target domain name does not exist in the mapping table;
receiving a domain name resolution response sent by the server, wherein the domain name resolution response carries a target IP address corresponding to the target domain name;
and caching the mapping relation between the target domain name and the target IP address into the mapping table, and storing the target domain name.
Optionally, after obtaining the target IP address corresponding to the target domain name according to the cached mapping relationship, the method further includes:
performing service communication according to the target IP address;
if the service communication fails, setting the target IP address as a failure IP address;
and deleting the mapping relation between the target domain name and the target IP address from the mapping table.
Optionally, deleting the mapping relationship between the target domain name and the target IP address from the mapping table includes:
detecting whether the network state of the equipment is normal;
and deleting the mapping relation between the target domain name and the target IP address from the mapping table under the condition that the network state is normal.
Optionally, after caching the mapping relationship between the domain name and the IP address in the mapping table, the method further includes:
initiating a domain name resolution request for the domain name in the mapping table according to a preset time period;
and updating the mapping table according to the IP address carried in the domain name resolution response of the domain name resolution request.
According to still another embodiment of the present invention, there is also provided a domain name resolution processing apparatus including:
the device comprises an analysis module, a storage module and a processing module, wherein the analysis module is used for pre-analyzing registered and/or stored domain names in a domain name table when the device is started to obtain IP addresses corresponding to the domain names;
the first caching module is configured to cache the mapping relationship between the domain name and the IP address in a mapping table, where the mapping table is used to obtain the IP address corresponding to the domain name when receiving a domain name resolution request of the domain name.
Optionally, the apparatus further comprises:
the first receiving module is used for receiving a domain name resolution request, wherein the domain name request carries a target domain name;
the judging module is used for judging whether the target domain name exists in the mapping table or not;
and the obtaining module is used for obtaining the target IP address corresponding to the target domain name according to the cached mapping relation under the condition that the target domain name exists in the mapping table.
Optionally, the apparatus further comprises:
a sending module, configured to send a domain name resolution request to a server when the target domain name does not exist in the mapping table;
a second receiving module, configured to receive a domain name resolution response sent by the server, where the domain name resolution response carries a target IP address corresponding to the target domain name;
and the second caching module is used for caching the mapping relation between the target domain name and the target IP address into the mapping table and storing the target domain name.
Optionally, the apparatus further comprises:
the communication module is used for carrying out service communication according to the target IP address;
the setting module is used for setting the target IP address as a failure IP address if the service communication fails;
and the deleting module is used for deleting the mapping relation between the target domain name and the target IP address from the mapping table.
Optionally, the deleting module includes:
the detection submodule is used for detecting whether the network state of the equipment is normal or not;
and the deleting submodule is used for deleting the mapping relation between the target domain name and the target IP address from the mapping table under the condition that the network state is normal.
Optionally, the apparatus further comprises:
the initiating module is used for initiating a domain name resolution request to the domain name in the mapping table in a preset time period;
and the updating module is used for updating the mapping table according to the IP address carried in the domain name resolution response of the domain name resolution request.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, when the equipment is started, the registered and/or stored domain name in the domain name table is pre-resolved to obtain the IP address corresponding to the domain name; the mapping relation between the domain name and the IP address is cached in a mapping table, when a domain name resolution request of the domain name is received, the IP address corresponding to the domain name is obtained according to the mapping table, the problem that the acceleration is started when a DNS message is received in the related technology, and the time consumption in the process of sending and receiving the DNS message cannot be accelerated under the condition of large network delay can be solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a domain name resolution processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a domain name resolution processing method according to an embodiment of the present invention;
fig. 3 is a block diagram of a domain name resolution processing apparatus according to an embodiment of the present invention;
fig. 4 is a first block diagram of a domain name resolution processing apparatus according to a preferred embodiment of the present invention;
fig. 5 is a block diagram two of a domain name resolution processing apparatus according to a preferred embodiment of the present invention;
fig. 6 is a block diagram three of a domain name resolution processing apparatus according to a preferred embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a hardware structure block diagram of a mobile terminal of a domain name resolution processing method according to an embodiment of the present invention, and as shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for a communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the domain name resolution processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a domain name resolution processing method operating in the mobile terminal or the network architecture is provided, and fig. 2 is a flowchart of the domain name resolution processing method according to the embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, pre-resolving the registered and/or stored domain name in the domain name table when the device is started to obtain the IP address corresponding to the domain name;
step S204, caching the mapping relationship between the domain name and the IP address into a mapping table, where the mapping table is used to obtain the IP address corresponding to the domain name when receiving the domain name resolution request of the domain name.
Through the steps S202 to S204, pre-resolving the registered and/or stored domain name in the domain name table when the device is started to obtain the IP address corresponding to the domain name; the mapping relation between the domain name and the IP address is cached in a mapping table, wherein the mapping table is used for acquiring the IP address corresponding to the domain name when a domain name resolution request of the domain name is received, the problem that the acceleration is started when a DNS message is received in the related technology, and the time consumption in the process of sending and receiving the DNS message cannot be accelerated under the condition of large network delay can be solved.
In an optional embodiment, after caching the mapping relationship between the domain name and the IP address, receiving a domain name resolution request, where the domain name request carries a target domain name; judging whether the target domain name exists in the mapping table or not; and under the condition that the target domain name exists in the mapping table, acquiring a target IP address corresponding to the target domain name according to the cached mapping relation.
In another optional embodiment, in case the target domain name does not exist in the mapping table, sending a domain name resolution request to a server; receiving a domain name resolution response sent by the server, wherein the domain name resolution response carries a target IP address corresponding to the target domain name; and caching the mapping relation between the target domain name and the target IP address into the mapping table, and storing the target domain name.
In another optional embodiment, after the target IP address corresponding to the target domain name is obtained according to the cached mapping relationship, service communication is performed according to the target IP address; if the service communication fails, setting the target IP address as a failure IP address; and deleting the mapping relation between the target domain name and the target IP address from the mapping table.
In another optional embodiment, deleting the mapping relationship between the target domain name and the target IP address from the mapping table includes: detecting whether the network state of the equipment is normal; and deleting the mapping relation between the target domain name and the target IP address from the mapping table under the condition that the network state is normal.
Optionally, after caching the mapping relationship between the domain name and the IP address in the mapping table, initiating a domain name resolution request for the domain name in the mapping table at a preset time period; and updating the mapping table according to the IP address carried in the domain name resolution response of the domain name resolution request.
The embodiment of the invention carries out network domain name resolution on the domain name required by the service as far as possible in advance by starting the preloading mode, and the mapping between the domain name and the IP list is put in the cache. When the service needs domain name resolution, the cache already has the IP address corresponding to the domain name, even if the service makes a domain name request for the first time after starting up. Meanwhile, the Domain Name and the IP mapping cache are refreshed at regular time, a traffic load balancing method of a Domain Name System (DNS) server is prevented from being damaged due to the fact that the IP is cached and fixed, when network service communication fails after the IP corresponding to the Domain Name is obtained at the upper layer, the current invalid IP can be fed back to the fast DNS method, the invalid IP is filtered from the cache, and therefore service communication failure caused by the fact that the invalid IP is returned is prevented. The method comprises four parts of starting preloading, regularly refreshing cache, newly added domain name storage and a failure IP feedback module. When the pre-loading is started, the domain name required by the service is firstly subjected to a domain name resolution request, and the acquired IP information and the domain name are mapped so as to ensure that the domain name is directly acquired from a local cache when the service is required to be subjected to the domain name resolution. Meanwhile, the cache is refreshed at regular time to ensure the accuracy of the mapping relation between the domain name and the IP. When the service sometimes requests to start up and start up a domain name without preloading, the newly added domain name is written into a file of the equipment (the domain name cannot be deleted after being restarted) besides performing network domain name resolution. When the system is started to start preloading after restarting, the newly added domain name can be obtained from the file, and the domain name is made into a domain name resolution request together with the domain name required by the service, so that the situation of the newly added domain name is reduced, and the process of quickly requesting the DNS is achieved. And the upper service module can inform that a certain IP in the cache of the fast DNS method is invalid (for example, the service is used and the IP communication fails, and the DNS analysis is not expected to return the IP), and the invalid IP feedback module can remove the IP from an IP list returned to the user, so that the validity of the IP fed back by the fast DNS method is increased.
Starting up and preloading, the user can register the domain names related to the services to the starting up and preloading module, when starting up, the module can make domain name resolution for one time on the domain names registered by the user, and writes the resolution result into the cache. Meanwhile, the module can also read the file stored by the newly added domain name and check whether the newly added domain name needs to be analyzed. And if so, performing domain name resolution and writing the domain name resolution into a cache.
And refreshing the cache at regular time, placing the domain name to be subjected to DNS analysis in a cache module, immediately triggering network DNS analysis on the domain name by the cache module when the domain name is newly added or changed, and mapping the acquired IP address and the domain name. The cache module also can make network DNS analysis at a later stage at regular time so as to ensure that the mapping relation between the domain name and the IP can be correctly corresponded. When domain name resolution fails, the retry can be selectively carried out according to different failure conditions, for example, the retry is carried out again after overtime so as to prevent message loss and the like caused by network jitter.
And (3) storing the newly added domain name, wherein in the service interaction process, if a new domain name (which is not stored in a cache) is used, the newly added domain name can be written into a file to be stored except for making a network domain name request and forming a mapping between a corresponding IP address and the domain name and putting the mapping into the cache, and the newly added domain name can be provided for use when starting up and preloading, so that the condition that the new domain name is used in the service interaction process is reduced.
And (4) failed IP feedback, wherein after the upper-layer service receives the IP corresponding to the domain name, network communication on the service is carried out. If the IP fails to always communicate in the communication, the IP can be fed back to the fast DNS method through an interface of the invalid IP feedback module. Thus, when the IP corresponding to the domain name is obtained from the cache again, an invalid IP will not be obtained. Meanwhile, the failure IP feedback module supports detecting whether the embedded network is abnormal (such as network disconnection, routing abnormality, etc., but not limited to these cases), and for an invalid IP added when the upper layer service fails when the network is abnormal, the mapping relationship between the domain name and the IP (not IP failure, but network abnormality) is not deleted because the IP is considered to be failed. The method specifically comprises the following steps:
step 1, a user registers a domain name which is possibly used by a service into a starting preloading module.
And 2, when the equipment is started, starting a preloading module to read a file stored by the newly added domain name, if the domain name exists in the file, initiating a domain name request together with the domain name registered by the user, and writing the request into the mapping relation between the IP and the domain name in a cache.
And 3, the mapping relation between the domain name and the IP in the cache can periodically initiate a domain name request in the background, and the mapping relation between the domain name and the IP in the cache is refreshed to ensure the accuracy of the domain name and the IP.
And step 4, when the service needs to make a domain name request, directly obtaining the domain name request from the cache, and if the service needs to make the domain name request, directly returning the domain name request, so that the time for domain name resolution is reduced.
And 5, if the cache does not exist, initiating a domain name resolution request, storing the mapping relation between the IP and the domain name requested by the request in the cache and returning the mapping relation to the service.
And 6, if the requested domain name is the new domain name, writing the new domain name into a file to be stored in the equipment (the file cannot be cleared after the equipment is restarted), and reducing the condition that the service accesses the new domain name by matching with the logic in the step 2.
And 7, the upper layer service carries out service communication on the returned IP, and if the communication fails or the IP is not expected to be used, the interface of the invalid IP feedback module is called to set the IP.
And 8, the failure IP feedback module deletes the IP according to the cache of the mapping from the IP to the domain name and the IP set by the service, and simultaneously, before refreshing the cache or updating the cache of the mapping from the domain name and the IP each time, whether the IP exists in the failure IP feedback module needs to be checked. If so, it is not added to the cache.
And 9, the failure IP feedback module simultaneously monitors the network conditions of the equipment in real time (such as network disconnection, routing abnormality and the like, but not limited to the conditions), and does not perform failure processing on the failure IP added by the upper-layer service when the network is abnormal.
According to the embodiment of the invention, the problem that time is consumed by a network DNS request in a service process is solved by means of performing domain name resolution on a domain name which can be used by equipment in advance when the equipment is started and putting a result in a cache. When a domain name except for the starting preloading is newly added in the service process, the domain name is written into a file for storage, and when equipment is restarted, a starting preloading module carries out domain name resolution on the domain name in the file and the registered domain name together, so that the condition that a network DNS request needs to be carried out in the service is reduced, and the time of the DNS resolution process in the service is reduced. By the method for refreshing the mapping relation between the IP and the domain name at regular time, the accuracy of data in the cache is improved, and the problem that a DNS server flow load balancing mechanism is damaged when the cache is cached is solved. By providing invalid IP feedback, the service feeds back the abnormal IP corresponding to the found domain name during communication, thereby solving the problem that the invalid or blocked IP is returned to the service during domain name resolution and reducing unnecessary time consumption.
When the embedded device is just started, the preloading resolves the domain names needed by the service in advance, and time consumed by resolving the network domain names in the service process is reduced. Meanwhile, a file can be written in the newly added domain name in the service, and domain name resolution can be performed on the domain name written in the file in advance when the pre-loading is started, because the domain name used in the service is limited, the time for domain name resolution can be reduced at a high probability by the two modes, and a fast DNS mode is achieved.
Example 2
According to another embodiment of the present invention, there is also provided a domain name resolution processing apparatus, and fig. 3 is a block diagram of the domain name resolution processing apparatus according to the embodiment of the present invention, as shown in fig. 3, including:
the resolution module 32 is configured to perform pre-resolution on a domain name registered and/or stored in the domain name table when the device is started, so as to obtain an IP address corresponding to the domain name;
the first caching module 34 is configured to cache the mapping relationship between the domain name and the IP address in a mapping table, where the mapping table is used to obtain the IP address corresponding to the domain name when receiving a domain name resolution request of the domain name.
Fig. 4 is a first block diagram of a domain name resolution processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 4, the apparatus further includes:
a first receiving module 42, configured to receive a domain name resolution request, where the domain name request carries a target domain name;
a determining module 44, configured to determine whether the target domain name exists in the mapping table;
an obtaining module 46, configured to obtain, when the target domain name exists in the mapping table, a target IP address corresponding to the target domain name according to the cached mapping relationship.
Fig. 5 is a block diagram ii of a domain name resolution processing apparatus according to a preferred embodiment of the present invention, and as shown in fig. 5, the apparatus further includes:
a sending module 52, configured to send a domain name resolution request to a server when the target domain name does not exist in the mapping table;
a second receiving module 54, configured to receive a domain name resolution response sent by the server, where the domain name resolution response carries a target IP address corresponding to the target domain name;
a second caching module 56, configured to cache the mapping relationship between the target domain name and the target IP address in the mapping table, and store the target domain name.
Fig. 6 is a block diagram three of a domain name resolution processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 6, the apparatus further includes:
a communication module 62, configured to perform service communication according to the target IP address;
a setting module 64, configured to set the target IP address as a failed IP address if service communication fails;
a deleting module 66, configured to delete the mapping relationship between the target domain name and the target IP address from the mapping table.
Optionally, the deleting module 66 includes:
the detection submodule is used for detecting whether the network state of the equipment is normal or not;
and the deleting submodule is used for deleting the mapping relation between the target domain name and the target IP address from the mapping table under the condition that the network state is normal.
Optionally, the apparatus further comprises:
the initiating module is used for initiating a domain name resolution request to the domain name in the mapping table in a preset time period;
and the updating module is used for updating the mapping table according to the IP address carried in the domain name resolution response of the domain name resolution request.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, pre-resolving the registered and/or stored domain name in the domain name table when the device is started to obtain the IP address corresponding to the domain name;
and S2, caching the mapping relation between the domain name and the IP address into a mapping table, wherein the mapping table is used for acquiring the IP address corresponding to the domain name when receiving the domain name resolution request of the domain name.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Example 4
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, pre-resolving the registered and/or stored domain name in the domain name table when the device is started to obtain the IP address corresponding to the domain name;
and S2, caching the mapping relation between the domain name and the IP address into a mapping table, wherein the mapping table is used for acquiring the IP address corresponding to the domain name when receiving the domain name resolution request of the domain name.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A domain name resolution processing method is characterized by comprising the following steps:
pre-resolving a registered and/or stored domain name in a domain name table when equipment is started to obtain an IP address corresponding to the domain name;
caching the mapping relation between the domain name and the IP address into a mapping table, wherein the mapping table is used for acquiring the IP address corresponding to the domain name when receiving a domain name resolution request of the domain name.
2. The method of claim 1, wherein after caching the mapping between the domain name and the IP address, the method further comprises:
receiving the domain name resolution request, wherein the domain name request carries a target domain name;
judging whether the target domain name exists in the mapping table or not;
and under the condition that the target domain name exists in the mapping table, acquiring a target IP address corresponding to the target domain name according to the cached mapping relation.
3. The method of claim 2, further comprising:
sending the domain name resolution request to a server under the condition that the target domain name does not exist in the mapping table;
receiving a domain name resolution response sent by the server, wherein the domain name resolution response carries a target IP address corresponding to the target domain name;
and caching the mapping relation between the target domain name and the target IP address into the mapping table, and storing the target domain name.
4. The method according to claim 2, wherein after obtaining the target IP address corresponding to the target domain name according to the cached mapping relationship, the method further comprises:
performing service communication according to the target IP address;
if the service communication fails, setting the target IP address as a failure IP address;
and deleting the mapping relation between the target domain name and the target IP address from the mapping table.
5. The method of claim 4, wherein removing the mapping relationship between the target domain name and the target IP address from the mapping table comprises:
detecting whether the network state of the equipment is normal;
and deleting the mapping relation between the target domain name and the target IP address from the mapping table under the condition that the network state is normal.
6. The method of claim 1, wherein after caching the mapping relationship between the domain name and the IP address into the mapping table, the method further comprises:
initiating the domain name resolution request to the domain name in the mapping table according to a preset time period;
and updating the mapping table according to the IP address carried in the domain name resolution response of the domain name resolution request.
7. A domain name resolution processing apparatus, comprising:
the device comprises an analysis module, a storage module and a processing module, wherein the analysis module is used for pre-analyzing registered and/or stored domain names in a domain name table when the device is started to obtain IP addresses corresponding to the domain names;
the first caching module is configured to cache the mapping relationship between the domain name and the IP address in a mapping table, where the mapping table is used to obtain the IP address corresponding to the domain name when receiving a domain name resolution request of the domain name.
8. The apparatus of claim 7, further comprising:
a first receiving module, configured to receive the domain name resolution request, where the domain name request carries a target domain name;
the judging module is used for judging whether the target domain name exists in the mapping table or not;
and the obtaining module is used for obtaining the target IP address corresponding to the target domain name according to the cached mapping relation under the condition that the target domain name exists in the mapping table.
9. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method of any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202011627166.8A 2020-12-30 2020-12-30 Domain name resolution processing method and device Active CN112804371B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011627166.8A CN112804371B (en) 2020-12-30 2020-12-30 Domain name resolution processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011627166.8A CN112804371B (en) 2020-12-30 2020-12-30 Domain name resolution processing method and device

Publications (2)

Publication Number Publication Date
CN112804371A true CN112804371A (en) 2021-05-14
CN112804371B CN112804371B (en) 2023-04-07

Family

ID=75807852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011627166.8A Active CN112804371B (en) 2020-12-30 2020-12-30 Domain name resolution processing method and device

Country Status (1)

Country Link
CN (1) CN112804371B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104639672A (en) * 2015-02-12 2015-05-20 广州华多网络科技有限公司 Method and device for domain name resolution (DNS)
US20160219013A1 (en) * 2015-01-27 2016-07-28 Anchorfree Inc. System and method for suppressing dns requests
CN106506715A (en) * 2016-10-14 2017-03-15 乐视控股(北京)有限公司 Domain name analytic method and device
CN107682465A (en) * 2017-06-24 2018-02-09 平安科技(深圳)有限公司 Domain name mapping device, method and computer-readable recording medium
CN108737582A (en) * 2017-04-18 2018-11-02 艺龙网信息技术(北京)有限公司 The method and device of domain name mapping
CN108881515A (en) * 2018-07-09 2018-11-23 迈普通信技术股份有限公司 Domain name analytic method, device and the network equipment
CN110086895A (en) * 2019-04-11 2019-08-02 天津字节跳动科技有限公司 Domain name analytic method, device, medium and electronic equipment
CN111010460A (en) * 2019-12-16 2020-04-14 南京亚信智网科技有限公司 Domain name resolution method and device
CN111866211A (en) * 2020-07-13 2020-10-30 中国工商银行股份有限公司 Network access method, device, terminal and medium applied to terminal

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160219013A1 (en) * 2015-01-27 2016-07-28 Anchorfree Inc. System and method for suppressing dns requests
CN104639672A (en) * 2015-02-12 2015-05-20 广州华多网络科技有限公司 Method and device for domain name resolution (DNS)
CN106506715A (en) * 2016-10-14 2017-03-15 乐视控股(北京)有限公司 Domain name analytic method and device
CN108737582A (en) * 2017-04-18 2018-11-02 艺龙网信息技术(北京)有限公司 The method and device of domain name mapping
CN107682465A (en) * 2017-06-24 2018-02-09 平安科技(深圳)有限公司 Domain name mapping device, method and computer-readable recording medium
CN108881515A (en) * 2018-07-09 2018-11-23 迈普通信技术股份有限公司 Domain name analytic method, device and the network equipment
CN110086895A (en) * 2019-04-11 2019-08-02 天津字节跳动科技有限公司 Domain name analytic method, device, medium and electronic equipment
CN111010460A (en) * 2019-12-16 2020-04-14 南京亚信智网科技有限公司 Domain name resolution method and device
CN111866211A (en) * 2020-07-13 2020-10-30 中国工商银行股份有限公司 Network access method, device, terminal and medium applied to terminal

Also Published As

Publication number Publication date
CN112804371B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN109315004B (en) PDU type setting method and related entity
RU2527756C1 (en) Apparatus and method for executing function of dns resolution agent
US9883386B2 (en) Method and a server for managing profiles
CN108494755B (en) Method and device for transmitting Application Programming Interface (API) request
US20210385633A1 (en) User plane function configuration method and apparatus, and device
CN114364031B (en) Service providing method, device and storage medium
KR20110111317A (en) Method and apparatus for tracking device management data changes
CN113434293A (en) Method and apparatus for processing repeat request, storage medium, and electronic apparatus
CN114745413B (en) Access control method and device for server, computer equipment and storage medium
KR20210044281A (en) Method and apparatus for ensuring continuous device operation stability in cloud degraded mode
CN112702441B (en) Container-based access data processing method, device, system and storage medium
CN112804371B (en) Domain name resolution processing method and device
CN112148508B (en) Information processing method and related device
CN109743367B (en) Service processing method and device, electronic equipment and readable storage medium
CN115022278B (en) CDN processing method and system
US20240244414A1 (en) Session binding relationship processing method and apparatus, electronic device, and readable medium
CN115643628A (en) Method, device, readable medium and electronic equipment for connecting wireless network
CN112769967A (en) Domain name resolution processing method and device and electronic equipment
CN117938809B (en) Domain name access path optimization method, system and readable storage medium
CN114124442B (en) Method and system for defending DDOS attack
CN118590466B (en) Router management server address acquisition method and device in private network environment
CN114710564B (en) Service access method, device, electronic equipment and storage medium
US11606274B1 (en) Method for operations of virtual machines in monitoring cloud activities, system, and device applying the method
CN114827283B (en) Resource access method, device, medium and robot
CN118590871B (en) Data access method, device, electronic device and storage medium

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