CN114465926A - Recursive server monitoring method, device, equipment and storage medium - Google Patents

Recursive server monitoring method, device, equipment and storage medium Download PDF

Info

Publication number
CN114465926A
CN114465926A CN202210376607.4A CN202210376607A CN114465926A CN 114465926 A CN114465926 A CN 114465926A CN 202210376607 A CN202210376607 A CN 202210376607A CN 114465926 A CN114465926 A CN 114465926A
Authority
CN
China
Prior art keywords
domain name
preset
log
recursive server
name resolution
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
CN202210376607.4A
Other languages
Chinese (zh)
Other versions
CN114465926B (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.)
Peng Cheng Laboratory
Original Assignee
Peng Cheng Laboratory
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 Peng Cheng Laboratory filed Critical Peng Cheng Laboratory
Priority to CN202210376607.4A priority Critical patent/CN114465926B/en
Publication of CN114465926A publication Critical patent/CN114465926A/en
Application granted granted Critical
Publication of CN114465926B publication Critical patent/CN114465926B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention belongs to the technical field of computers, and discloses a recursive server monitoring method, a device, equipment and a storage medium. The domain name to be accessed is acquired from the preset domain name set, and is a nonexistent top-level domain name; accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server; generating a domain name resolution log according to a domain name resolution result, and writing the domain name resolution log into a preset log file; determining an unavailable period of the target recursive server based on a preset log file. The method comprises the steps of accessing a target recursive server by using a nonexistent top-level domain name, determining the current available state of the target recursive server according to a fed-back domain name resolution result, writing domain name resolution logs generated according to the domain name resolution result into a preset log file, and counting the domain name resolution results corresponding to the domain name resolution logs in the preset log file to determine the unavailable time period of the target recursive server.

Description

