CN103780714B - The detection method of a kind of dns server and device - Google Patents
The detection method of a kind of dns server and device Download PDFInfo
- Publication number
- CN103780714B CN103780714B CN201210414759.5A CN201210414759A CN103780714B CN 103780714 B CN103780714 B CN 103780714B CN 201210414759 A CN201210414759 A CN 201210414759A CN 103780714 B CN103780714 B CN 103780714B
- Authority
- CN
- China
- Prior art keywords
- address
- server
- ttl
- url
- mapping relations
- 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
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses detection method and the device of a kind of dns server, in order to solve the problem that in prior art, user can not normally access the resource of website.The method is for the mapping relations of the website domain name preserved in dns server in net with IP address, before the TTL that these mapping relations are corresponding expires, the server that this IP address is corresponding is detected, if the server detecting this IP address corresponding is normal, then update the TTL that these mapping relations are corresponding, and TTL in the updated expires and continues detection before, otherwise in instruction net, dns server deletes this mapping relations.Pass through said method, if mapping relations are when the TTL of its correspondence is not yet due, the server that IP address is corresponding accordingly is not provided that service, then in net, dns server can delete this mapping relations in time, thus the dns server inquiry IP address to the website that user accesses, and return to user, make user still can normally access website.
Description
Technical field
The present invention relates to the communications field, particularly relate to detection method and the device of a kind of dns server.
Background technology
Along with the Internet and the development of full-service, each macroreticular operation commercial city is at positive introducing internet data
Center (Internet Data Center, IDC) resource, as shown in Figure 1.
Fig. 1 is that the networking structure of the network A and network B that introduce IDC resource respectively in prior art shows
Being intended to, in FIG, network A and network B all introduce the IDC resource of website X, therefore, website
X server 1 is direct-connected with network A, and website X server 2 is direct-connected with network B, that is, website X clothes
IDC resource in business device 1 is exactly the IDC resource of operator's introducing of network A, website X server 2
In IDC resource be exactly network B operator introduce IDC resource.
In FIG, user a is the user of network A, in order to make this user a only by its affiliated network
A just can have access to the resource of website X, and a kind of domain name analytic method that prior art uses is: at network
A arranges front end domain name system (Domain Name System, DNS) server and rear end DNS clothes
Business device, and make user a directly access website X server 1 by network A by method as shown in Figure 2.
Fig. 2 is the process of the resource that user a accesses website X by its affiliated network A in prior art,
Specifically include following steps:
S201: when user a accesses website X, forward end dns server sending domain name analysis is asked.
That is, user a needs to obtain the network interconnection agreement (Internet corresponding to domain name of website X
Protocol, IP) address, the resource of website X could be accessed.
S202: front end dns server carries out this territory parsing and caching resolves, it would be desirable to the website X of parsing
Domain name be sent to rear end dns server.
S203: rear end dns server inquires about the territory of this website X in the dns server of this website X
All IP addresses that name is corresponding.
Wherein, the dns server of website X does not shows that in FIG, the DNS service of this website X
All IP addresses corresponding for the domain name of website X can all be returned to rear end dns server, after returning to by device
The IP address of end dns server includes the IP address of website X server 1, website X server 2
IP address.
S204: rear end dns server, in each IP address found, filters out and belongs to this network A
The IP address of IP address field.
Owing to website X server 2 is the IDC resource that network B introduces, therefore website X server 2
IP address is also not belonging to the IP address field of network A, and the IP address that rear end dns server filters out is only
The IP address of website X server 1.
The IP address filtered out is returned to by S205: rear end dns server by front end dns server
User a.
S206: user a access website, the IP address X server 1 returned according to front end dns server.
During from Figure 2 it can be seen that network A carries out domain name mapping in prior art, the IP address parsed is complete
Depend on the IP address that the dns server dns server to the back-end of website X returns, if website X
The IP address that resolves of dns server inaccurate, dns server to the back-end in above-mentioned steps S203
The IP address returned does not exists the IP address of the IP address field belonging to network A, follow-up step S204
In, rear end dns server also cannot filter out the IP address of the IP address field belonging to this network A,
Even if causing network A to introduce the IDC resource of website X, user a still can not pass through its affiliated network
A directly has access to this resource.
For these reasons, the second domain name analytic method used in prior art is: do not differentiate between front end
Dns server and rear end dns server, directly set up a web site in the dns server of network A X
The mapping relations of IP address of domain name and website X server 1, when user a accesses website X, to
The dns server sending domain name analysis request of network A, the dns server of network A then direct basis
These mapping relations, return to user a by the IP address of website X server 1, make user a directly pass through net
Network A accesses website X server 1.
Concrete, use above-mentioned second method directly to set up a web site in the dns server of network A X
The mapping relations of IP address of domain name and website X server 1 time, these mapping relations correspond to one and deposit
Live time (Time To Live, TTL).
When TTL is not yet due, these mapping relations remain stored in the dns server of network A.Now,
If user a accesses website X, the domain name mapping that the dns server of network A can send according to user a
Request, directly returns to user a by the IP address of website X server 1 corresponding for the domain name of website X.
When TTL expires, the dns server of network A then deletes these mapping relations.Now, if user
A accesses website X, and the dns server of network A fails to find the IP address that the domain name of website X is corresponding,
Therefore the IP address that the domain name of query web X is corresponding in the dns server of website X, and will inquiry
To IP address return to user a.
So, when the TTL that these mapping relations are corresponding is not yet due, if website X server 1 occurs different
Often, it is impossible to provide service, then the dns server of network A still can return website X service to user a
The IP address of device 1, may result in user a and can not normally access the resource of website X.
Summary of the invention
The embodiment of the present invention provides detection method and the device of a kind of dns server, in order to solve existing skill
The TTL that in art, in net, in dns server, the website domain name of preservation is corresponding with the mapping relations of IP address does not arrives
When server corresponding to phase and this IP address occurs abnormal, user can not normally access the resource of website
Problem.
The embodiment of the present invention provides the detection method of a kind of dns server, including:
Mapping for the website domain name preserved in dns server in net with network interconnection Protocol IP address is closed
System, determines the time-to-live TTL that presently described mapping relations are corresponding;
Before described TTL expires, the server detecting described IP address corresponding is the most normal;
The most then update the TTL that described in dns server, mapping relations are corresponding in described net, and more
Before TTL after Xin expires, the server continuing to detect described IP address corresponding is the most normal;
Otherwise, in indicating described net, dns server deletes described mapping relations.
The embodiment of the present invention provides the detection device of a kind of dns server, including:
Determine module, for for the website domain name preserved in dns server in net and network interconnection agreement
The mapping relations of IP address, determine the time-to-live TTL that presently described mapping relations are corresponding;
Detecting module, for before described TTL expires, the server detecting described IP address corresponding is
No normally;
More new module, is just detecting server corresponding to described IP address for determining at described detecting module
Chang Shi, updates the TTL that described in dns server, mapping relations are corresponding in described net, and indicates described spy
Before survey module TTL in the updated expires, continue the most just detecting server corresponding to described IP address
Often;
Removing module, detects server corresponding to described IP address not for determining at described detecting module
Time normal, in indicating described net, dns server deletes described mapping relations.
The embodiment of the present invention provides detection method and the device of a kind of dns server, and the method is in net
The website domain name preserved in dns server and the mapping relations of IP address, at the TTL that these mapping relations are corresponding
Before expiring, the server that this IP address is corresponding is detected, if detecting the clothes that this IP address is corresponding
Business device is normal, then update the TTL that these mapping relations are corresponding, and TTL in the updated expires and continues before
Detection, otherwise in instruction net, dns server deletes this mapping relations.By said method, if mapped
Close tie up to the TTL of its correspondence not yet due time, server corresponding to corresponding IP address is not provided that service, then
In net, dns server can delete this mapping relations in time, thus the DNS to the website that user accesses takes
Business device inquiry IP address, and return to user, make user still can normally access website.
Accompanying drawing explanation
Fig. 1 is that the networking structure of the network A and network B that introduce IDC resource respectively in prior art shows
It is intended to;
Fig. 2 is the process of the resource that user a accesses website X by its affiliated network A in prior art;
The detection process of the dns server that Fig. 3 provides for the embodiment of the present invention;
The detection apparatus structure schematic diagram of the dns server that Fig. 4 provides for the embodiment of the present invention.
Detailed description of the invention
The embodiment of the present invention provides detection method and the device of a kind of dns server, and the method is in net
The website domain name preserved in dns server and the mapping relations of IP address, at the TTL that these mapping relations are corresponding
Before expiring, the server that this IP address is corresponding is detected, if detecting the clothes that this IP address is corresponding
Business device is normal, then update the TTL that these mapping relations are corresponding, and TTL in the updated expires and continues before
Detection, otherwise in instruction net, dns server deletes this mapping relations.By said method, if mapped
Close tie up to the TTL of its correspondence not yet due time, server corresponding to corresponding IP address is not provided that service, then
In net, dns server can delete this mapping relations in time, thus the DNS to the website that user accesses takes
Business device inquiry IP address, and return to user, make user still can normally access website.
Below in conjunction with Figure of description, the embodiment of the present invention is described in detail.
The detection process of the dns server that Fig. 3 provides for the embodiment of the present invention, specifically includes following steps:
S301: for the mapping relations of the website domain name preserved in dns server in net with IP address, really
The TTL that before settled, these mapping relations are corresponding.
Such as, network A introduces the IDC resource of website X, and network A is direct-connected with website X server 1,
In net described in step S301, dns server is the dns server of network A.Assume website X
Domain name be www.X.com, the IP address of website X server 1 is 1.1.1.1, then this network A
Dns server saves the mapping relations of www.X.com Yu 1.1.1.1, and saves this mapping relations
Corresponding TTL.Detection device is first against the www.X.com preserved in the dns server of network A
With the mapping relations of 1.1.1.1, determine the TTL that these mapping relations are corresponding.
In embodiments of the present invention, the website domain name preserved in dns server in net and the mapping of IP address
Relation can be that this detection device is pre-written in the interior dns server of net, concrete, detects device
Determine this website domain the first URL (Uniform Resource Locator, URL) under one's name,
According to the IP address that this website domain name pre-saved is corresponding, based on a determination that a URL, to this IP
The server transmission probe requests thereby that address is corresponding, when receiving server corresponding to this IP address for this spy
During the probe response that the request of survey returns, by this website domain name, this IP address, and TTL set in advance
Being sent to net interior dns server, in instruction net, dns server sets up this website domain name and this IP address
Mapping relations and preserve, and using TTL set in advance as TTL corresponding to these mapping relations.
Continue to adopt example, due to when the IDC resource of website X is incorporated in network A, this website
The IP address of the website X server 1 direct-connected with this network A that the domain name (www.X.com) of X is corresponding
(1.1.1.1) it is known, therefore, it can the domain name of preset this website X in detection device
(www.X.com) with the corresponding relation of the IP address (1.1.1.1) of this website X server 1.
It addition, after introducing the IDC resource of website X, can be in advance by this website X's in detection device
The URL of several resources in IDC resource is saved in detection device, such as the IDC resource of this website X
In the URL of some Text Link, or the URL of some image link, these URL addresses are all this nets
Stand the URL under the domain name of X.
Thus, detection device determines a URL under the domain name of this website X, as a URL, and
According to the corresponding relation of www.X.com Yu 1.1.1.1 pre-saved, based on a determination that a URL,
Probe requests thereby is sent to the server (website X server 1) that IP address is 1.1.1.1, that is, to IP
Address is that the server request of 1.1.1.1 obtains a resource corresponding for URL.
If receiving the probe response that website X server 1 returns for this probe requests thereby, then detect device
By the domain name (www.X.com) of website X, the IP address (1.1.1.1) of website X server 1, and
The TTL preset is sent to the dns server of network A, and the dns server of network A is then set up
The mapping relations of www.X.com with 1.1.1.1 also preserve, and using this TTL preset of receiving as this
The TTL that mapping relations are corresponding.
S302: before this TTL expires, detects server corresponding to this IP address the most normal, if so,
Then perform step S303, otherwise perform step S304.
In embodiments of the present invention, the most normal side of the server that this IP address of detection is corresponding
Method comprises determining that this website domain the 2nd URL under one's name, based on a determination that the 2nd URL, periodically
The server corresponding to this IP address repeatedly sends probe requests thereby, for the server corresponding to this IP address
The each probe requests thereby sent, returns for this probe requests thereby if receiving server corresponding to this IP address
The probe response returned, it is determined that server corresponding to this IP address is in service state, if not receiving this
The probe response that server corresponding to IP address returns for this probe requests thereby, it is determined that this IP address is corresponding
Server be in non-serving state;When determining that server corresponding to this IP address is in non-clothes for continuous K time
During business state, determine that the server detecting this IP address corresponding is abnormal, otherwise, it determines detect this
Server corresponding to IP address is normal, and K is for setting quantity.Wherein, K can be set as required.
Continuing to use the example above, detection device determines a URL under the domain name of this website X, as second
URL, the 2nd URL specifically can be identical with an above-mentioned URL, it is also possible to an above-mentioned URL
Different.Detection device is based on the 2nd URL, periodically to the server (net that IP address is 1.1.1.1
Stand X server 1) send probe requests thereby, that is, detection device is periodically to website X server 1
Acquisition request the 2nd resource corresponding for URL.
For the probe requests thereby sent every time, if detection device receives website X server 1 for this spy
The probe response that the request of survey returns, it is determined that website X server 1 is in service state, if do not received
The probe response returned for this probe requests thereby, it is determined that website X server 1 is in non-serving state.
Assume that K is set to 5, then determine that website X server 1 is in non-serving continuous 5 times when detection device
During state, determine that to detect website X server 1 abnormal, otherwise, it determines detect website X service
Device 1 is normal.
S303: update the TTL that in the interior dns server of net, these mapping relations are corresponding, and return step S302.
In embodiments of the present invention, if detection device determines just is detecting server corresponding to this IP address
Often, then default TTL being sent to net interior dns server again, in instruction net, dns server will
The TTL of these mapping relations current is updated to this TTL received, that is, be equivalent to extend this mapping
The TTL that relation is corresponding.Detection device have updated in the interior dns server of net after the TTL of these mapping relations,
Then return step S302, that is, before detection device TTL in the updated expires, continue to detect this IP
Server corresponding to address is the most normal, and carries out corresponding operating according to result of detection.
S304: in instruction net, dns server deletes this mapping relations.
In embodiments of the present invention, if detection device determines detects server corresponding to this IP address not
Normally, it indicates that in net, dns server deletes this mapping relations.
Continuing to use the example above, if detection device uses said method, to detect website X server 1 abnormal,
The dns server then indicating network A deletes the mapping relations of www.X.com Yu 1.1.1.1, thus,
If the user of follow-up network A accesses website X, then the dns server of network A can be owing to having deleted
The mapping relations of www.X.com Yu 1.1.1.1 and can not find domain name www.X.com of this website X
Corresponding IP address, therefore can only interact with the dns server of this website X, at this website X
Dns server in inquire about the IP address that domain name www.X.com of this website X is corresponding, and will inquiry
To IP address return to user, make access website, the IP address X that user passes through to inquire.Certainly, this
Time the resource of website X that accesses of this user be not to be provided by website X server 1 yet, but by
The server of other IP addresses of this website X is provided.
By said method, when domain name www.X.com and the IP ground of website X server 1 of website X
When TTL corresponding to the mapping relations of location 1.1.1.1 is not yet due, if there is exception in website X server 1,
Server can not be normally provided, then the dns server of network A can delete timely www.X.com with
1.1.1.1 mapping relations, from exception occurred without making the user of subsequent access website X still access
Website X server 1, and can be conducted interviews by other paths, therefore user still can visit normally
Ask website X.
Further, in step S302 shown in above-mentioned Fig. 2, detection device based on a determination that the 2nd URL,
When the server the most corresponding to this IP address sends probe requests thereby, transmission ping detection can be used
The mode of request, it would however also be possible to employ send the mode of GET request, it is also possible to use and send Hyper text transfer
The mode that the head (HEAD) of agreement (Hypertext Transport Protocol, HTTP) is asked.
Wherein, during owing to using ping detection mode, can only detect from detection device to this IP address pair
The server answered route Internet up to, the server that this IP address is corresponding can not be detected
Exception self whether occur, when using the mode of GET request, server corresponding to this IP address can be by the
Resource corresponding for two URL returns to detect device, and the bandwidth taken is relatively big, it is therefore advantageous to, this
Bright embodiment detects device and uses the HEAD request method of HTTP, periodically to this IP address pair
The server answered sends probe requests thereby.When the server that this IP address is corresponding receives detection device with HTTP
HEAD request method send probe requests thereby time, the resource that the 2nd is corresponding for URL can't be returned to
Detection device, but return a probe response for this probe requests thereby to detection device, therefore use HTTP
HEAD request method time the server that this IP address is corresponding is detected, be possible not only to detect this
Whether server self corresponding to IP address there is exception, it is also possible to save bandwidth resources.
Further, since in embodiments of the present invention, detection device needs in this website domain name and this IP address
The TTL corresponding to mapping relations expire whether normal detect server corresponding to this IP address before,
And by these mapping relations write net during dns server, TTL corresponding to these mapping relations is also in this spy
Survey device is set in advance, therefore, in order to ensure before the TTL that these mapping relations are corresponding expires, visits
Survey device and can detect server corresponding to this IP address the most normally, can preset in detection device
Detection cycle T and detection times N, and make detection cycle T be less than this in advance with the product of detection times N
The TTL set.Then detection device sends probe requests thereby at the server the most corresponding to this IP address
Time, specifically can be according to default detection cycle and detection times, when this detection cycle arrives, to
The server transmission probe requests thereby that this IP address is corresponding, until the number of times sending probe requests thereby reaches this detection
Till number of times, wherein, this detection cycle is corresponding less than these mapping relations current with the product of this detection times
TTL。
Follow-up, if detection device is during have sent n times probe requests thereby, determine continuous K time
(K is not more than N) is detected server corresponding to this IP address and is in non-serving state, it indicates that in net
Dns server deletes the mapping relations of this website domain name and this IP address, otherwise, based on set in advance
TTL, updates the TTL that in the interior dns server of net, these described mapping relations are corresponding, and at this TTL updated
Before expiring, the server continuing to detect described IP address corresponding is the most normal.
Further, it is contemplated that in detection device and net, the information between dns server is mutual and processes also
Take some time, therefore, in order to be further ensured that when detecting the server that this IP address is corresponding
Time normal, the interior dns server of net also is able to update this before the TTL that these mapping relations are corresponding expires and reflects
The TTL that relation of penetrating is corresponding, it is also possible to preset a time span, this time span preset is exactly for detection
In device and net, the information between dns server is mutual and processes reserved time span, and makes detection week
It is corresponding that phase T is multiplied by the product of detection times N and the time span that this is preset and value is less than these mapping relations
TTL, this way it is secured that after device have sent n times probe requests thereby in detection, determine this IP
When server corresponding to address is normal, detection device can be before the TTL that these mapping relations are corresponding expires
Update the TTL that in the interior dns server of net, these described mapping relations are corresponding.
In embodiments of the present invention, it is contemplated that in actual applications, for the server of a website,
The URL of a resource in this server is it may happen that change, therefore, in order to improve the accurate of detection
Property, when not determining continuously that server corresponding to this IP address is in non-serving state for K time, it is also predefined
This website domain the 3rd URL(under one's name and above-mentioned 2nd the 3rd different for URL URL), based on a determination that
3rd URL, the server corresponding to this IP address sends probe requests thereby, and judges whether to receive this
The probe response that server corresponding to IP address returns for this probe requests thereby, if, it is determined that detect this
Server corresponding to IP address is normal, otherwise, it determines the server detecting this IP address corresponding is abnormal.
That is, after the server periodically corresponding to this IP address based on the 2nd URL sends probe requests thereby,
If not determining continuously that server corresponding to this IP address is in non-serving state for K time, it is determined that this website
From above-mentioned 2nd the 3rd different for URL URL under domain name, and based on the 3rd URL to this IP address pair
The server answered sends probe requests thereby, please for this detection if receiving server corresponding to this IP address
Ask the probe response of return, then update the TTL(that in the interior dns server of net, these mapping relations are corresponding and determine
Server corresponding to this IP address is normal), otherwise can directly indicate dns server in net to delete this and reflect
Penetrate relation (determining that server corresponding to this IP address is abnormal).
Further, after have updated the TTL that in net, in dns server, these mapping relations are corresponding, visit
Before survey device TTL in the updated expires, the server continuing to detect this IP address corresponding is the most normal
Time, it may be determined that this website domain the 4th URL under one's name, and based on a determination that the 4th URL, in employing
The server stating this IP address of detection method continuation detection corresponding is the most normal.Wherein, the 4th URL is
It is different from the 4th URL of above-mentioned 2nd URL, but the 4th URL can be identical with the 3rd URL.
The detection method of the above-mentioned dns server that the embodiment of the present invention provides, can apply to a website
The scene of the IP address of the corresponding server of domain name, it is also possible to be applied to a website domain name correspondence multiple
The scene of the IP address of server.For example, it is assumed that the domain name correspondence IP address of website X is respectively 1.1.1.1
With two servers of 1.1.1.2, then dns server saves in net the domain name of two and this website X
Relevant mapping relations, one is the domain name mapping relations with 1.1.1.1 of website X, and another is website
The domain name of X and the mapping relations of 1.1.1.2.Now, detection device can be respectively directed to the two mapping relations,
Use said method that two servers of IP address respectively 1.1.1.1 and 1.1.1.2 are detected respectively,
Repeat the most one by one.
It addition, in embodiments of the present invention, for the website domain name preserved in dns server in net and IP
The mapping relations of address, when detection to the server that this IP address is corresponding is normal, namely net
When interior dns server does not deletes these mapping relations, if user accesses the website that this website domain name is corresponding,
Net in dns server except IP address corresponding for this website domain name currently preserved is returned to user it
Outward, it is also possible to the method using prior art, look in the dns server of user website to be accessed
Ask the IP address that this website domain name is corresponding, and the IP address inquired is also returned to user, to improve use
Family, when accessing this website, selects the motility of access path.Concrete, in net dns server to
When user returns to IP address corresponding to this website domain name, dns server in this net currently can be preserved
IP address sort corresponding to this website domain name front, the IP that will inquire from the dns server of this website
Address sort is rear, and returns to user, makes user priority be conducted interviews by its affiliated network.
It is above the detection method of the dns server that the embodiment of the present invention provides, thinks based on same invention
Road, the embodiment of the present invention also provides for the detection device of a kind of dns server, as shown in Figure 4.
The detection apparatus structure schematic diagram of the dns server that Fig. 4 provides for the embodiment of the present invention, specifically wraps
Include:
Determine module 401, for assisting with the network interconnection for the website domain name preserved in dns server in net
The mapping relations of view IP address, determine the time-to-live TTL that presently described mapping relations are corresponding;
Detecting module 402, for before described TTL expires, detects the service that described IP address is corresponding
Device is the most normal;
More new module 403, detects, for determining at described detecting module 402, the clothes that described IP address is corresponding
When business device is normal, updates the TTL that described in dns server, mapping relations are corresponding in described net, and indicate
Before described detecting module 402 TTL in the updated expires, continue to detect the clothes that described IP address is corresponding
Business device is the most normal;
Removing module 404, detects, for determining at described detecting module 402, the clothes that described IP address is corresponding
When business device is abnormal, in indicating described net, dns server deletes described mapping relations.
Described device also includes:
Writing module 405, for determining described website domain the first uniform resource position mark URL under one's name, root
According to the IP address that the described website domain name pre-saved is corresponding, based on a determination that a described URL, to institute
State server corresponding to IP address and send probe requests thereby, when receiving the server pin that described IP address is corresponding
During the probe response that this probe requests thereby is returned, by described website domain name, IP address and set in advance
TTL is sent to dns server in described net, and in indicating described net, dns server sets up described website domain
Name and the mapping relations of described IP address also preserve, and using described TTL set in advance as described mapping
The TTL that relation is corresponding.
Described detecting module 402 specifically for, determine described website domain the second URL under one's name
URL;Based on a determination that described 2nd URL, periodically corresponding to described IP address server sends
Probe requests thereby;The each probe requests thereby sent for the server corresponding to described IP address, if received
The probe response returned for this probe requests thereby to the server that described IP address is corresponding, it is determined that described IP
Server corresponding to address is in service state, if do not receive server corresponding to described IP address for
The probe response that this probe requests thereby returns, it is determined that server corresponding to described IP address is in non-server
State;When determining that server corresponding to described IP address is in non-serving state for continuous K time, determine spy
The server measuring described IP address corresponding is abnormal, otherwise, it determines it is corresponding to detect described IP address
Server is normal, and wherein, K is for setting quantity.
Described detecting module 402 specifically for, use HTML (Hypertext Markup Language) HTTP head HEAD request
Mode, periodically corresponding to described IP address server sends probe requests thereby.
Described detecting module 402 specifically for, according to default detection cycle and detection times, when described
When the detection cycle arrives, the server corresponding to described IP address sends probe requests thereby, until sending detection
Till the number of times of request reaches described detection times, wherein, the described detection cycle takes advantage of with described detection times
The long-pending TTL corresponding less than presently described mapping relations.
Described detecting module 402 is additionally operable to, when not determining the server that described IP address is corresponding for K time continuously
When being in non-serving state, determine described website domain the 3rd URL under one's name;Based on a determination that the described 3rd
URL, the server corresponding to described IP address sends probe requests thereby;Judge whether to receive described IP ground
The probe response that server corresponding to location returns for this probe requests thereby, if, it is determined that detect described IP
Server corresponding to address is normal, otherwise, it determines the server detecting described IP address corresponding is abnormal.
Described detecting module 402 specifically for, determine described website domain the 4th URL under one's name, in the updated
TTL expire before, based on a determination that described 4th URL, continue to detect clothes corresponding to described IP address
Business device is the most normal.
Certainly, the detection device of the above-mentioned dns server that the embodiment of the present invention provides can be by a hardware
Entity realizes, it is also possible to realized by two or more hardware entities.
The embodiment of the present invention provides detection method and the device of a kind of dns server, and the method is in net
The website domain name preserved in dns server and the mapping relations of IP address, at the TTL that these mapping relations are corresponding
Before expiring, the server that this IP address is corresponding is detected, if detecting the clothes that this IP address is corresponding
Business device is normal, then update the TTL that these mapping relations are corresponding, and TTL in the updated expires and continues before
Detection, otherwise in instruction net, dns server deletes this mapping relations.By said method, if mapped
Close tie up to the TTL of its correspondence not yet due time, server corresponding to corresponding IP address is not provided that service, then
In net, dns server can delete this mapping relations in time, thus the DNS to the website that user accesses takes
Business device inquiry IP address, and return to user, make user still can normally access website.
Those skilled in the art are it should be appreciated that embodiments herein can be provided as method, system or meter
Calculation machine program product.Therefore, the application can use complete hardware embodiment, complete software implementation or knot
The form of the embodiment in terms of conjunction software and hardware.And, the application can use and wherein wrap one or more
Computer-usable storage medium containing computer usable program code (include but not limited to disk memory,
CD-ROM, optical memory etc.) form of the upper computer program implemented.
The application is with reference to method, equipment (system) and the computer program product according to the embodiment of the present application
The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding
The processor of formula datatron or other programmable data processing device is to produce a machine so that by calculating
The instruction that the processor of machine or other programmable data processing device performs produces for realizing at flow chart one
The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other programmable datas can be guided to set
In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory
Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart
The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes
Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices
Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one
The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although having been described for the preferred embodiment of the application, but those skilled in the art once knowing base
This creativeness concept, then can make other change and amendment to these embodiments.So, appended right is wanted
Ask and be intended to be construed to include preferred embodiment and fall into all changes and the amendment of the application scope.
Obviously, those skilled in the art can carry out various change and modification without deviating from this Shen to the application
Spirit and scope please.So, if the application these amendment and modification belong to the application claim and
Within the scope of its equivalent technologies, then the application is also intended to comprise these change and modification.
Claims (14)
1. the detection method of a domain name system DNS server, it is characterised in that including:
Mapping for the website domain name preserved in dns server in net with network interconnection Protocol IP address is closed
System, determines the time-to-live TTL that presently described mapping relations are corresponding;
Before described TTL expires, the server detecting described IP address corresponding is the most normal;
The most then update the TTL that described in dns server, mapping relations are corresponding in described net, and more
Before TTL after Xin expires, the server continuing to detect described IP address corresponding is the most normal;
Otherwise, in indicating described net, dns server deletes described mapping relations.
2. the method for claim 1, it is characterised in that in net, dns server preserves website domain
Name and the mapping relations of IP address, specifically include:
Determine described website domain the first uniform resource position mark URL under one's name;
According to the IP address that the described website domain name pre-saved is corresponding, based on a determination that a described URL,
The server corresponding to described IP address sends probe requests thereby;
When receiving the probe response that server corresponding to described IP address returns for this probe requests thereby,
Described website domain name, described IP address, and TTL set in advance are sent to DNS in described net
Server, the mapping indicating dns server in described net to set up described website domain name and described IP address is closed
It is and preserves, and using described TTL set in advance as TTL corresponding to described mapping relations.
3. the method for claim 1, it is characterised in that detect the service that described IP address is corresponding
Device is the most normal, specifically includes:
Determine described website domain the second uniform resource position mark URL under one's name;
Based on a determination that described 2nd URL, periodically corresponding to described IP address server sends to be visited
Survey request;
The each probe requests thereby sent for the server corresponding to described IP address, if receiving described
The probe response that server corresponding to IP address returns for this probe requests thereby, it is determined that described IP address pair
The server answered is in service state, if not receiving server corresponding to described IP address for this detection
The probe response that request returns, it is determined that server corresponding to described IP address is in non-serving state;
When determining that server corresponding to described IP address is in non-serving state for continuous K time, determine detection
The server corresponding to described IP address is abnormal, otherwise, it determines detect the clothes that described IP address is corresponding
Business device is normal, and K is for setting quantity.
4. method as claimed in claim 3, it is characterised in that periodically corresponding to described IP address
Server send probe requests thereby, specifically include:
Use the head HEAD request method of HTML (Hypertext Markup Language) HTTP, periodically to described IP ground
The server transmission probe requests thereby that location is corresponding.
5. method as claimed in claim 3, it is characterised in that periodically corresponding to described IP address
Server send probe requests thereby, specifically include:
According to default detection cycle and detection times, when the described detection cycle arrives, to described IP
The server transmission probe requests thereby that address is corresponding, until the number of times sending probe requests thereby reaches described detection times
Till, wherein, the described detection cycle is corresponding less than presently described mapping relations with the product of described detection times
TTL.
6. method as claimed in claim 3, it is characterised in that when not determining described IP ground continuously for K time
When server corresponding to location is in non-serving state, described method also includes:
Determine described website domain the 3rd URL under one's name;
Based on a determination that described 3rd URL, the server corresponding to described IP address sends probe requests thereby;
Judge whether to receive the detection sound that server corresponding to described IP address returns for this probe requests thereby
Should, if, it is determined that detect server corresponding to described IP address normal, otherwise, it determines detect
Server corresponding to described IP address is abnormal.
7. the method as described in as arbitrary in claim 1~6, it is characterised in that TTL in the updated expires
Before, continue to detect server corresponding to described IP address the most normal, specifically include:
Determine described website domain the 4th URL under one's name, based on a determination that described 4th URL, continue detection
Server corresponding to described IP address is the most normal, and described 4th URL can be identical with the 3rd URL,
But can not be identical with the 2nd URL.
8. the detection device of a domain name system DNS server, it is characterised in that including:
Determine module, for for the website domain name preserved in dns server in net and network interconnection agreement
The mapping relations of IP address, determine the time-to-live TTL that presently described mapping relations are corresponding;
Detecting module, for before described TTL expires, the server detecting described IP address corresponding is
No normally;
More new module, is just detecting server corresponding to described IP address for determining at described detecting module
Chang Shi, updates the TTL that described in dns server, mapping relations are corresponding in described net, and indicates described spy
Before survey module TTL in the updated expires, continue the most just detecting server corresponding to described IP address
Often;
Removing module, detects server corresponding to described IP address not for determining at described detecting module
Time normal, in indicating described net, dns server deletes described mapping relations.
9. device as claimed in claim 8, it is characterised in that described device also includes:
Writing module, for determining described website domain the first uniform resource position mark URL under one's name, according in advance
The IP address that the described website domain name that first preserves is corresponding, based on a determination that a described URL, to described IP
The server transmission probe requests thereby that address is corresponding, when receiving server corresponding to described IP address for this
During the probe response that probe requests thereby returns, by described website domain name, IP address, and TTL set in advance
Be sent to dns server in described net, indicate dns server in described net set up described website domain name with
The mapping relations of described IP address also preserve, and using described TTL set in advance as described mapping relations
Corresponding TTL.
10. device as claimed in claim 8, it is characterised in that described detecting module specifically for, really
Fixed described website domain the second uniform resource position mark URL under one's name;Based on a determination that described 2nd URL,
The server the most corresponding to described IP address sends probe requests thereby;For corresponding to described IP address
Server send each probe requests thereby, if receiving server corresponding to described IP address for this
The probe response that probe requests thereby returns, it is determined that server corresponding to described IP address is in service state,
If not receiving the probe response that server corresponding to described IP address returns for this probe requests thereby, the most really
The server determining described IP address corresponding is in non-server state;When continuous K time determines described IP address
When corresponding server is in non-serving state, determines and the most just detecting server corresponding to described IP address
Often, otherwise, it determines it is normal to detect server corresponding to described IP address, wherein, K is for setting quantity.
11. devices as claimed in claim 10, it is characterised in that described detecting module specifically for,
Use the head HEAD request method of HTML (Hypertext Markup Language) HTTP, periodically to described IP address pair
The server answered sends probe requests thereby.
12. devices as claimed in claim 10, it is characterised in that described detecting module specifically for,
According to default detection cycle and detection times, when the described detection cycle arrives, to described IP address
Corresponding server sends probe requests thereby, until the number of times sending probe requests thereby reaches described detection times is
Only, wherein, the described detection cycle is corresponding less than presently described mapping relations with the product of described detection times
TTL。
13. devices as claimed in claim 10, it is characterised in that described detecting module is additionally operable to, when
Do not determine for K time continuously when server corresponding to described IP address is in non-serving state, determine described website
The 3rd URL under domain name;Based on a determination that described 3rd URL, to the server that described IP address is corresponding
Send probe requests thereby;Judge whether that the server receiving described IP address corresponding returns for this probe requests thereby
The probe response returned, if, it is determined that detect server corresponding to described IP address normal, otherwise,
Determine that the server detecting described IP address corresponding is abnormal.
14. as arbitrary in claim 8~13 as described in device, it is characterised in that described detecting module is concrete
For, determine described website domain the 4th URL under one's name, before TTL in the updated expires, based on really
Fixed described 4th URL, continues to detect server corresponding to described IP address the most normal, and the described 4th
URL can be identical with the 3rd URL, but can not be identical with the 2nd URL.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210414759.5A CN103780714B (en) | 2012-10-25 | 2012-10-25 | The detection method of a kind of dns server and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210414759.5A CN103780714B (en) | 2012-10-25 | 2012-10-25 | The detection method of a kind of dns server and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103780714A CN103780714A (en) | 2014-05-07 |
CN103780714B true CN103780714B (en) | 2016-12-21 |
Family
ID=50572529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210414759.5A Active CN103780714B (en) | 2012-10-25 | 2012-10-25 | The detection method of a kind of dns server and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103780714B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105681482A (en) * | 2015-12-28 | 2016-06-15 | 哈尔滨工业大学 | DNS cache detection error correction method |
CN107231446A (en) * | 2016-03-23 | 2017-10-03 | 北京京东尚科信息技术有限公司 | Synchronous IP collocation methods and device |
CN105871661B (en) * | 2016-06-16 | 2019-07-26 | 上海帝联信息科技股份有限公司 | Public network server detection method and detecting server |
CN107786678B (en) * | 2016-08-24 | 2021-04-02 | 北京金山云网络技术有限公司 | Domain name resolution method, device and system |
CN106789422B (en) * | 2016-12-16 | 2020-05-12 | 杭州迪普科技股份有限公司 | Monitoring method and device of DNS (Domain name Server) |
CN108243265A (en) * | 2016-12-27 | 2018-07-03 | 中国移动通信集团浙江有限公司 | A kind of dns resolution processing method and processing device |
CN108259630B (en) * | 2016-12-29 | 2021-01-12 | 中国电信股份有限公司 | Detection method, platform and system for unregistered website |
CN107819890A (en) * | 2017-09-28 | 2018-03-20 | 安徽乐游网络科技有限公司 | A kind of domain name term of validity monitoring and alarm method |
CN108833424B (en) * | 2018-06-25 | 2020-11-03 | 哈尔滨工业大学 | System for acquiring all resource records of domain name |
CN109842566B (en) * | 2019-01-10 | 2023-01-24 | 杭州迪普科技股份有限公司 | DNS (Domain name Server) analysis method and device |
CN112543141B (en) * | 2020-12-04 | 2022-03-01 | 互联网域名系统北京市工程研究中心有限公司 | DNS forwarding server disaster tolerance scheduling method and system |
CN112839089B (en) * | 2021-01-08 | 2023-06-23 | 网宿科技股份有限公司 | CDN quality detection method and system |
CN113472910B (en) * | 2021-06-07 | 2023-04-07 | 广州根链国际网络研究院有限公司 | DNS authority record health monitoring method and system |
-
2012
- 2012-10-25 CN CN201210414759.5A patent/CN103780714B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN103780714A (en) | 2014-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103780714B (en) | The detection method of a kind of dns server and device | |
CN110096659B (en) | Page display method, device and equipment and readable storage medium | |
CN103167044B (en) | The method of the intelligently parsing of domain name system DNS, testing device and system | |
US10284446B2 (en) | Optimizing content management | |
US8051166B1 (en) | Service provider optimization of content management | |
CN103888358B (en) | Routing method, device, system and gateway equipment | |
US8286176B1 (en) | Optimizing resource configurations | |
CN103297472B (en) | A kind of reorientation method and content distribution nodes applied to content distributing network | |
CN103312716B (en) | A kind of method and system accessing internet information | |
TWI656772B (en) | Method, system, web server, browser and GPS for obtaining webpage | |
US20140089460A1 (en) | Unobtrusive methods and systems for collecting information transmitted over a network | |
WO2019028683A1 (en) | Method and system for acquiring and collecting client local dns server | |
CN105871975A (en) | Method and device for selecting source server | |
CN103678311B (en) | Web access method and system, crawl Routing Service device based on transfer mode | |
CN102932473B (en) | The method of cross operator access to netwoks Web content | |
CN104702617B (en) | A kind of data distributing method and device based on content distributing network | |
CN105306609A (en) | Network loading processing method and device | |
CN106921537A (en) | Website visiting quality detecting method, server and system | |
Goel et al. | Measuring what is not ours: a tale of party performance | |
CN109729058B (en) | Traffic hijacking analysis method and device | |
CN106326293A (en) | Access method and device based on dynamic webpage | |
CN109634753A (en) | Switch data processing method, device, terminal and the storage medium of browser kernel | |
CN105991797B (en) | The method and device of mobile terminal network visiting | |
CN114745356B (en) | Domain name resolution method, device, equipment and readable storage medium | |
CN103237089A (en) | Method and device for repairing domain name system (DNS) polling mode-based webpages and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |