CN107360274B - Domain name survival time calculation method and device and domain name query method and device - Google Patents

Domain name survival time calculation method and device and domain name query method and device Download PDF

Info

Publication number
CN107360274B
CN107360274B CN201710813617.9A CN201710813617A CN107360274B CN 107360274 B CN107360274 B CN 107360274B CN 201710813617 A CN201710813617 A CN 201710813617A CN 107360274 B CN107360274 B CN 107360274B
Authority
CN
China
Prior art keywords
domain name
time
elastic
ttl
resolution server
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
CN201710813617.9A
Other languages
Chinese (zh)
Other versions
CN107360274A (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 Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV Inc
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 Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN201710813617.9A priority Critical patent/CN107360274B/en
Publication of CN107360274A publication Critical patent/CN107360274A/en
Application granted granted Critical
Publication of CN107360274B publication Critical patent/CN107360274B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/58Caching of addresses or names

Landscapes

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

Abstract

The invention discloses a domain name survival time calculation method and device and a domain name query method and device. Therefore, the time to failure calculated by the client is based on the elastic TTL. Therefore, when the client side sends the domain name query request to the domain name resolution server in a centralized manner before the domain name fails, the different failure time can be taken as the reference, so that the problem that the client side sends the domain name query request in a centralized manner within a period of time and the normal service is interrupted or delayed due to instant overload of the server can be avoided.

Description

Domain name survival time calculation method and device and domain name query method and device
Technical Field
The invention relates to the field of internet, in particular to a domain name survival time calculation method and device and a domain name query method and device.
Background
TTL (Time-To-Live, Chinese full name: Time-To-Live) is the persistence Time of a domain name resolution record in a DNS server. After receiving the resolution request, the DNS servers in various places send the resolution request to the DNS server designated by the domain name so as to obtain a resolution record; after obtaining the record, the record is stored in the DNS server for a period of time, and if receiving the resolution request again in the period of time, the DNS server directly returns to the record obtained just before; and the time that this record is retained on the DNS server is the TTL value.
In some cases, when receiving a domain name query request, a domain name resolution server sends the domain name query request to a forwarding server, and after obtaining a query result, the forwarding server sends a TTL and the query result to the domain name resolution server, and the domain name resolution server also feeds back the TTL to a client, so that the client can intensively send the domain name query request to the domain name resolution server before domain name failure time, as shown in fig. 1, the requests received by the domain name resolution server within a period of time increase sharply, and a peak occurs, which may cause a problem that the server is instantaneously overloaded to cause normal service interruption or delay.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for calculating a lifetime of a domain name, and a method and an apparatus for querying a domain name, where when a client sends a domain name query request to a domain name resolution server before a domain name fails, different failure times may be used as references, so that the client can be prevented from sending the domain name query request in a concentrated manner within a period of time, and the problem of interruption or delay of normal service due to instantaneous overload of the server is avoided.
The method for calculating the lifetime of the domain name provided by the embodiment of the invention comprises the following steps:
when a domain name query result and a standard TTL are received, calculating failure time according to the standard TTL and a first current time;
randomly selecting an elastic time in a preset elastic time window;
and calculating the elastic TTL according to the sum of the elastic time and the failure time and the second current time.
The device for calculating the lifetime of the domain name provided by the embodiment of the invention comprises:
the first failure time calculation unit is used for calculating failure time according to the standard TTL and the current time when a domain name query result and the standard TTL are received;
the elastic time selecting unit is used for randomly selecting an elastic time in a preset elastic time window;
and the elastic TTL time calculation unit is used for adding the selected elastic time and the failure time to obtain the elastic TTL.
The domain name query method provided by the embodiment of the invention comprises the following steps:
when the resolution server receives a domain name query result and a standard TTL sent by a forwarding server, calculating failure time according to the standard TTL and the current time;
when receiving a query request of the domain name sent by a client, randomly selecting an elastic time in a preset elastic time window, and adding the selected elastic time and the failure time to obtain an elastic TTL;
and sending the query result and the elastic TTL to the client.
Optionally, the method further includes:
and the client sends the domain name query request to the resolution server again according to the elastic TTL.
Optionally, the method further includes:
and the resolution server sends a domain name query request to the forwarding server.
The embodiment of the invention provides a domain name inquiry device, which comprises:
the second failure time calculation unit is used for calculating failure time according to the standard TTL and the current time when the domain name query result and the standard TTL sent by the forwarding server are received by the resolution server;
the second elastic time calculation unit randomly selects an elastic time in a preset elastic time window when receiving the query request of the domain name sent by the client, and adds the selected elastic time and the failure time to obtain an elastic TTL;
and the sending unit is used for sending the query result and the elastic TTL to the client.
Optionally, the method further includes:
and the first query unit is used for sending the domain name query request to the resolution server again when the client side sends the domain name query request to the resolution server according to the elastic TTL.
Optionally, the method further includes:
a second query unit, configured to send a domain name query request to the forwarding server by the resolution server.
In the embodiment of the invention, when the TTL is fed back to the client, the accurate failure time is taken as a reference, one elastic time is selected from the preset elastic time window, and the elastic TTL is calculated according to the sum of the accurate failure time and the elastic time and the current time when the TTL is fed back to the client. Therefore, the time to failure calculated by the client is based on the elastic TTL. Therefore, when the client side sends the domain name query request to the domain name resolution server in a centralized manner before the domain name fails, the different failure time can be taken as the reference, so that the problem that the client side sends the domain name query request in a centralized manner within a period of time and the normal service is interrupted or delayed due to instant overload of the server can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 shows a schematic diagram of a client set sending a request to a domain name resolution server;
fig. 2 is a flowchart illustrating a method for calculating lifetime of a domain name according to an embodiment of the present invention;
FIG. 3 shows a schematic diagram of an elastic time window;
fig. 4 is a schematic structural diagram illustrating a domain name lifetime calculation apparatus according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a domain name query method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram illustrating a domain name querying device according to an embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a test result provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 2, a flowchart of a domain name lifetime calculation method provided in an embodiment of the present invention is shown, where the method includes:
s201: when a domain name query result and a standard TTL are received, calculating failure time according to the standard TTL and a first current time;
for example, the following steps are carried out: when the client sends a domain name query request to the domain name resolution server, if the domain name cannot be queried in the domain name resolution server, the domain name resolution server may send the domain name query request to the transfer server, and the transfer server sends a domain name query result to the domain name resolution server, and sends a TTL to the domain name resolution server at the same time, where the TTL obtained by the domain name resolution server is an accurate TTL, which is expressed as a standard TTL in this embodiment. And the domain name resolution server caches the obtained query result.
The query result cached in the domain name resolution server is time-limited, and the cached domain name query result can be deleted after a certain time. And the failure time is equal to the sum of the TTL and the current time, wherein the first current time is the time when the domain name resolution server receives the domain name query result and the standard TTL sent by the forwarding server.
Note that the failure time obtained in S201 is an accurate failure time.
S202: randomly selecting an elastic time in a preset elastic time window;
s203: and calculating the elastic TTL according to the sum of the elastic time and the standard failure time and the second current time.
As shown in fig. 3, an elastic time window may be added after the time to failure, the elastic time window being a predetermined elastic time to failure. Selecting an elastic time from the elastic time window, and then the elastic TTL computing method is: the spring time plus the dead time minus the second current time. Wherein the second current time is: when the client sends the query request of the domain name to the domain name resolution server, the domain name resolution server feeds back the cached query result to the time of the client.
In this embodiment, each time an elastic TTL needs to be fed back to a client, the elastic time is randomly selected, that is, the elastic times corresponding to the TTL received by different clients may be different, and since the domain name failure time is equal to the TTL plus the current time, the domain name failure times calculated by different clients are different, but the domain name failure times calculated by all the clients are between the accurate domain name failure time and the elastic failure time. Where the spring time to failure is equal to the exact time to failure plus the total time of the spring time window.
For example, the following steps are carried out: when a client sends a domain name query request to a domain name resolution server, if the domain name resolution server caches the domain name query result, the query result of the domain name and the elastic TTL are sent to the client. Then, the client may send the domain name query request to the domain name resolution server again according to the elastic TTL, and in general, the client may send the domain name query request to the domain name resolution server again before the domain name reaches the failure time.
In this embodiment, when the TTL is fed back to the client, an elastic time is selected from a preset elastic time window based on the accurate failure time, and the elastic TTL is calculated according to the sum of the accurate failure time and the elastic time and the current time when the TTL is fed back to the client. Therefore, the failure time calculated by the client is based on the elastic TTL, so that when the client intensively sends the domain name query request to the domain name resolution server before the domain name fails, the failure time can be based on different failure times, thereby avoiding the phenomenon that the client intensively sends the domain name query request within a period of time and avoiding the problem of normal service interruption or delay caused by instantaneous overload of the server.
Referring to fig. 4, a schematic structural diagram of a domain name lifetime calculation apparatus provided in an embodiment of the present invention is shown, in this implementation, the apparatus includes:
a first expiration time calculating unit 401, configured to calculate expiration time according to the standard TTL and current time when the domain name query result and the standard TTL are received;
an elastic time selecting unit 402, configured to randomly select an elastic time within a preset elastic time window;
an elastic TTL time calculation unit 403, configured to add the selected elastic time to the failure time to obtain an elastic TTL.
By the device of the embodiment, the phenomenon that the client side sends the domain name query request in a concentrated mode within a period of time can be avoided, and the problem that normal service is interrupted or delayed due to instant overload of the server is avoided.
Referring to fig. 5, a flowchart of a domain name querying method provided in an embodiment of the present invention is shown, where in this embodiment, the method includes:
s501: when the resolution server receives a domain name query result and a standard TTL sent by a forwarding server, calculating failure time according to the standard TTL and the current time;
s502: when receiving a query request of the domain name sent by a client, randomly selecting an elastic time in a preset elastic time window, and adding the selected elastic time and the failure time to obtain an elastic TTL;
s503: and sending the query result and the elastic TTL to the client.
In this embodiment, when the client receives the elastic TTL sent by the domain name resolution server, this embodiment further includes:
and the client sends the domain name query request to the resolution server again according to the elastic TTL.
In this embodiment, before performing S501, the method further includes:
and the resolution server sends a domain name query request to the forwarding server.
For example, the following steps are carried out: when a client sends a domain name query request to a domain name resolution server, if the query result of the domain name can not be queried in the domain name resolution server, the domain name resolution server sends the query request of the domain name to a forwarding server, after the domain name query request is queried, the forwarding server sends the query result of the domain name and a standard TTL to the domain name resolution server, the domain name resolution server calculates the failure time of the domain name from the standard TTL and the current time, randomly selects an elastic time in a preset elastic time window, adds the selected elastic time and the failure time to obtain an elastic TTL, and sends the query result and the elastic TTL to the client. The client mentioned in this embodiment may be one client or multiple clients, and when the elastic TTL is fed back to multiple clients, because the selection of time in each elasticity is random, the TTL fed back to different clients by the domain name resolution server at the same time is different, the failure time of the domain name obtained by the clients is also different, and when the clients send the domain name query request to the clients again, the clients are prevented from concentrating on the occurrence within a period of time.
In addition, when the domain name resolution server caches the query result of the domain name and the standard TTL, if a client sends a domain name query request to the domain name resolution server, an elastic time is randomly selected in a preset elastic time window, the selected elastic time and the failure time are added to obtain the elastic TTL, and the query result and the elastic TTL are sent to the client. Because the elastic time is randomly acquired, when the elastic TTL is fed back to different clients, the selected elastic time may be different, the failure time of the domain name obtained by the clients is also different, and when the clients send the domain name query request to the clients again, the clients can be prevented from concentrating in a period of time.
In this embodiment, when the client sends the domain name query request to the domain name resolution server in a centralized manner before the domain name fails, the client may use different failure times as references, so that the problem that the client sends the domain name query request in a centralized manner within a period of time is avoided, and the problem that the server is overloaded instantaneously to cause normal service interruption or delay is avoided.
Referring to fig. 6, a schematic structural diagram of a domain name querying device provided in an embodiment of the present invention is shown, in this implementation, the device includes:
a second expiration time calculating unit 601, configured to calculate expiration time according to the standard TTL and current time when the resolution server receives the domain name query result and the standard TTL sent by the forwarding server;
a second elastic time calculating unit 602, configured to randomly select an elastic time within a preset elastic time window when receiving a query request for the domain name sent by a client, and add the selected elastic time and the failure time to obtain an elastic TTL;
a sending unit 603, configured to send the query result and the elastic TTL to the client.
Optionally, the method further includes:
and the first query unit is used for sending the domain name query request to the resolution server again when the client side sends the domain name query request to the resolution server according to the elastic TTL.
Optionally, the method further includes:
a second query unit, configured to send a domain name query request to the forwarding server by the resolution server.
By the device of the embodiment, the phenomenon that the client side sends the domain name query request in a concentrated mode within a period of time can be avoided, and the problem that normal service is interrupted or delayed due to instant overload of the server is avoided.
Referring to fig. 7, for the method of the present invention, different clients have different time to request the domain name resolution server again due to different failure times, and the change of the peak value can be referred to as shown in fig. 7, as can be seen from fig. 7, the peak value becomes smaller, and the existence time of the peak value also becomes longer, thereby avoiding the problem that the clients send domain name query requests in a concentrated manner within a period of time, and avoiding the problem of interruption or delay of normal service due to instantaneous overload of the server.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A domain name lifetime calculation method is characterized by comprising the following steps:
when a domain name query result and a standard TTL are received, calculating failure time according to the standard TTL and first current time, wherein the first current time is the time when a domain name resolution server receives the domain name query result and the standard TTL;
randomly selecting an elastic time in a preset elastic time window;
calculating elastic TTL according to the sum of the elastic time and the failure time minus a second current time;
and the second current time is the time when the client sends the query request of the domain name to the domain name resolution server, and the domain name resolution server feeds back the cached query result to the client.
2. A domain name lifetime calculation apparatus, comprising:
the first failure time calculation unit is used for calculating failure time according to the standard TTL and first current time when a domain name query result and the standard TTL are received, wherein the first current time is the time when the domain name query result and the standard TTL are received by the domain name resolution server;
the elastic time selecting unit is used for randomly selecting an elastic time in a preset elastic time window;
an elastic TTL time calculation unit for calculating elastic TTL according to the sum of the elastic time and the failure time minus a second current time;
and the second current time is the time when the client sends the query request of the domain name to the domain name resolution server, and the domain name resolution server feeds back the cached query result to the client.
3. A domain name query method is characterized by comprising the following steps:
when the domain name resolution server receives a domain name query result and a standard TTL which are sent by a forwarding server, calculating failure time according to the standard TTL and the current time;
when receiving a query request of the domain name sent by a client, randomly selecting an elastic time in a preset elastic time window, and calculating an elastic TTL according to the sum of the elastic time and a failure time minus a second current time, wherein the second current time is the time for the domain name resolution server to feed back a cached query result to the client when the client sends the query request of the domain name to the domain name resolution server;
and sending the query result and the elastic TTL to the client.
4. The method of claim 3, further comprising:
and the client sends the query request of the domain name to the domain name resolution server again according to the elastic TTL.
5. The method of claim 3, further comprising:
and the domain name resolution server sends a domain name query request to the forwarding server.
6. A domain name query apparatus, comprising:
the second failure time calculation unit is used for calculating failure time according to the standard TTL and the current time when the domain name resolution server receives the domain name query result and the standard TTL which are sent by the forwarding server;
a second elastic time calculating unit, configured to randomly select an elastic time within a preset elastic time window when receiving the query request of the domain name sent by the client, and calculate an elastic TTL according to a subtraction of a second current time from a sum of the elastic time and the failure time, where the second current time is a time when the client sends the query request of the domain name to the domain name resolution server, and the domain name resolution server feeds back a cached query result to the client;
and the sending unit is used for sending the query result and the elastic TTL to the client.
7. The apparatus of claim 6, further comprising:
and the first query unit is used for sending the query request of the domain name to the domain name resolution server again when the client side sends the query request of the domain name to the domain name resolution server according to the elastic TTL.
8. The apparatus of claim 6, further comprising:
and the second query unit is used for sending a domain name query request to the forwarding server by the domain name resolution server.
CN201710813617.9A 2017-09-11 2017-09-11 Domain name survival time calculation method and device and domain name query method and device Active CN107360274B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710813617.9A CN107360274B (en) 2017-09-11 2017-09-11 Domain name survival time calculation method and device and domain name query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710813617.9A CN107360274B (en) 2017-09-11 2017-09-11 Domain name survival time calculation method and device and domain name query method and device

Publications (2)

Publication Number Publication Date
CN107360274A CN107360274A (en) 2017-11-17
CN107360274B true CN107360274B (en) 2021-02-09

Family

ID=60290989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710813617.9A Active CN107360274B (en) 2017-09-11 2017-09-11 Domain name survival time calculation method and device and domain name query method and device

Country Status (1)

Country Link
CN (1) CN107360274B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656753A (en) * 2008-08-21 2010-02-24 中国移动通信集团公司 Content synchronization method, equipment and system for dynamic content delivery
CN102025795A (en) * 2010-01-22 2011-04-20 中国移动通信集团北京有限公司 DNS response message processing method, DNS server and system
CN102469167A (en) * 2010-11-01 2012-05-23 中国移动通信集团北京有限公司 Domain name query implementing method and system
CN104598261A (en) * 2013-10-30 2015-05-06 三星Sds株式会社 Apparatus and method of executing update, recording medium using the same, and server and method of providing update
CN106790469A (en) * 2016-12-09 2017-05-31 中国联合网络通信集团有限公司 A kind of buffer control method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656753A (en) * 2008-08-21 2010-02-24 中国移动通信集团公司 Content synchronization method, equipment and system for dynamic content delivery
CN102025795A (en) * 2010-01-22 2011-04-20 中国移动通信集团北京有限公司 DNS response message processing method, DNS server and system
CN102469167A (en) * 2010-11-01 2012-05-23 中国移动通信集团北京有限公司 Domain name query implementing method and system
CN104598261A (en) * 2013-10-30 2015-05-06 三星Sds株式会社 Apparatus and method of executing update, recording medium using the same, and server and method of providing update
CN106790469A (en) * 2016-12-09 2017-05-31 中国联合网络通信集团有限公司 A kind of buffer control method, device and system

Also Published As

Publication number Publication date
CN107360274A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
US10469355B2 (en) Traffic surge management for points of presence
US11108729B2 (en) Managing request routing information utilizing client identifiers
US9887931B1 (en) Traffic surge management for points of presence
US9887932B1 (en) Traffic surge management for points of presence
US10623408B1 (en) Context sensitive object management
US9794216B2 (en) Request routing in a networked environment
US9172674B1 (en) Managing request routing information utilizing performance information
US8301778B2 (en) Service provider registration by a content broker
US10958501B1 (en) Request routing information based on client IP groupings
US10243917B2 (en) Method and apparatus for calculating distance in contents delivery network
US20120072600A1 (en) Managing content delivery network service providers
JP2017509053A5 (en)
CN106888277B (en) Domain name query method and device
EP3108644A1 (en) Content delivery network architecture with edge proxy
WO2011040947A1 (en) Content delivery utilizing multiple content delivery networks
CN103780715A (en) Domain name resolution implementing method, client side and cloud server
CN106797330B (en) Method, Traffic Monitor (TM), Request Router (RR) and system for monitoring a Content Delivery Network (CDN)
EP1762069B1 (en) Method of selecting one server out of a server set
CN107360274B (en) Domain name survival time calculation method and device and domain name query method and device
CN109413015B (en) DNS hijacking defense method and device
US10397082B2 (en) Internet infrastructure measurement method and system adapted to session volume
CN107547295B (en) Aging method and device for domain name cache table entries
CN110891090A (en) Request method, device, server, system and storage medium
JP6368127B2 (en) Communication device, control method, and program
Otto et al. namehelp: Intelligent client-side DNS resolution

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