Recursive server monitoring method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for monitoring a recursive server.
Background
The traditional method for judging that the recursive server service is unavailable can only request a specific website through a browser, and then finds that the website cannot normally analyze the IP, the service is found to be unavailable at this time, but the starting time point of the unavailable service and the ending time point of the unavailable service cannot be accurately known, so that the time period and the time duration of the unavailable service, the influence caused by the unavailable service, the possible reasons of the unavailable service and the like are difficult to locate.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a recursive server monitoring method, a recursive server monitoring device, recursive server monitoring equipment and a recursive server monitoring storage medium, and aims to solve the technical problem that the prior art cannot determine the unavailable time period of a recursive server.
In order to achieve the above object, the present invention provides a recursive server monitoring method, comprising the steps of:
acquiring a domain name to be accessed from a preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name;
accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server;
generating a domain name resolution log according to a domain name resolution result, and writing the domain name resolution log into a preset log file;
determining an unavailable period of the target recursive server based on the preset log file.
Optionally, the step of generating a domain name resolution log according to the domain name resolution result, and writing the domain name resolution log into a preset log file includes:
reading a previous analysis log from a preset log file;
and if the domain name resolution result is inconsistent with the domain name resolution result in the previous resolution log, generating a domain name resolution log according to the domain name resolution result, and writing the domain name resolution log into a preset log file.
Optionally, the step of determining an unavailable period of the target recursive server based on the preset log file includes:
reading a domain name resolution log with a corresponding domain name resolution result as a first type result in the preset log file to obtain a first type log;
searching a domain name resolution log with a corresponding domain name resolution result as a second type result from the first type log forward in the preset log file to obtain a second type log corresponding to the first type log;
determining an unavailable time period of the target recursive server according to the first type of log and the second type of log.
Optionally, the step of accessing the target recursive server according to the domain name to be accessed includes:
acquiring a preset instruction template and acquiring an access address of a target recursive server;
filling the preset instruction template according to the access address and the domain name to be accessed to obtain a domain name access instruction;
and accessing the target recursive server through the domain name access instruction.
Optionally, after the step of accessing the target recursive server according to the domain name to be accessed and receiving the domain name resolution result fed back by the target recursive server, the method further includes:
if the domain name resolution result is a third type result, performing existence check on the domain name in the preset domain name set;
and removing the domain name passing the existence verification from the preset domain name set, and returning to the step of acquiring the domain name to be accessed from the preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name.
Optionally, the step of performing presence check on the domain name in the preset domain name set includes:
traversing the preset domain name set, and taking the traversed domain name as a domain name to be checked;
accessing a root domain name server according to the domain name to be verified, and receiving a domain name verification result fed back by the root domain name server;
determining whether the domain name to be checked exists according to the domain name checking result;
if the domain name to be checked exists, judging that the domain name to be checked passes the existence check;
and detecting whether the domain name which is not traversed exists in the preset domain name set, and if the domain name which is not traversed does not exist, finishing the traversal of the preset domain name set.
Optionally, the step of obtaining the domain name to be accessed from the preset domain name set, where the domain name to be accessed is a non-existent top-level domain name, includes:
acquiring a preset detection period, and generating a domain name detection condition according to the preset detection period;
monitoring the system operation time in real time, and acquiring a domain name to be accessed from a preset domain name set when the system operation time meets the domain name detection condition, wherein the domain name to be accessed is a nonexistent top-level domain name.
In addition, in order to achieve the above object, the present invention further provides a recursive server monitoring apparatus, including the following modules:
the domain name acquisition module is used for acquiring a domain name to be accessed from a preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name;
the service access module is used for accessing a target recursive server according to the domain name to be accessed and receiving a domain name resolution result fed back by the target recursive server;
the log generation module is used for generating a domain name resolution log according to a domain name resolution result and writing the domain name resolution log into a preset log file;
a time period determination module for determining an unavailable time period of the target recursive server based on the preset log file.
In addition, in order to achieve the above object, the present invention also provides a recursive server monitoring apparatus, including: a processor, a memory and a recursive server monitoring program stored on the memory and operable on the processor, the recursive server monitoring program when executed by the processor implementing the steps of the recursive server monitoring method as described above.
In addition, in order to achieve the above object, the present invention further provides a computer readable storage medium, on which a recursive server monitoring program is stored, which when executed implements the steps of the recursive server monitoring method as described above.
The domain name to be accessed is acquired from the preset domain name set, and is a nonexistent top-level domain name; accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server; generating a domain name resolution log according to a domain name resolution result, and writing the domain name resolution log into a preset log file; determining an unavailable period of the target recursive server based on a preset log file. The method comprises the steps of accessing a target recursive server by using a nonexistent top-level domain name, determining the current available state of the target recursive server according to a fed-back domain name resolution result, writing domain name resolution logs generated according to the domain name resolution result into a preset log file, and counting the domain name resolution results corresponding to the domain name resolution logs in the preset log file to determine the unavailable time period of the target recursive server.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a recursive server monitoring method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a recursive server monitoring method according to a second embodiment of the present invention;
fig. 4 is a block diagram of a recursive server monitoring apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a recursive server monitoring device of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a recursive server monitoring program.
In the electronic apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device according to the present invention may be provided in a recursive server monitoring device, and the electronic device calls a recursive server monitoring program stored in the memory 1005 through the processor 1001 and executes the recursive server monitoring method provided in the embodiment of the present invention.
Referring to fig. 2, fig. 2 is a schematic flow diagram of a recursive server monitoring method according to a first embodiment of the present invention.
In this embodiment, the recursive server monitoring method includes the following steps:
step S10: and acquiring a domain name to be accessed from a preset domain name set, wherein the domain name to be accessed is a non-existent top-level domain name.
It should be noted that, the execution subject of this embodiment may be the recursive server monitoring device, and the recursive server monitoring device may be an electronic device such as a personal computer, a server, or the like, or may be other devices that can implement the same or similar functions.
It should be noted that the preset domain name set may be a set formed by aggregating a large number of non-existent top-level domain names, and the preset domain name set may be preset by a manager of the recursive server monitoring device. Wherein the non-existent top level domain name may be a top level domain name that is not used by any person or institution.
In a specific implementation, the monitoring of the recursive server is continuous, and therefore, the target recursive server needs to be accessed periodically, where a period may be preset by a manager of the recursive server monitoring device, and therefore, the step S10 in this embodiment may include:
acquiring a preset detection period, and generating a domain name detection condition according to the preset detection period;
monitoring the system operation time in real time, and acquiring a domain name to be accessed from a preset domain name set when the system operation time meets the domain name detection condition, wherein the domain name to be accessed is a nonexistent top-level domain name.
It should be noted that the preset detection period may be preset by a manager of the recursive server monitoring device according to actual needs, for example: setting the preset detection period to 1 second, and then generating domain name detection conditions as follows: triggered every second from the beginning of the system operation.
It can be understood that, if the system operation time satisfies the domain name detection condition, it indicates that it is necessary to detect whether the target recursive server is available at the time, and therefore, the domain name to be accessed needs to be acquired from the preset domain name server, and the subsequent steps are executed.
Step S20: and accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server.
It should be noted that the target recursive server may be a recursive server to be monitored, and the target recursive server may be specified by a manager of the recursive server monitoring device. When receiving the domain name to be accessed, the target recursive server performs domain name resolution on the domain name to be accessed, tries to acquire information such as a server IP address corresponding to the domain name to be accessed, and then returns a specific domain name resolution result.
The domain name resolution result can be divided into a first type result, a second type result and a third type result. Wherein, the target recursive server can resolve the domain name normally, and if the corresponding server IP address is not found, a first type result is returned, for example: returning NXDOMAIN; the target recursive server fails to resolve normally or the access times out, a second type of result is returned, for example: returning SERVFAIL or TIMEOUT; the target recursive server may resolve the domain name normally and may find the corresponding server IP address, and a third type of result is returned, such as: and returning the domain name and the server IP address corresponding to the domain name.
It can be understood that, if the domain name to be accessed is a top-level domain name that does not exist, the target recursive server accesses the root domain name server, and obtains a domain name resolution result corresponding to the domain name to be accessed from the root domain name server, and the root domain name server is maintained by an authority and is basically impossible to access, so that whether the target domain name server can be normally accessed can be judged according to the domain name resolution result.
In a specific implementation, in order to improve the monitoring efficiency of the target recursive server, a relatively efficient instruction may be used to access the target recursive server, and the step of accessing the target recursive server according to the domain name to be accessed in this embodiment may include:
acquiring a preset instruction template and acquiring an access address of a target recursive server;
filling the preset instruction template according to the access address and the domain name to be accessed to obtain a domain name access instruction;
and accessing the target recursive server through the domain name access instruction.
It should be noted that the access address of the target recursive server may be the IP address of the target recursive server. The preset instruction template may be an instruction template constructed according to a generation rule of an access instruction of the efficient recursive server, for example: the dig instruction has high efficiency in accessing the recursive server, and at this time, an instruction template can be constructed according to the generation rule of the dig instruction, and the preset instruction template is as follows: "dig @ $ { recursive _ ip } @ $ { tdl _ name }", where @ $ { recursive _ ip } is a placeholder corresponding to an access address of a domain name server to be accessed, and @ $ { tdl _ name } is a placeholder corresponding to a domain name to be accessed.
In actual use, the preset instruction template is filled according to the access address and the domain name to be accessed, and the domain name access instruction is obtained by replacing the placeholder in the preset instruction template according to the access address and the domain name to be accessed. Accessing the target recursive server via the domain name access instruction may be executing the domain name access instruction to access the target recursive server.
Step S30: and generating a domain name resolution log according to the domain name resolution result, and writing the domain name resolution log into a preset log file.
It should be noted that the preset log file may be a file for storing a domain name resolution log. The generating of the domain name resolution log according to the domain name resolution result may be acquiring a generation time corresponding to the domain name resolution result, and then filling the preset log template according to the domain name resolution result and the corresponding generation time, thereby obtaining the domain name resolution log.
For example: assuming that the domain name resolution result is nxdmoin and the corresponding generation time is 2021 year, 11 month, 27 day, 00 hour, 05 minute, 36 seconds, the preset log template may be filled, so as to obtain a domain name resolution log "[ 2021-11-2700: 05:36 status: NXDOMAIN ] ".
In actual use, writing the domain name resolution log into the preset log file may be writing the domain name resolution log into the file end of the preset log file. Of course, the specific writing rule may be adjusted according to actual needs, and this embodiment is not limited thereto.
Step S40: determining an unavailable period of the target recursive server based on the preset log file.
It should be noted that, because the domain name to be accessed is a top-level domain name that does not exist, the target recursive server accesses the root domain name server, and obtains a domain name resolution result corresponding to the domain name to be accessed from the root domain name server, and the root domain name server is maintained by an authority and is basically impossible to access, and whether the target domain name server can be normally accessed can be determined according to the domain name resolution result. Therefore, according to the domain name resolution result corresponding to each domain name resolution log stored in the preset log file, whether the target recursive server is available when the domain name resolution log is generated can be determined, and the state is counted, so that the unavailable time period of the target recursive server can be determined.
For example: assuming that 40 domain name resolution logs exist in the preset log file, wherein the domain name resolution result corresponding to the 1 st to 3 th domain name resolution logs is a first type result, the domain name resolution result corresponding to the 4 th to 10 th domain name resolution logs is a second type result, the domain name resolution result corresponding to the 11 th to 40 th domain name resolution logs is a first type result, it indicates that the target recursive server is available when generating the 1 st to 3 rd domain name resolution logs, the target recursive server is not available when the 4 th to 10 th domain name resolution logs are generated, the target recursive server is available when the 11 th to 40 th domain name resolution logs are generated, then, at this time, the generation time corresponding to the 4 th domain name resolution log is the starting time of the unavailable time period of the target recursive server, and the generation time corresponding to the 11 th domain name resolution log is the ending time of the unavailable time period of the target recursive server.
Further, as can be clearly seen from the above example, when the domain name resolution results corresponding to the consecutive domain name resolution logs are the same type of result, the only log actually determined to have the time period is actually used to determine that the state of the target recursive server changes, that is, the first log in the consecutive domain name resolution logs, and therefore not all domain name resolution logs need to be stored, at this time, the step S30 in this embodiment may include:
reading a previous analysis log from a preset log file;
and if the domain name resolution result is inconsistent with the domain name resolution result in the previous resolution log, generating a domain name resolution log according to the domain name resolution result, and writing the domain name resolution log into a preset log file.
It should be noted that the previous resolution log may be a domain name resolution log currently located at the end of a file in a preset log file.
In actual use, if the domain name resolution result does not match the domain name resolution result in the previous resolution log, this indicates that the state of the target recursive server has changed, for example: from available to unavailable or from unavailable to available. Therefore, at this time, a domain name resolution log may be generated according to the domain name resolution result, and then the domain name resolution log may be written into a preset log file.
It can be understood that only the domain name resolution log which can be used for determining the change of the state of the target recursive server is reserved, the determination of the unavailable time period of the target recursive server is not influenced, the number of logs in the preset log file can be reduced, and the storage space of the device is saved.
In a specific implementation, since the rule of the log storage is changed, correspondingly, the manner of determining the unavailable period of the target recursive server according to the preset log file may also be changed correspondingly, and then the step S40 in this embodiment may include:
reading a domain name resolution log with a corresponding domain name resolution result as a first type result in the preset log file to obtain a first type log;
searching a domain name resolution log with a corresponding domain name resolution result as a second type result from the first type log forward in the preset log file to obtain a second type log corresponding to the first type log;
determining an unavailable time period of the target recursive server according to the first type of log and the second type of log.
It should be noted that, if the domain name resolution result corresponding to the domain name resolution log is the first type result, it indicates that the target recursive server is in an available state when the domain name resolution log is generated; if the domain name resolution result corresponding to the domain name resolution log is the second type result, the target recursive server is in an unavailable state when the domain name resolution log is generated; and when the domain name resolution log is written into the preset log file, writing is carried out in a mode of writing the tail of the file, so that the second type log is searched forward from the first type log in the preset log file, and the specific time period when the state of the target recursive server is unavailable can be determined.
The domain name resolution log with the corresponding domain name resolution result as the second type result is searched forward from the first type log in the preset log file, and the second type log corresponding to the first type log is obtained.
Among these, there are many kinds of results due to the second type, such as: SERVFAIL and TIMEOUT, therefore, a plurality of domain name resolution logs corresponding to the second type result may be found, and at this time, if there are a plurality of domain name resolution logs corresponding to the second type result, the one with the earliest generation time is used as the second type log.
For example: assuming that a search is made from the first-type log B, there are domain name resolution logs C and D between the previous first-type log a, where the domain name resolution result is the second-type result, where C is generated earlier than D, and at this time C is taken as the second-type log corresponding to B.
In practical use, the determining the unavailable period of the target recursive server according to the first type log and the second type log may be to use the generation time corresponding to the second type log as an unavailable start time, use the generation time corresponding to the first type log as an unavailable end time, and use a period between the unavailable start time and the unavailable end time as the unavailable period.
For example: assuming that the generation time of a certain first type log is 2021 year 11 month 27 day 00 hour 08 minute 49 seconds, and the generation time of a first second type log searched forward from the first type log is 2021 year 11 month 27 day 00 hour 05 minute 36 seconds, the unavailable time period of the target recursive server is [ 2021-11-2700: 05:36] - [ 2021-11-2700: 08:49], and the unavailable time period is 3 minutes 13 seconds.
In the embodiment, the domain name to be accessed is acquired from the preset domain name set, and is a nonexistent top-level domain name; accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server; generating a domain name resolution log according to a domain name resolution result, and writing the domain name resolution log into a preset log file; determining an unavailable period of the target recursive server based on a preset log file. The method comprises the steps of accessing a target recursive server by using a nonexistent top-level domain name, determining the current available state of the target recursive server according to a fed-back domain name resolution result, writing domain name resolution logs generated according to the domain name resolution result into a preset log file, and counting the domain name resolution results corresponding to the domain name resolution logs in the preset log file to determine the unavailable time period of the target recursive server.
Referring to fig. 3, fig. 3 is a flowchart illustrating a recursive server monitoring method according to a second embodiment of the present invention.
Based on the first embodiment, after step S20, the recursive server monitoring method in this embodiment further includes:
step S30': and if the domain name resolution result is a third type result, performing existence check on the domain names in the preset domain name set.
It should be noted that, as time advances, some top-level domain names that do not exist originally may be used by some individuals or organizations, at this time, such top-level domain names may be cached by the target recursive server, the target recursive server may no longer need to access the root domain name server, and at this time, it is impossible to determine whether the target recursive server is available according to the domain name resolution result, and therefore, corresponding processing is required to remove such top-level domain names from the preset domain name set.
It can be understood that, if the domain name resolution result is the third type result, it indicates that the domain name to be accessed used at this time is already used by a person or an organization, at this time, the domain name resolution result obtained by using the domain name to be accessed is difficult to be used for determining whether the target recursive server is available, and at this time, it is also not determined whether other top-level domain names used by the person or the organization exist in the preset domain name set, so that the existence check needs to be performed on the domain names in the preset domain name set.
In a specific implementation, in order to ensure reliability of presence check on the domain name, the step of performing presence check on the domain name in the preset domain name set in this embodiment may include:
traversing the preset domain name set, and taking the traversed domain name as a domain name to be checked;
accessing a root domain name server according to the domain name to be verified, and receiving a domain name verification result fed back by the root domain name server;
determining whether the domain name to be checked exists according to the domain name checking result;
if the domain name to be checked exists, judging that the domain name to be checked passes the existence check;
and detecting whether the domain name which is not traversed exists in the preset domain name set, and if the domain name which is not traversed does not exist, finishing the traversal of the preset domain name set.
It can be understood that, since the root domain name server is maintained by the authority, the root domain name server is unlikely to be inaccessible, and therefore, the domain name to be checked can be sent to the root domain name server for resolution and check, and then, whether the domain name to be checked exists or not is determined according to the domain name check result fed back by the root domain name server, and if the domain name to be checked exists, it indicates that the domain name to be checked is already used by some individuals or organizations, that is, the domain name to be checked already exists, and therefore, it can be determined that the domain name to be checked passes the existence check.
It can be understood that, if no domain name that is not traversed exists in the preset domain name set, it indicates that presence verification has been performed on all domain names in the preset domain name set, and then traversal of the preset domain name set may be stopped at this time. If the domain name which is not traversed exists in the preset domain name set, the existence check of the domain name which is not traversed exists in the preset domain name set is indicated, and the preset domain name set can be continuously traversed at the moment.
Step S40': and removing the domain name passing the existence verification from the preset domain name set, and returning to the step of acquiring the domain name to be accessed from the preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name.
It should be noted that, if a domain name passes the existence check, it indicates that the domain name has been used by a person or an organization, that is, the domain name already exists, and the domain name resolution result obtained by accessing the target recursive server according to the domain name cannot be used to determine whether the target recursive server is available, so that the domain name passing the existence check needs to be removed from the preset domain name set, and then the domain name to be accessed is obtained from the preset domain name set again, and the target recursive server is accessed again.
In this embodiment, when the domain name resolution result is the third type result, the presence check is performed on the domain name in the preset domain name set; and removing the domain name passing the existence verification from the preset domain name set, and returning to the step of acquiring the domain name to be accessed from the preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name. Because the domain name resolution result is the third type result, the domain name used for accessing the target recursive server is used by an individual or an organization at the moment, the domain names in the preset domain name set are subjected to existence check at the moment, and the domain names passing the existence check are removed from the preset domain name set, so that the domain names in the preset domain name set are all top-level domain names which do not exist, and the normal operation of the recursive server monitoring method is ensured.
Furthermore, an embodiment of the present invention further provides a storage medium, where the storage medium stores a recursive server monitoring program, and the recursive server monitoring program, when executed by a processor, implements the steps of the recursive server monitoring method described above.
Referring to fig. 4, fig. 4 is a block diagram illustrating a recursive server monitoring apparatus according to a first embodiment of the present invention.
As shown in fig. 4, a recursive server monitoring apparatus according to an embodiment of the present invention includes:
a domain name obtaining module 10, configured to obtain a domain name to be visited from a preset domain name set, where the domain name to be visited is a top-level domain name that does not exist;
the service access module 20 is configured to access a target recursive server according to the domain name to be accessed, and receive a domain name resolution result fed back by the target recursive server;
the log generating module 30 is configured to generate a domain name resolution log according to a domain name resolution result, and write the domain name resolution log into a preset log file;
a time period determining module 40, configured to determine an unavailable time period of the target recursive server based on the preset log file.
In the embodiment, the domain name to be accessed is acquired from the preset domain name set, and is a nonexistent top-level domain name; accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server; generating a domain name resolution log according to a domain name resolution result, and writing the domain name resolution log into a preset log file; determining an unavailable period of the target recursive server based on a preset log file. The method comprises the steps of accessing a target recursive server by using a nonexistent top-level domain name, determining the current available state of the target recursive server according to a fed-back domain name resolution result, writing domain name resolution logs generated according to the domain name resolution result into a preset log file, and counting the domain name resolution results corresponding to the domain name resolution logs in the preset log file to determine the unavailable time period of the target recursive server.
Further, the log generating module 30 is further configured to read a previous analysis log from a preset log file; and if the domain name resolution result is inconsistent with the domain name resolution result in the previous resolution log, generating a domain name resolution log according to the domain name resolution result, and writing the domain name resolution log into a preset log file.
Further, the time interval determining module 40 is further configured to read a domain name resolution log in which a domain name resolution result corresponding to the preset log file is a first type result, and obtain the first type log; searching a domain name resolution log with a corresponding domain name resolution result as a second type result from the first type log forwards in the preset log file to obtain a second type log corresponding to the first type log; determining an unavailable time period of the target recursive server according to the first type of log and the second type of log.
Further, the service access module 20 is further configured to obtain a preset instruction template and obtain an access address of the target recursive server; filling the preset instruction template according to the access address and the domain name to be accessed to obtain a domain name access instruction; and accessing the target recursive server through the domain name access instruction.
Further, the service access module 20 is further configured to perform existence check on the domain name in the preset domain name set if the domain name resolution result is a third type result; and removing the domain name passing the existence verification from the preset domain name set, and returning to the step of acquiring the domain name to be accessed from the preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name.
Further, the service access module 20 is further configured to traverse the preset domain name set, and use the traversed domain name as a domain name to be checked; accessing a root domain name server according to the domain name to be verified, and receiving a domain name verification result fed back by the root domain name server; determining whether the domain name to be checked exists according to the domain name checking result; if the domain name to be checked exists, judging that the domain name to be checked passes the existence check; and detecting whether the domain name which is not traversed exists in the preset domain name set, and if the domain name which is not traversed does not exist, finishing the traversal of the preset domain name set.
Further, the domain name obtaining module 10 is further configured to obtain a preset detection period, and generate a domain name detection condition according to the preset detection period; monitoring the system operation time in real time, and acquiring a domain name to be accessed from a preset domain name set when the system operation time meets the domain name detection condition, wherein the domain name to be accessed is a nonexistent top-level domain name.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the recursive server monitoring method provided in any embodiment of the present invention, and are not described herein again.
Further, it is to 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, method, article, or system 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, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A recursive server monitoring method, comprising:
acquiring a domain name to be accessed from a preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name;
accessing a target recursive server according to the domain name to be accessed, and receiving a domain name resolution result fed back by the target recursive server;
generating a domain name resolution log according to a domain name resolution result, and writing the domain name resolution log into a preset log file;
determining an unavailable period of the target recursive server based on the preset log file.
2. The recursive server monitoring method according to claim 1, wherein the step of generating a domain name resolution log according to the domain name resolution result and writing the domain name resolution log into a preset log file comprises:
reading a previous analysis log from a preset log file;
and if the domain name resolution result is inconsistent with the domain name resolution result in the previous resolution log, generating a domain name resolution log according to the domain name resolution result, and writing the domain name resolution log into a preset log file.
3. The recursive server monitoring method according to claim 2, wherein the step of determining the unavailable period of the target recursive server based on the preset log file comprises:
reading a domain name resolution log with a corresponding domain name resolution result as a first type result in the preset log file to obtain a first type log;
searching a domain name resolution log with a corresponding domain name resolution result as a second type result from the first type log forward in the preset log file to obtain a second type log corresponding to the first type log;
determining an unavailable time period of the target recursive server according to the first type of log and the second type of log.
4. The recursive server monitoring method according to claim 1, wherein the step of accessing the target recursive server according to the domain name to be accessed comprises:
acquiring a preset instruction template and acquiring an access address of a target recursive server;
filling the preset instruction template according to the access address and the domain name to be accessed to obtain a domain name access instruction;
and accessing the target recursive server through the domain name access instruction.
5. The recursive server monitoring method according to claim 1, wherein after the step of accessing the target recursive server according to the domain name to be accessed and receiving the domain name resolution result fed back by the target recursive server, the method further comprises:
if the domain name resolution result is a third type result, performing existence check on the domain name in the preset domain name set;
and removing the domain name passing the existence verification from the preset domain name set, and returning to the step of acquiring the domain name to be accessed from the preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name.
6. The recursive server monitoring method according to claim 5, wherein the step of performing presence check on the domain names in the preset domain name set comprises:
traversing the preset domain name set, and taking the traversed domain name as a domain name to be checked;
accessing a root domain name server according to the domain name to be verified, and receiving a domain name verification result fed back by the root domain name server;
determining whether the domain name to be checked exists according to the domain name checking result;
if the domain name to be checked exists, judging that the domain name to be checked passes the existence check;
and detecting whether the domain name which is not traversed exists in the preset domain name set, and if the domain name which is not traversed does not exist, finishing the traversal of the preset domain name set.
7. The recursive server monitoring method according to any one of claims 1 to 6, wherein the step of obtaining the domain name to be accessed from a preset domain name set, the domain name to be accessed being a non-existent top-level domain name, comprises:
acquiring a preset detection period, and generating a domain name detection condition according to the preset detection period;
monitoring the system operation time in real time, and acquiring a domain name to be accessed from a preset domain name set when the system operation time meets the domain name detection condition, wherein the domain name to be accessed is a nonexistent top-level domain name.
8. A recursive server monitoring apparatus, comprising:
the domain name acquisition module is used for acquiring a domain name to be accessed from a preset domain name set, wherein the domain name to be accessed is a nonexistent top-level domain name;
the service access module is used for accessing a target recursive server according to the domain name to be accessed and receiving a domain name resolution result fed back by the target recursive server;
the log generation module is used for generating a domain name resolution log according to a domain name resolution result and writing the domain name resolution log into a preset log file;
a time period determination module for determining an unavailable time period of the target recursive server based on the preset log file.
9. A recursive server monitoring device, comprising: a processor, a memory, and a recursive server monitoring program stored on the memory and executable on the processor, the recursive server monitoring program when executed by the processor implementing the steps of the recursive server monitoring method according to any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon a recursive server monitoring program that, when executed, performs the steps of the recursive server monitoring method according to any one of claims 1-7.
CN202210376607.4A 2022-04-12 2022-04-12 Recursive server monitoring method, device, equipment and storage medium Active CN114465926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210376607.4A CN114465926B (en) 2022-04-12 2022-04-12 Recursive server monitoring method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210376607.4A CN114465926B (en) 2022-04-12 2022-04-12 Recursive server monitoring method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114465926A true CN114465926A (en) 2022-05-10
CN114465926B CN114465926B (en) 2022-07-01

