CN112671910B - Optimized selection method of DNS forwarding server and storage medium - Google Patents

Optimized selection method of DNS forwarding server and storage medium Download PDF

Info

Publication number
CN112671910B
CN112671910B CN202011560699.9A CN202011560699A CN112671910B CN 112671910 B CN112671910 B CN 112671910B CN 202011560699 A CN202011560699 A CN 202011560699A CN 112671910 B CN112671910 B CN 112671910B
Authority
CN
China
Prior art keywords
server
monitoring period
time
timeout
forwarding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011560699.9A
Other languages
Chinese (zh)
Other versions
CN112671910A (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.)
Shenzhen Wangji Technology Co ltd
Original Assignee
Shenzhen Wangji 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 Shenzhen Wangji Technology Co ltd filed Critical Shenzhen Wangji Technology Co ltd
Priority to CN202011560699.9A priority Critical patent/CN112671910B/en
Publication of CN112671910A publication Critical patent/CN112671910A/en
Application granted granted Critical
Publication of CN112671910B publication Critical patent/CN112671910B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an optimized selection method of a DNS forwarding server, which comprises the following steps: setting a health state monitoring period for each server in a forwarding server list, and dividing the monitoring period into a plurality of small time windows; judging whether the server is abnormal according to response results obtained by a plurality of time windows in the monitoring period to the forwarded user request; and drawing black the server which is judged to be abnormal from the list. The invention judges whether the forwarding server is healthy and available or not through the response performance of the forwarding server, and keeps the healthy server by pulling the abnormal server, thereby improving the overall efficiency of the DNS recursive server for processing the request.

Description