Family

ID=81417727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210376607.4A Active CN114465926B (en) 2022-04-12 2022-04-12 Recursive server monitoring method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114465926B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115665009A (en) * 2022-12-29 2023-01-31 鹏城实验室 DNS root server state monitoring method and device, electronic equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037314A1 (en) * 2008-08-11 2010-02-11 Perdisci Roberto Method and system for detecting malicious and/or botnet-related domain names
US20100106854A1 (en) * 2008-10-29 2010-04-29 Hostway Corporation System and method for controlling non-existing domain traffic
US20100274970A1 (en) * 2009-04-23 2010-10-28 Opendns, Inc. Robust Domain Name Resolution
CN105391818A (en) * 2015-11-26 2016-03-09 中国互联网络信息中心 Authoritative name emergency resolution system and method based on recursive server
CN106888280A (en) * 2017-03-29 2017-06-23 北京奇虎科技有限公司 DNS update methods, apparatus and system
CN107819895A (en) * 2017-11-16 2018-03-20 哈尔滨工业大学(威海) The analysis method of TLD configuration and safety based on domain resource record
CN108449444A (en) * 2018-03-29 2018-08-24 江苏省未来网络创新研究院 Local data transport method, self-loopa domain name analysis system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037314A1 (en) * 2008-08-11 2010-02-11 Perdisci Roberto Method and system for detecting malicious and/or botnet-related domain names
US20100106854A1 (en) * 2008-10-29 2010-04-29 Hostway Corporation System and method for controlling non-existing domain traffic
US20100274970A1 (en) * 2009-04-23 2010-10-28 Opendns, Inc. Robust Domain Name Resolution
CN105391818A (en) * 2015-11-26 2016-03-09 中国互联网络信息中心 Authoritative name emergency resolution system and method based on recursive server
CN106888280A (en) * 2017-03-29 2017-06-23 北京奇虎科技有限公司 DNS update methods, apparatus and system
CN107819895A (en) * 2017-11-16 2018-03-20 哈尔滨工业大学(威海) The analysis method of TLD configuration and safety based on domain resource record
CN108449444A (en) * 2018-03-29 2018-08-24 江苏省未来网络创新研究院 Local data transport method, self-loopa domain name analysis system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PATRICIA CALLEJO等: "Measuring the Global Recursive DNS Infrastructure: A View From the Edge", 《IEEE ACCESS ( VOLUME: 7)》 *
袁福祥等: "基于历史数据的异常域名检测算法", 《通信学报》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115665009A (en) * 2022-12-29 2023-01-31 鹏城实验室 DNS root server state monitoring method and device, electronic equipment and medium

Also Published As

Publication number Publication date
CN114465926B (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN109241461B (en) User portrait construction method and device
CN113489713B (en) Network attack detection method, device, equipment and storage medium
CN108667855B (en) Network flow abnormity monitoring method and device, electronic equipment and storage medium
CN109582885B (en) Method and device for carrying out block link evidence storage on webpage through webpage monitoring
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
CN111130845B (en) Method and device for testing IPv6 support degree of website page based on visual information
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
CN114465926B (en) Recursive server monitoring method, device, equipment and storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN114006727B (en) Alarm association analysis method, device, equipment and storage medium
CN108650123B (en) Fault information recording method, device, equipment and storage medium
CN112511535A (en) Equipment detection method, device, equipment and storage medium
CN111046382A (en) Database auditing method, device, storage medium and device
CN111241547A (en) Detection method, device and system for unauthorized vulnerability
CN112671615B (en) Method, system and storage medium for collecting front-end user operation behavior data
CN112187708B (en) Automatic supplementing method and equipment for certificate chain of digital certificate
CN112363944A (en) Method and equipment for comparing return values of multiple environment interfaces
CN109740386B (en) Method and device for detecting static resource file
CN110061864B (en) Method and system for automatically verifying domain name configuration
CN112380115A (en) Regression testing method and device, electronic equipment and storage medium
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN111104598A (en) Method and device for directionally pushing information, electronic equipment and readable storage medium
CN110659191B (en) Buried data analysis method, buried data analysis device, computer equipment and storage medium
US20220382666A1 (en) System and method for identifying software behavior

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