Optimized selection method of DNS forwarding server and storage medium
Technical Field
The invention relates to the technical field of internet domain names, in particular to an optimized selection method of a DNS forwarding server.
Background
The DNS recursive server may choose to use a forwarding policy and use a number of different forwarding destination servers, typically corresponding to different operator networks. For scheduling optimization, multiple forwarding servers may be prioritized, and the highest priority server is used preferentially during operation, and if the highest priority server responds with a timeout, other servers are selected. The priority setting at this time is not necessarily set based on RTT (round trip delay) sorting, and may be derived from other factors such as overall stability and ease of use.
The option not based on RTT ranking presents a risk that the forwarding server with the highest priority may fail to return its DNS response for a variety of reasons. In this case, if it is always waited for its timeout and then tried another forwarding server, the recursive performance is greatly degraded.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide an optimized selection method of a DNS forwarding server, which judges whether the forwarding server is healthy and available or not through response performance of the forwarding server, blackens abnormal servers, reserves healthy servers and further improves the efficiency of processing requests by the servers.
The technical scheme adopted by the invention is as follows:
an optimized selection method for a DNS forwarding server comprises the following steps:
setting a monitoring period for each server in a forwarding server list, and dividing the monitoring period into a plurality of small time windows;
judging whether the server is abnormal according to response results obtained by a plurality of time windows in the monitoring period to the forwarded user request;
the anomalous server is pulled black from the list.
Further, setting the monitoring periods of each forwarding server to be independent from each other, calculating and judging whether each time window in one monitoring period is a response result of overtime, and judging according to the following three conditions:
whether the total timeout time is greater than a preset threshold; whether the number of the overtime time windows is larger than a preset threshold value or not; and judging whether the time window serial number which is finally overtime is later than the set time window serial number, and if the time window serial number which is finally overtime is larger than the preset threshold value and is later than the set time window serial number, judging that the server is abnormal.
Further, when a certain forwarding server is used and a timeout result is obtained for the first time, the starting point of the monitoring period is set as the time point, and the monitoring period is divided into a plurality of time windows equally according to the time point.
Further, when detecting whether the response result is an overtime response result, if the three conditions are not completely met, setting a new starting point of the monitoring period, wherein the starting point is the starting point of the first overtime time window, and updating the time window number and the time span count again.
Further, in a monitoring period, if multiple requests of the user are received, if one of the requests is responded and no timeout response occurs, the server is determined to be normal, and the monitoring period is ended until the next timeout time point to restart the calculation.
Further, in a monitoring period, if multiple requests of a user are received, if no overtime response occurs in the multiple requests, the server is determined to be normal, and the monitoring period is ended until the next time point when the overtime occurs, and the calculation is restarted.
Further, when a request of a user is received, the server is distributed to the corresponding servers in sequence according to the priority order, when the response of the server with the high priority is overtime, the server with the high priority is transferred to the server with the next highest priority for inquiry, and meanwhile, the overtime server is started to time.
Further, the black server is detected at regular time, and if the black server can normally respond, the black server is released and restored to the original forwarding server list.
In addition, if the black server is continuously detected for many times and all overtime responses are carried out, the black server is removed.
The present invention also provides a computer readable storage medium having computer readable program instructions stored thereon for performing a method according to the foregoing.
Compared with the prior art, the optimized selection method of the DNS forwarding server provided by the invention achieves the following technical effects:
1. the monitoring period is set for the forwarding servers, one detection period is subdivided into a plurality of detection time windows, whether a certain forwarding server is healthy and available is evaluated through response performance, and when a certain forwarding server is determined to be abnormal, the server in a forwarding list is ignored (blacked) when a normal forwarding request is processed, so that the time for waiting for the response of the abnormal server is reduced to a certain extent, and the request processing performance of the DNS recursive server is improved.
2. A plurality of judgment conditions are adopted for judging the abnormal forwarding server, the interference of abnormal conditions such as network congestion on the abnormal judgment of the server is eliminated, and the misjudgment rate is reduced.
3. And continuously tracking the servers with the possibility of abnormity, and sliding the starting point of the monitoring period if no black is drawn in one monitoring period until a response which is not overtime is received.
4. And detecting the blacked server at regular time, and removing the blacking of the restored server in time.
Drawings
Fig. 1 is a schematic diagram of an optimized selection method of a DNS forwarding server in an embodiment of the present invention.
Fig. 2 is a schematic diagram of a monitoring period and a time window in an embodiment of the invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the embodiments described are presently preferred modes of carrying out the invention, and that the description is made for the purpose of illustrating the general principles of the invention and not for the purpose of limiting the scope of the invention. The protection scope of the present invention shall be defined by the appended claims, and all other embodiments obtained by those skilled in the art without any inventive work shall fall within the protection scope of the present invention.
The invention aims to provide an optimized selection method of a DNS forwarding server, which is characterized in that a health state is set for each server in a forwarding server list, whether the server is enough healthy and available is evaluated through response performance in the operation process, when a forwarding server is determined to be abnormal, the server in the forwarding list is ignored (blacked) when a normal forwarding request is processed, the optimization on a link and the response when the forwarding is abnormal are considered, and the efficiency of DNS recursive request processing is improved.
Referring to fig. 1, the method specifically includes the following steps:
1. and defining a monitoring time range, setting a monitoring period as T, wherein T of each server is independent, and one monitoring period T is used as a statistical standard for health judgment.
2. In a monitoring period T, dividing the monitoring period T into a plurality of small time windows T according to a user-defined strategy, and taking the small time windows T as statistical minimum particles.
3. When a request is received, the server with the highest priority is given first (assuming that the server is not blacked out), if the server response times out, the server is forwarded to the next highest server, and the time-out server is started to be timed, that is, when the forwarding server is used and the time-out result is obtained for the first time, the starting point of the first period T is set as the time point, and the inside of T can be divided into an integer number of times in turn.
4. And judging the result of the request, if the result is overtime, the total cost consumption needs to be updated. The cost of each time is the time consumed by waiting for the timeout, and the cost is accumulated continuously to form the total timeout time. On the contrary, if the answer is normally obtained, all the statistical counts are cleared, and the statistics are started again from step 3.
In a statistical period T, there may be multiple requests coming or only one request coming, but as long as there is one request forwarded to the corresponding server and there is no response timeout, the server is considered to have no problem, and the statistical period ends until the next timeout point comes and statistics starts again. Of course, when the quality requirement for the server is strict, it may be assumed that there is no problem with the server after receiving a plurality of continuous non-timeout responses. And when a user request is received, forwarding and updating the parameter corresponding to the time window t according to a response result, and when the monitoring period is ended, calculating and judging.
5. In each time window t, if timeout occurs, in addition to recording the time of timeout, another count is updated, that is, the number of time windows in which forwarding timeout occurs is counted, for example, if timeout occurs in all three time windows t, it is recorded as 3 times.
6. In addition, the time span of the timeout exception is counted as another count, which corresponds to the sequence number (sequence number is accumulated from 1) of the time window t in which the timeout currently occurs, for example, the time period of the last timeout may be from the span to t1, or from the span to t4, etc.
7. Each time t has its own associated count, including the number of times and cost of the timeout in that time period.
8. If the total cost (total timeout time) exceeds the set threshold after the end of one monitoring period T, and the number of T times out and the time span described in rule 6 are both greater than the preset threshold, it is determined that the forwarding server is abnormal, and it may be blacked out from the forwarding server list temporarily.
The invention sets three judgment conditions for judging the abnormal server:
condition one, determining cost consumption, i.e., the total time to wait for timeout.
And judging how many T in one T are overtime according to a second condition.
And thirdly, judging whether the time span, namely the last sequence number of the t with overtime is later than a preset sequence number value or not.
The second and third points have the main function of eliminating the influence of other problems such as a network and the like, and only if the overtime positions in the T are relatively average, rather than very concentrated, and a certain amount of overtime exists, the forwarding server is considered to be abnormal, so that the misjudgment rate is reduced.
9. If all three conditions are not met, then it is determined as possible abnormal, and the following process is continued: and sliding the starting point of the T to the first starting point of the overtime T after the starting point of the first T, updating the count including the number of the overtime T and the time span statistics, and monitoring the state of the statistical forwarding server.
10. If the server is blacked out in the rule 8, the forwarding server is detected after a certain time according to a self-defined rule, and if the detection request is responded to indicate that the server is normal, the black-out of the forwarding server can be released. If still failing, continue to keep pulling black state, and detect again after the same detection cycle time. In addition, the method can also be set to detect for a plurality of times continuously, and if the detection fails all the time, the server is determined to be in failure and can be removed.
11. After a forwarding server is blacked out, the server immediately following the priority in the list is used to request, and thus a suboptimal result is obtained.
Further, alternatively, the above-described method can be implemented by a computer program product, i.e., a computer-readable storage medium. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therein for carrying out aspects of the present invention. The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
For convenience of explanation, the present invention will be described in detail with reference to a specific embodiment.
Referring to fig. 2, a DNS recursive server receives a request at a certain time and forwards the request to a server a with the highest priority, and the detection of a response by the server a will be described as an example.
1. If the server A responds to timeout, the DNS recursive server continues to select the server B with the second highest priority according to the priority for forwarding, and starts timing aiming at the start of health detection of the server A, until the timing time is equal to T or normal response is received, and subsequent interpretation and processing are carried out. T is equally divided into n sections, wherein n is 5, T can be 10s, T is divided into T1, T2 \8230, T5 and ti are time points corresponding to the end of time windows, namely T1 is 2s at the end of the first time window, T2 is 4s and T5 is 10s.
2. After the timer is started, the DNS recursive server still receives the request and forwards it to the highest priority server a first. Assuming that a times out again and this time is within the time window between the start of the timing and t1, three pieces of information are recorded: the first is the timeout cost, that is, the timeout allows the DNS recursive server to wait for the time of a response, and each time window records the sum of the timeout costs in the current time window (each time window may have multiple times of timeout); secondly, a timeout time window is used for recording that t1 is overtime; third is the time window in which there was a timeout last, this time t1.
3. If T is not reached at the time and the DNS recursive server forwards to server A and receives a normal response, the health detection for server A is ended until the next timeout and then restarts.
4. If the DNS recursive server receives 1 request in each time window of T1-T2, T2-T3, T3-T4 and T4-T5, the server A is overtime each time, and if the server A is overtime, as shown by the delta in the time window of overtime in figure 2, the timing time reaches T, and statistics and judgment are carried out. (1) timeout cost: the sum of the cost of timeout for each time window. (2) number of timeout windows: each time window has a timeout, i.e. a number of 5. (3) last timeout window: t5. And judging the three parameters through a set threshold, and if the three parameters meet the conditions, for example, if the judgment condition of black pulling is set to be that the overtime cost is more than 1s, the overtime time windows are more than 3, and finally the overtime time windows are later than t3, black pulling is carried out. If the condition is not met, the health detection window is slid, that is, t1 is the left end of the time window, because the first timeout occurs in t1-t2 after the start of timing (the sliding window is needed, the timeout before t1 is not calculated), the right end of the time window is a time point after t5, and at the same time, t1' = t2, t2' = t3, t3' = t4, t4' = t5 are now added, and t5' is added. At the moment, T1'-T4' have previous counting, and the overtime condition of the server A in the last time window only needs to be monitored, and the judgment is carried out again after the timing reaches T. If no timeout occurs between t1-t2, the point t2 (i.e. t 1') in the figure is slid to be the starting point, i.e. the starting point of the first newly occurring time window with timeout (t 1 is not counted).
5. And (4) for the server which is blacked out, the forwarding is not carried out any more, the detection is continuously carried out, and if the detection returns a normal response, the blacking is cancelled.
The foregoing description shows and describes several preferred embodiments of the invention, but as aforementioned, it is to be understood that the invention is not limited to the forms disclosed herein, but is not to be construed as excluding other embodiments and is capable of use in various other combinations, modifications, and environments and is capable of changes within the scope of the inventive concept as expressed herein, commensurate with the above teachings, or the skill or knowledge of the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. An optimized selection method for a DNS forwarding server is characterized by comprising the following steps:
setting a health state monitoring period for each server in a forwarding server list, and dividing the monitoring period into a plurality of small time windows; wherein, the monitoring period of each forwarding server is independent;
judging whether the server is abnormal or not according to response results obtained by a plurality of time windows in the monitoring period to the forwarded user requests;
blacking the abnormal server from the list;
wherein, the determining whether the server is abnormal according to the response result obtained by the plurality of time windows in the monitoring period to the forwarded user request includes:
calculating and judging whether each time window in a monitoring period is a response result of overtime or not, and judging according to the following three conditions:
whether the total timeout time is greater than a preset threshold; whether the number of the overtime time windows is larger than a preset threshold value or not; whether the span value of the overtime time window is larger than a preset threshold value or not;
and if the values are all larger than the preset threshold value, determining that the server is abnormal.
2. A method according to claim 1, characterized in that when a certain forwarding server is used and a timeout result is obtained for the first time, the starting point of the monitoring period is set to the time point, and the monitoring period is divided equally into several time windows.
3. The method of claim 2, wherein in detecting whether the response result is a timeout response result, if the three conditions are not completely met, setting a new starting point of the monitoring period, the starting point being the starting point of the first time window in which the timeout occurs, and updating the time window number and the time span count again.
4. The method of claim 2, wherein in a monitoring period, if a plurality of requests from the user are received, if one of the requests is responded and no timeout response occurs, the server is determined to be normal, and the monitoring period is ended until the next timeout point and the calculation is restarted.
5. The method of claim 2, wherein in a monitoring period, if a plurality of requests from the user are received, if no timeout response occurs in any of the plurality of requests, the server is determined to be normal, and the monitoring period is ended until the next timeout point and the calculation is restarted.
6. The method according to claim 1, characterized in that, when receiving the request of the user, the server is assigned to the corresponding server according to the priority order, when the server with high priority responds overtime, the server with high priority is sent to the next highest server to inquire, and the overtime server is started to time.
7. The method of claim 1, wherein the blackened server is periodically probed, and if the blackened server can normally respond, the blackened server is released and restored to the original forwarding server list.
8. A computer readable storage medium having computer readable program instructions stored thereon for performing the method of any of claims 1-7.
CN202011560699.9A 2020-12-25 2020-12-25 Optimized selection method of DNS forwarding server and storage medium Active CN112671910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011560699.9A CN112671910B (en) 2020-12-25 2020-12-25 Optimized selection method of DNS forwarding server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011560699.9A CN112671910B (en) 2020-12-25 2020-12-25 Optimized selection method of DNS forwarding server and storage medium

Publications (2)

Publication Number Publication Date
CN112671910A CN112671910A (en) 2021-04-16
CN112671910B true CN112671910B (en) 2023-03-24

Family

ID=75408929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011560699.9A Active CN112671910B (en) 2020-12-25 2020-12-25 Optimized selection method of DNS forwarding server and storage medium

Country Status (1)

Country Link
CN (1) CN112671910B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841577A (en) * 2010-06-07 2010-09-22 中兴通讯股份有限公司 Method and device for implementing domain name resolution agent function
CN107888716A (en) * 2017-12-05 2018-04-06 广东欧珀移动通信有限公司 A kind of sort method of domain name resolution server, terminal device and storage medium
CN110445641A (en) * 2019-07-11 2019-11-12 烽火通信科技股份有限公司 The main/standby switching method and system of dns-proxy server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150319097A1 (en) * 2014-04-30 2015-11-05 Bluecat Networks, Inc. Methods and systems for prioritizing nameservers

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841577A (en) * 2010-06-07 2010-09-22 中兴通讯股份有限公司 Method and device for implementing domain name resolution agent function
CN107888716A (en) * 2017-12-05 2018-04-06 广东欧珀移动通信有限公司 A kind of sort method of domain name resolution server, terminal device and storage medium
CN110445641A (en) * 2019-07-11 2019-11-12 烽火通信科技股份有限公司 The main/standby switching method and system of dns-proxy server

Also Published As

Publication number Publication date
CN112671910A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN106230997B (en) Resource scheduling method and device
JP4924503B2 (en) Congestion detection method, congestion detection apparatus, and congestion detection program
JP4826831B2 (en) Fault detection device, fault detection method and program thereof
EP2600542B1 (en) Process method and apparatus for preventing alarm jitter
US20180005127A1 (en) Predicting problem events from machine data
CN111104239A (en) Hard disk fault processing method, system and device for distributed storage cluster
CN105871661B (en) Public network server detection method and detecting server
CN112738238A (en) Method, device and system for health check in load balancing
CN112118329A (en) Network request processing method and device, electronic equipment and storage medium
CN113518057A (en) Detection method and device for distributed denial of service attack and computer equipment thereof
CN112671910B (en) Optimized selection method of DNS forwarding server and storage medium
CN112543141B (en) DNS forwarding server disaster tolerance scheduling method and system
US20030187972A1 (en) Method and system for dynamically adjusting performance measurements according to provided service level
CN110633161B (en) Broadcast processing method and device
CN112583659A (en) Method and device for detecting network state of video network, terminal equipment and storage medium
CN109617905B (en) Multicast attack processing method, device and implementation device
US20130227135A1 (en) Monitoring resource congestion in a network processor
CN115174358B (en) Monitoring processing method, system, equipment and storage medium for storage cluster interface
CN114422407B (en) Network testing method, system, terminal and storage medium
CN114143263B (en) Method, equipment and medium for limiting current of user request
CN102595484B (en) Method and user equipment for processing minimization of drive test (MDT)
CN110830284A (en) SDN network-based service fault monitoring method and device
JP5221594B2 (en) Network monitoring apparatus, network monitoring method, and network monitoring program
US11734086B2 (en) Operation-based event suppression
CN113904845A (en) Attack traffic statistical method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230221

Address after: 518001 710 Ludan building, No. 1011 Binhe Road, Ludan village community, Guiyuan street, Luohu District, Shenzhen, Guangdong Province

Applicant after: Shenzhen Wangji Technology Co.,Ltd.

Address before: Room 322, building 1, yard 3, Xingke south 2nd Street, Yanqi Economic Development Zone, Huairou District, Beijing

Applicant before: INTERNET DOMAIN NAME SYSTEM BEIJING ENGINEERING RESEARCH CENTER

GR01 Patent grant
GR01 Patent grant