WO2018233312A1 - 一种dns防攻击方法、设备和系统 - Google Patents

一种dns防攻击方法、设备和系统 Download PDF

Info

Publication number
WO2018233312A1
WO2018233312A1 PCT/CN2018/077553 CN2018077553W WO2018233312A1 WO 2018233312 A1 WO2018233312 A1 WO 2018233312A1 CN 2018077553 W CN2018077553 W CN 2018077553W WO 2018233312 A1 WO2018233312 A1 WO 2018233312A1
Authority
WO
WIPO (PCT)
Prior art keywords
domain name
record
server
com
authoritative
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.)
Ceased
Application number
PCT/CN2018/077553
Other languages
English (en)
French (fr)
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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to EP18820776.5A priority Critical patent/EP3557841A4/en
Priority to US16/464,761 priority patent/US11044262B2/en
Publication of WO2018233312A1 publication Critical patent/WO2018233312A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • 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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1425Traffic logging, e.g. anomaly detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1458Denial of Service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Definitions

  • the embodiments of the present invention relate to the field of network security technologies, and in particular, to a DNS attack defense method, device, and system. Background technique
  • the client When the client accesses a domain name, for example, accessing aaa.com, it will query the recursive server for the A (.at.) record of aaa.com. If the recursive server does not cache the A record of aaa.com, the recursive server will send it to the root domain name server ( .), top-level domain name server (.com), authoritative domain name server (aaa. com) recursively query the A record corresponding to aaa.com, the top-level domain name server (.com) does not directly tell the recursive server aaa.
  • the NS (Name Server) record of the corresponding authoritative domain name server (aaa.com) is sent to the recursive server.
  • the NS record records the NS records of all authoritative domain name servers that can be used to resolve aaa.com, for example:
  • the A record of the NS record of the authoritative domain name server for example:
  • the recursive server selects one of the authoritative domain name servers for access, such as:
  • the recursive server initiates a domain name access request to the authoritative domain name server 1.1.1.1 to obtain the A record corresponding to aaa.com.
  • the authoritative domain name server 1.1.1.1 returns the A record corresponding to aaa.com to the recursive server to complete the complete resolution of a domain name. For example: aaa.com. 600 IN A 106.11.61.44
  • the client accesses according to the IP address 106.11.61.44 corresponding to the domain name aaa.com. Since the recursive server will later use the authoritative domain name server 1.1.1.1 as the preferred server for aaa.com domain name resolution. If the authoritative domain name server 1.1.1.1 is attacked, the TTL expiration time (TTL) is generally set by the top-level domain management authority to 48 hours (nsl.aaadns.com. 172800 IN A 1.1.1.1), which will result in a large number of domain names for a long time. Can not be parsed, reducing the efficiency of domain name resolution. Summary of the invention
  • the embodiment of the present invention provides a DNS attack defense method, device, and system, which are used to improve the efficiency of domain name resolution when an authoritative domain name server is attacked.
  • the embodiment of the invention provides a DNS attack defense method, including:
  • the recursive server receives the domain name query request message, where the domain name query request message carries the domain name that is not cached in the recursive server;
  • the recursive server receives the A record, the second NS record, and the A record of the second NS returned by the first authoritative domain name server, where the second NS record records the domain name and is in normal state.
  • the recursive server replaces the second NS record with the first NS record and caches the A record of the second NS.
  • the recursive server before the determining, by the recursive server, the first authoritative domain name server according to the first NS record corresponding to the domain name and the A record of the first NS, the recursive server further includes:
  • the first authoritative domain name server is determined according to the first NS record corresponding to the domain name and the A record of the first NS;
  • the second authoritative domain name server is not included in the NS record.
  • the recursive server replaces the second NS record with the first NS record, and caches the A record of the second NS, including:
  • the recursive server determines that the second NS record is different from the first NS record, the second NS record is replaced with the first NS record, and the A record of the second NS is cached.
  • the A record of the first NS and the A record of the second NS all adopt a form of a generic domain name pointing to an IP address;
  • an authoritative domain name server corresponding to the A information in the NS record falls within the matching range of the A information.
  • the first authoritative domain name server receives the domain name query request message sent by the recursive server, where the domain name query request message carries the domain name that is not cached in the recursive server;
  • the recursive server determines, according to the first NS record and the A record of the first NS, the first authoritative domain name server sends the A record of the domain name, the second NS record, and the A record of the second NS to the recursive server.
  • An authoritative domain name server for parsing the domain name and in a normal working state is described in the second NS record.
  • the second NS record and the A record of the second NS are obtained by: deleting, by the first authoritative domain name server, the first NS record and the A record of the first NS
  • the first authoritative domain name server replaces the newly added information of the domain name server that resolves the domain name with the information of the first NS record and the domain name server in the A record of the first NS that is in an abnormal working state.
  • the upper-level domain name server of the first authoritative domain name server is configured with the second NS record and the A record of the second NS.
  • an embodiment of the present invention provides a recursive server, including:
  • a memory for storing program instructions
  • the recursive server receives a domain name query request message, where the domain name query request message carries a domain name that is not cached in the recursive server; Determining, by the recursive server, the first authoritative domain name server according to the first NS record corresponding to the domain name and the A record of the first NS, and sending the domain name query request message to the first authoritative domain name server; Receiving, by the first authoritative domain name server, an A record of the domain name, a second NS record, and an A record of the second NS, where the second NS record records an authority for parsing the domain name and is in a normal working state. a domain name server; the recursive server replacing the second NS record with the first NS record, and buffering the A record of the second NS.
  • An embodiment of the present invention provides an authoritative domain name server, including:
  • a memory for storing program instructions
  • the first authoritative domain name server receives the domain name query request message sent by the recursive server, where the domain name query request message carries the recursion a domain name that is not cached in the server; the first authoritative domain name server is determined by the recursive server according to the first NS record and the A record of the first NS; the first authoritative domain name server sends the domain name to the recursive server The A record, the second NS record, and the A record of the second NS, wherein the second NS record records an authoritative domain name server for parsing the domain name and in a normal working state.
  • Embodiments of the present invention provide a computer storage medium, where the computer storage medium stores
  • the computer executable instructions are for causing the computer to perform any of the methods described above.
  • An embodiment of the present invention provides a DNS attack defense system, including the foregoing recursive server and the foregoing authority domain name server.
  • the foregoing embodiment provides a DNS attack defense method, device, and system.
  • the recursive server queries the first NS record corresponding to the unresolved domain name and the A record of the first NS, and the first NS record records the authoritative domain name of the domain name.
  • a server the recursive server determines the first authoritative domain name server; the first authoritative domain name server returns the second NS record stored in the first authoritative domain name server and the second NS A record, in addition to returning the A record of the domain name, the first
  • the authoritative domain name server for parsing the domain name and in a normal working state is recorded in the second NS record; the recursive server replaces the second NS record with the first NS record, and caches the A record of the second NS.
  • the recursive server uses the first NS record stored by itself to determine the first authoritative domain name server that resolves the domain name, and then refreshes the first NS record through the second NS record returned by the working first authoritative domain name server, thereby
  • the information of the authoritative domain name server that is attacked or fails to work is deleted from the NS record, so that the TTL value enforced by the top-level domain management organization does not affect the DNS resolution for a long time. Therefore, the efficiency of domain name resolution can be improved.
  • FIG. 1 is a schematic flowchart of a DNS attack defense method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a DNS attack defense method according to a second embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a DNS attack defense method according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an authoritative domain name server according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart diagram of a DNS attack defense method according to an embodiment of the present invention. As shown in FIG. 1, the method may include:
  • the S10K recursive server receives the domain name query request message, where the domain name query request message carries the domain name that is not cached in the recursive server;
  • the recursive server After receiving the domain name query request packet, the recursive server determines whether the IP address information of the domain name corresponding to the domain name query request packet is not cached. If the IP address information of the domain name is cached, the client directly feeds back the domain name corresponding to the domain name. IP address information; if the IP address information of the domain name is not cached, the authoritative domain name server that resolves the domain name needs to be determined according to the NS record corresponding to the domain name.
  • the recursive server can set the IP corresponding to w.ddd.com The address is sent to the client; in another case, when the IP address corresponding to www.ddd.com is not cached in the recursive server configured by the client, the NS of the ddd.com that has been cached in the server is recursively queried or recursively.
  • the record and the A record of the NS obtain the first NS record corresponding to the domain name query request message www.ddd.com and the A record of the first NS, that is, the NS responsible for resolving the domain name server of the domain name www.ddd.com Record and the A record of the NS.
  • the recursive server determines the first authoritative domain name server according to the first NS record corresponding to the domain name and the A record of the first NS, and sends the domain name query request message to the first authoritative domain name server;
  • the first NS record usually records multiple authoritative domain name servers that resolve the domain name.
  • the recursive server can randomly select an authoritative domain name server from it; usually, if the recursive server passes an authoritative domain name server (such as the second authoritative domain name server) Resolving the domain name of the domain name, recursive
  • the server will use the second authoritative domain name server as the preferred server.
  • the domain name resolved this time is example, aaa. com
  • the second authoritative domain name server has previously parsed xxx. aaa. com, then the example. aaa. com is parsed this time.
  • the recursive server sends the domain name query request message to the second authoritative domain name server. If the recursive server does not receive the message returned by the second authoritative domain name server, the recursive server determines another authoritative domain name server (such as the first authoritative domain name server) according to the first NS record and the A record of the first NS. DNS.
  • aaa. com, xxx. aaa. com, both of which are second-level domain names of aaa.com usually classify the upper-level domain name and the peer domain name into similar domain names, and the same domain name usually corresponds to the same group of authoritative domain name servers. .
  • the first authoritative domain name server When the first authoritative domain name server is working normally, the first authoritative domain name server returns the A record of the resolved domain name; in addition, the first authoritative domain name server also returns the second NS record and the second NS A record;
  • the second NS record records the authoritative domain name server that works normally.
  • the content in the second NS record may be detected by each authoritative domain name server through a mechanism such as a heartbeat message, or may be obtained by updating the NS record according to the alarm information. It can also be artificially set and so on.
  • aaa. com is used as an example.
  • the initial storage of the authoritative domain name servers is the NS information that aaa.com fills in during registration.
  • each authoritative domain name server As the status of each authoritative domain name server corresponding to aaa.com changes, each authoritative domain name server is updated.
  • the NS record corresponding to aaa.com stored by itself and the A record of NS.
  • the other authoritative domain name servers that are working normally will delete the information of the second authoritative domain name server from the NS record stored by itself, instead of modifying only the second authoritative domain name server.
  • the second NS record may be the information of the authoritative domain name server in the normal working state recorded in the first NS record, or may also include the newly added third authoritative domain name server.
  • An optional embodiment of the present invention further provides a method for obtaining a second NS record and an A record of the second NS:
  • the first authoritative domain name server deletes the domain in the first NS record that is in an abnormal working state (Part 20.6) Information about the server; or
  • the first authoritative domain name server replaces the newly added information of the domain name server that resolves the domain name with the information of the first NS record and the domain name server in the A record of the first NS that is in an abnormal working state.
  • the recursive server replaces the second NS record with the first NS record, and caches the A record of the second NS.
  • the recursive server can refresh the first NS record by using the second NS record, so that the information of the authoritative domain name server that is attacked or cannot work normally is recorded from the NS.
  • Deleted in the prior art avoiding the long-term impact on the DNS resolution caused by the TTL value imposed by the top-level domain management organization in the prior art, and avoiding the recursive server caused by modifying only the A record of the authoritative domain name server that is not working normally. Unable to refresh the NS record.
  • the second NS record received by the recursive server may be the same as the first NS record.
  • the recursive server directly updates according to the second NS record; another implementation manner is that the recursive server is determined.
  • the second NS record is different from the first NS record, the second NS record is replaced with the first NS record, and the A record of the second NS is cached.
  • the TTL (Time To Live) in the first NS record is strongly enforced by the top-level domain administrator as 172800 seconds, which is 48 hours, and cannot be changed.
  • the TTL value of the second NS record is set according to the second NS record obtained by the authoritative domain name server.
  • the TTL value of the lifetime of each authoritative domain name server can be set according to requirements. Wherein the TTL is ⁇ 172800 seconds.
  • the embodiment of the present invention adopts the NS record set by the authoritative domain name server itself, instead of using the NS record filled in the top-level domain when registering, can provide the domain name resolution service to the client more accurately.
  • Embodiment 2 Embodiment 2
  • the authoritative domain name servers in the first NS record are not suffered.
  • the DNS client sends a DNS request message (Ql in the figure) that resolves the example, aaa.com domain name to the configured recursive server (IP address 10.10.10.10). Equivalent to saying to the recursive server "Please give me example, the IP address corresponding to aaa. com".
  • the recursive server After receiving the request, the recursive server first queries the local cache. Assuming that the domain name corresponding record is not found, the recursive server sends a DNS request message (Q2 in the figure) to the configured root domain name server (IP address 20.20.20.20) to resolve the example, aaa.com domain name.
  • the root domain name server After receiving the query request, the root domain name server obtains the IP address of the top-level domain name server corresponding to the .com top-level domain name as 30.30.30.30, and then returns a response message (Al in the figure) to the recursive server. Quite that "I don't know the IP address of the example, aaa. com domain name, but I will tell you now.
  • the IP address of the top-level domain name server corresponding to the com domain name is 30.30.30.30".
  • the root domain name server can query the IP of the top-level domain name server corresponding to .com, and the IP of the top-level domain name server corresponding to .uk and the IP address of the top-level domain name server corresponding to .cn.
  • the recursive server After receiving the DNS response message from the root domain name server, the recursive server obtains the IP address 30.30.30.30 of the top-level domain name server corresponding to the .com, and then sends a request to the corresponding top-level domain name server to resolve the example, aaa.com DNS request message for the domain name (Q3 in the figure).
  • the .com top-level domain name server After receiving the DNS request message, the .com top-level domain name server first queries its own cache. If there is no record of the domain name, it queries the second-level domain name server corresponding to aaa.com, and then returns to the recursive server. A DNS response message (A3 in the figure). Equivalent to saying "I don't know the IP address corresponding to the example, aaa. com domain name, but I will tell you now that the aaa.com domain name corresponds.
  • the authoritative domain name server address is 40. 40. 40. 40 ".
  • the recursive server After receiving the DNS response message of the .com top-level domain name server, the recursive server obtains the IP address of the authoritative domain name server corresponding to aaa.com 40. 40. 40. 40, and then sends a corresponding message to the corresponding authoritative domain name server. Request to resolve the DNS request message for the example, aaa.com domain name (Q4 in the figure).
  • the aaa.com authoritative domain name server After the aaa.com authoritative domain name server receives the DNS request packet, it also checks its own cache. If there is no record of the domain name, the first one filled in by the example.aa.com in the top-level domain is filled in.
  • the NS record is sent to the recursive server, further assuming that the first NS record filled in by the example, aaa.com when registering in the top-level domain is as follows:
  • the first NS A record is as follows:
  • the first NS record is also stored in the authoritative domain name server in advance, that is, the first NS record is stored in the authoritative domain name server whose IP address is 1. 1. 1. 1; the IP address is 2. 2. 2.
  • the first NS record is also stored in the authoritative domain name server; the first NS record is also stored in the authoritative domain name server whose IP address is 3.3.3. 3.
  • the IP address is 4. 4. 4. 4
  • the first NS record is also stored in the authoritative domain name server; the first NS record is also stored in the authoritative domain name server with the IP address of 5.5.5.
  • Any one of the authoritative domain name servers in the first NS record may be accessed according to the first NS record. For example, access the authoritative domain name server nsl with an IP address of 1. 1. 1. 1.
  • the recursive server obtains the IP address corresponding to example, aaa.com through the authoritative domain name server nsl with the IP address L 1.1.1, assuming the IP address corresponding to the example, aaa.com in the authoritative domain name server nsl 8. 8. 8. 8, the authoritative domain name server nsl pre-stores the above-mentioned second NS record and the second NS A record (because the authoritative domain name server of the attacked or abnormal working state is not detected, It is still the first NS record) and the IP address corresponding to example, aaa.com is 8. 8. 8. 8 is sent to the recursive server.
  • the recursive server receives the IP address of the example. aaa. com returned by the authoritative domain name server ns l is 8. 8. 8. 8 , the IP address corresponding to the example, aaa. com is 8. 8 . 8. 8 Back
  • the normal resolution can be restored as soon as possible by deleting the authoritative domain name server that is attacked.
  • the authoritative domain name server nsl is attacked. Therefore, the authoritative domain name servers (ns2, ns3, ns4, ns5) of other normal services modify their own storage.
  • the authoritative domain name server ns l with the IP address of 1. 1. 1. 1 is deleted, and the second NS record is obtained, as follows:
  • the NS record stored by itself is also updated to ensure the accuracy of the NS record and the corresponding A record obtained by the upper layer name server.
  • client 1 performs the example, aaa. com domain name resolution through recursive server 1, and the NS record of the authoritative domain name server for aaa.com.
  • the client 2 performs the example, aaa.com domain name resolution through the recursive server 2. If the NS record of the upper-layer domain name server is not updated, the NS record obtained by the recursive server 2 still includes nsl in an abnormal working state. Therefore, the embodiment of the present invention also provides a way to update the upper layer name server, thereby ensuring that the recursive server obtains a valid NS record.
  • the A record corresponding to the NS record you can modify it, that is, delete the A information of ns l, or you can not modify it.
  • you can modify it that is, delete the A information of ns l, or you can not modify it.
  • the A record corresponding to the second NS record is:
  • the DNS client accesses the examplel.aaa.com site for the first time, the DNS client sends a resolution requestl. aaa.com domain name query request message to the configured recursive server (IP address 10. 10. 10.10). (Ql in the picture). This is equivalent to saying to the recursive server "Please give me the IP address corresponding to examplel. aaa. com".
  • the recursive server After receiving the request, the recursive server first queries the local cache. Since the recursive server has returned the domain name resolution result of example. aaa. com for the client, the recursive server determines the authoritative domain name server for the resolution according to the first NS record in the cache; wherein, the last domain name resolution is ns l right
  • the nsl authoritative domain name server is in an abnormal working state and cannot provide services for the recursive server.
  • the recursive server does not receive the rsl feedback analysis result after waiting for a period of time (Al in the figure). Therefore, the recursive server re-determines an authoritative domain name server according to the first NS record. If the re-selected authoritative domain name server is still in an abnormal working state, the recursive server selects again until the authoritative domain name server that can provide the resolution service is selected;
  • ns2 is in normal working state. Perform domain name resolution on examplel.aaa.com in the domain name query request message to obtain the corresponding IP address. Assuming that the IP address corresponding to examplel.aa.com is 9.9.9.9, ns2 will The IP address corresponding to the examplel.aaa.com is sent to the recursive server at 9.9.9.9, and the second NS record stored by itself and the A record corresponding to the second NS record are sent to the recursive server (A2 in the figure).
  • the recursive server After receiving the second NS record returned by the authoritative domain name server ns2, the recursive server determines whether the second NS record is the same as the first NS record, and if the second NS record is different from the first NS record, The second NS record replaces the first NS record.
  • the second NS record is as follows:
  • the second NS record is different from the first NS record, so the first NS record is replaced with the second NS record.
  • the NS records of the attacked nsl cached in the upper-level domain name server of the recursive server, the authoritative server, and the authoritative server have been deleted, so XXX. aaa. Com will not be directed to the attacked nsl, but will be resolved by the normal ns2, ns3, ns4, ns5 in the second NS record, which eliminates the impact of the attacked nsl on domain name resolution.
  • the recursive server will receive the IP address corresponding to the examplel.aa.com returned by ns2. 9. 9. 9. 9 is returned to the DNS client (A4 in the figure).
  • the IP address in the first NS record is 1. 1. 1.
  • the authoritative domain name server nsl is attacked, and therefore, the first NS record in each authoritative domain name server is detected.
  • the authoritative domain name server ns l with the IP address of 1. 1. 1. 1 is deleted, and in order to ensure the normal development of the service, an authoritative domain name server ns6 is added to the domain name resolution system, so each authoritative domain name server and authoritative domain name
  • the server's upper-level domain name server needs to update its stored NS record, which will delete the ns l information and increase the ns6 information in the first NS record.
  • the authoritative domain name server ns6 0 can be added by adding the following code to increase the IP address to 6. 6. 6. 6.
  • the NS records currently stored by the authoritative domain name servers that are working normally are the second NS records, as follows:
  • the corresponding A record of the second NS record is:
  • the information of the ns6 added in the second NS record is not configured by the top-level domain name server, so its life cycle can be self-set, thereby further making the update period of the NS record in the recursive server more flexible and shortened. Its update duration.
  • Ns6 is replaced by the normal service, so XXX.aa.com will not be directed to the attacked nsl, but will be resolved by the normal ns2, ns3, ns4, ns5, n6 in the second NS record.
  • the impact of the attacked nsl on domain name resolution is eliminated in time.
  • the update of the NS record may involve two changes to the authoritative domain name server name, such as abnormality in the first NS record.
  • the information of the working state of nsl is replaced by ns6, and the two records of nsl in the first NS need to be changed to ns6 (see the change in parentheses in the following example) to ns6: aaa. com. 172800 IN NS nsl ( ns6 ) aaa. com
  • the NS A record uses the generic domain name to point to the IP address format. Because the matching range of the generic domain name is relatively large, take *. ns l. aaa. com as an example, 1. nsl . Aaa.com, 2. nsl. aaa. com, 3. ns l. aaa. com, etc. all fall within the scope of nsl. aaa. com. Therefore, for each A information in the A record, as long as it is ensured that the authoritative domain name server corresponding to the A information in the NS record falls within the matching range of the A information, when the modification is performed, the A record may be The authoritative domain name server is not modified.
  • the second authoritative domain name server is modified into the third authoritative domain name server in the NS record, and the IP address corresponding to the pan domain name is modified in the corresponding A record of the NS.
  • the IP address of the third authoritative domain name server is modified into the third authoritative domain name server in the NS record.
  • pan-domain name to reduce the amount of modification and configuration.
  • the first NS record registered with the top-level domain server is as follows:
  • the first NS A record as follows
  • the first NS record configured on the authoritative domain name server is as follows:
  • nsl Aaa. com 7200 IN A 1. 1. 1. 1 "IP address in” 1. 1. 1. 1 "Modify to” 6. 6. 6. 6,,,, 2. 2.
  • nsl. aaa. Com Change the authoritative domain name server in the NS record to the lower-level domain name of the original authoritative domain name server.
  • the authoritative domain name server is changed to the sub-domain name of the lower-level domain name of the original authoritative domain name server. Therefore, the modification workload and domain name configuration can be reduced. Quantity, thereby improving the efficiency of authoritative domain name servers, Enhance the efficiency of domain name resolution.
  • the embodiment of the present invention can refresh the first NS record by using the second NS record returned by the first authoritative domain name server, wherein the second NS record records the record of the authoritative domain name server that can serve normally, and never The domain name resolution server is redirected to the authoritative domain name server of the second NS record to resolve the impact on the domain name resolution. Therefore, the domain name resolution can be improved. s efficiency.
  • the first authoritative domain name server returns the domain name to the authoritative domain name server
  • the TTL value in the second NS record can also refresh the TTL value in the first NS record, so that the TTL value of the 172800 that is currently enforced by the top-level domain management mechanism does not affect the DNS resolution for a long time.
  • an embodiment of the present invention further provides a recursive server, as shown in FIG. 4, including:
  • a memory 401 configured to store program instructions
  • the processor 402 is configured to invoke the program instructions stored in the memory, and execute according to the obtained program: receiving a domain name query request message, where the domain name query request message carries a domain name that is not cached in the recursive server; The first NS record corresponding to the domain name and the A record of the first NS determine the first authoritative domain name server, and send the domain name query request message to the first authoritative domain name server; receive the first authoritative domain name server to return The A record of the domain name, the second NS record, and the A record of the second NS, wherein the second NS record records an authoritative domain name server for parsing the domain name and is in a normal working state; Recording a method step of replacing the first NS record and buffering the A record of the second NS.
  • the processor 402 is further configured to: perform, according to the obtained program, determining, according to the first NS record corresponding to the domain name and the A record of the first NS, the second authoritative domain name server, where the second authoritative domain name server is in the recursive server The authoritative domain name server that successfully resolves the domain name of the same domain name; if the message returned by the second authoritative domain name server is not received, the first NS record corresponding to the domain name and the A record of the first NS are determined. The first authoritative domain name server; the second authoritative domain name server is not included in the second NS record.
  • Embodiments of the present invention also provide a computer storage medium storing computer executable instructions for causing the computer to perform the steps performed by the recursive server in the foregoing method.
  • the embodiment of the present invention further provides an authoritative domain name server, as shown in FIG. 5, including: a memory 501, configured to store program instructions;
  • the processor 502 is configured to invoke the program instructions stored in the memory, and execute according to the obtained program: receiving a domain name query request message sent by the recursive server, where the domain name query request message carries
  • Inclusion Determining a domain name that is not cached in the recursive server; the first authoritative domain name server is determined by the recursive server according to the first NS record and the A record of the first NS; and sending the A record of the domain name to the recursive server, The second NS record and the A record of the second NS, wherein the second NS record records the step of authenticating the domain name and the authoritative domain name server in a normal working state.
  • the processor 502 is further configured to: execute, according to the obtained program, deleting information of the domain name server in the non-normal working state of the first NS record and the A record of the first NS; or The information of the domain name server of the domain name replaces the information of the domain name server in the non-normal working state of the first NS record and the A record of the first NS.
  • the embodiment of the present invention further provides a computer storage medium storing computer executable instructions for causing the computer to execute the method steps performed by the authoritative domain name server in the foregoing embodiment.
  • the embodiment of the present invention further provides a DNS attack defense system, including a recursive server that performs the steps of the foregoing embodiments, and an authoritative domain name server that performs the steps of the foregoing embodiments.
  • embodiments of the present invention can be provided as a method, or computer program product.
  • the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • the invention can take the form of a computer program product embodied on one or more computer-available storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including program code available for the computer.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiments of the present invention relate to the field of network security technologies, and in particular, to a DNS attack defense method, a device, and a system. Background technique
  • the client When the client accesses a domain name, for example, accessing aaa.com, it will ask the recursive server for the A (Address) record of aaa.com. If the recursive server does not cache the A record of aaa.com, the recursive server will send the root domain name server to 0.
  • the top-level domain name server (.com) and the authoritative domain name server (aaa.com) recursively query the A record corresponding to aaa.com, and the top-level domain name server (.com) does not directly tell the A record corresponding to the recursive server aaa.com.
  • the NS (Name Server) record of the corresponding authoritative domain name server aaa.com is sent to the recursive server.
  • the NS record records the NS records of all authoritative domain name servers that can be used to resolve aaa.com, for example:
  • the A record of the NS record of the authoritative domain name server for example:
  • the recursive server selects one of the authoritative domain name servers for access, such as:
  • the recursive server initiates a domain name access request to the authoritative domain name server 1.1 ⁇ 1 to obtain the A record corresponding to aaa.com.
  • the authoritative domain name server 1.1 ⁇ 1 returns the A record corresponding to aaa.com to the recursive server to complete the complete resolution of a domain name. For example: aaa.com. 600 IN A 106.11.61.44
  • the last client accesses according to the IP address 106.11.61.44 corresponding to the domain name aaa.com.
  • TTL expiration time is generally set by the top-level domain management authority to 48 hours (nsl.aaadns.com. 172800 IN A 1.1.1.1), which will result in a large number of domain names for a long time. Can not be parsed, reducing the efficiency of domain name resolution.
  • the embodiment of the present invention provides a DNS attack defense method, device, and system, which are used to improve the efficiency of domain name resolution when an authoritative domain name server is attacked.
  • the foregoing embodiment provides a DNS attack defense method, device, and system, and the recursive server queries the first NS record corresponding to the unresolved domain name.
  • the first NS record records the authoritative domain name server that resolves the domain name; the recursive server determines the first authoritative domain name server; the first authoritative domain name server returns the A record in addition to the domain name a second NS record stored in an authoritative domain name server and an A record of the second NS, wherein the second NS record records an authoritative domain name server for parsing the domain name and is in a normal working state; the recursive server records the second NS Substituting the first NS record and buffering the A record of the second NS.
  • the recursive server uses the first NS record stored by itself to determine the first authoritative domain name server that resolves the domain name, and then refreshes the first NS record by using the second NS record returned by the working first authoritative domain name server, thereby Subject to The information of the authoritative domain name server that is attacked or not working is deleted from the NS record, so that the TTL value enforced by the top-level domain management organization does not affect the DNS resolution for a long time. Therefore, the efficiency of domain name resolution can be improved.
  • FIG. 1 is a schematic flowchart of a DNS attack defense method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a DNS attack defense method according to a second embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a recursive server according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an authoritative domain name server according to an embodiment of the present invention.
  • FIG. 1 is a schematic flow chart of a DNS attack defense method according to an embodiment of the present invention. As shown in FIG. 1, the method may include:
  • the recursive server receives a domain name query request message, where the domain name query request message carries a domain name that is not cached in the recursive server.
  • the recursive server After receiving the domain name query request packet, the recursive server determines whether the IP address information of the domain name corresponding to the domain name query request packet is not cached. If the IP address information of the domain name is cached, the client directly feeds back the domain name corresponding to the domain name. IP address information; if the IP address information of the domain name is not cached, it is required The authoritative domain name server that resolves the domain name is determined according to the NS record corresponding to the domain name.
  • the recursive server can use the IP corresponding to www.ddd.com.
  • the address is sent to the client; in another case, when the IP address corresponding to www.ddd.com is not cached in the recursive server configured by the client, the ND of ddd.com that has been cached in the server is recursively queried or recursively.
  • the record and the A record of the NS obtain the first NS record corresponding to the domain name query request message www.ddd.com and the A record of the first NS, that is, the NS responsible for resolving the authoritative domain name server of the domain name www.ddd.com Record and the A record of the NS.
  • the recursive server determines the first authoritative domain name server according to the first NS record corresponding to the domain name and the A record of the first NS, and sends the domain name query request message to the first authoritative domain name server;
  • the first NS record usually records a plurality of authoritative domain name servers that resolve the domain name, and the recursive server can randomly select an authoritative domain name server; usually, if the recursive server passes an authoritative domain name server (such as a second authoritative domain name server) If the domain name of the same domain name is resolved, the recursive server will use the second authoritative domain name server as the preferred server. For example, the domain name resolved this time is example.aaa.com, and the second authoritative domain name server has previously parsed xxx.aaa.com. The recursive server sends the domain name query request message to the second authoritative domain name server when parsing example.aaa.com.
  • the recursive server determines another authoritative domain name server (such as the first authority domain name server) to perform domain name resolution according to the first NS record and the A record of the first NS.
  • another authoritative domain name server such as the first authority domain name server
  • the recursive server determines another authoritative domain name server (such as the first authority domain name server) to perform domain name resolution according to the first NS record and the A record of the first NS.
  • the recursive server determines another authoritative domain name server (such as the first authority domain name server) to perform domain name resolution according to the first NS record and the A record of the first NS.
  • another authoritative domain name server such as the first authority domain name server
  • the A record, the second NS record, and the A record of the second NS returned by the first authoritative domain name server to the recursive server, where the second NS record records the domain name and is normal.
  • the first authoritative domain name server When the first authoritative domain name server is working normally, the first authoritative domain name server will return the parsed domain.
  • the content may be detected by each authoritative domain name server through a heartbeat message or the like, or may be obtained by updating the NS record according to the alarm information, or may be manually set. Take example.aaa.com as an example.
  • the initial storage of the authoritative domain name servers is the NS information that aaa.com fills in during registration. As the status of each authoritative domain name server corresponding to aaa.com changes, each authoritative domain name server will be updated.
  • the NS record corresponding to aaa.com stored by itself and the A record of NS.
  • each other authoritative domain name server that normally works will delete the information of the second authoritative domain name server from the NS record stored by itself, instead of modifying only the second authoritative domain name server.
  • the second NS record may be information of an authoritative domain name server in a normal working state recorded in the first NS record, or may also include a newly added third authoritative domain name server.
  • An optional embodiment of the present invention further provides a method for acquiring a second NS record and an A record of the second NS:
  • the first authoritative domain name server deletes information of the domain name server in the first NS record that is in an abnormal working state
  • the first authoritative domain name server replaces the newly added information of the domain name server that resolves the domain name with the information of the first NS record and the domain name server in the A record of the first NS that is in an abnormal working state.
  • the recursive server replaces the second NS record with the first NS record, and caches the A record of the second NS.
  • the recursive server can refresh the first NS record by using the second NS record, so that the information of the authoritative domain name server that is attacked or cannot work normally is recorded from the NS.
  • the second NS record received by the recursive server may be the same as the first NS record.
  • One implementation is that the recursive server directly updates according to the second NS record; another implementation manner is that the recursive server is determined.
  • the second NS record is different from the first NS record, the second NS record is replaced with the first NS record, and the A record of the second NS is cached.
  • the TTL (Time To Live) in the first NS record is strongly enforced by the top-level domain administrator as 172800 seconds, which is 48 hours, and cannot be changed.
  • the TTL value of the second NS record is set in the second NS record.
  • the TTL value of the lifetime of each authoritative domain name server can be set as required. Where the TTL is ⁇ 172800 seconds.
  • the embodiment of the present invention adopts the NS record set by the authoritative domain name server itself, instead of using the NS record filled in the top-level domain when registering, can provide the domain name resolution service to the client more accurately.
  • Embodiment 2 Embodiment 2
  • the DNS client sends a DNS request message (Q1 in the figure) that resolves the example.aaa.com domain name to the configured recursive server (IP address 10.10.10.10). This is equivalent to saying "Please give me the IP address corresponding to example.aaa.com” to the recursive server.
  • the recursive server After receiving the request, the recursive server first queries the local cache. Assuming that the domain name corresponding record is not found, the recursive server issues a DNS request message (Q2 in the figure) that resolves the request to resolve the domain name of example.aaa.com to the configured root domain name server (IP address 20.20.20.20). (3) After receiving the query request, the root domain name server obtains the IP address of the top-level domain name server corresponding to the .com top-level domain name as 30.30.30.30, and then returns a response message to the recursive server.
  • a DNS request message Q2 in the figure
  • the root domain name server can query the IP of the top-level domain name server corresponding to .com, and the IP of the top-level domain name server corresponding to .uk and the IP address of the top-level domain name server corresponding to .cn.
  • the recursive server After receiving the DNS response packet of the root domain name server and obtaining the IP address 30.30.30.30 of the top-level domain name server corresponding to the .com, the recursive server sends a request to the corresponding top-level domain name server to resolve example.aaa.com. DNS request message for the domain name (Q3 in the figure).
  • the .com top-level domain name server After the .com top-level domain name server receives the DNS request message, it first queries its own cache. If there is no record of the domain name, it queries the second-level domain name server corresponding to aaa.com, and then returns to the recursive server. A DNS response message (A3 in the figure). Equivalent to saying "I don't know the IP address corresponding to the example.aaa.com domain name, but I will tell you now that the authoritative domain name server address corresponding to the aaa.com domain name is 40.40.40.40".
  • the recursive server After receiving the DNS response packet of the .com top-level domain name server, the recursive server obtains the IP address 40.40.40.40 of the authoritative domain name server corresponding to aaa.com, and then sends a request to the corresponding authoritative domain name server to resolve the example. DNS request message for aaa.com domain name (Q4 in the figure).
  • the aaa.com authoritative domain name server After receiving the DNS request message, the aaa.com authoritative domain name server first checks its own cache. If there is no record of the domain name, the first one filled in when the example.aaa.com is registered in the top-level domain. The NS record is sent to the recursive server, further assuming that the first NS record filled by example.aaa.com when registering in the top-level domain is as follows:
  • the first NS record is also pre-stored in each authoritative domain name server, that is, the first NS record is stored in an authoritative domain name server whose IP address is 1.1.1.1; and the authoritative domain name server whose IP address is 2.2.2.2 is also stored.
  • the first NS record is also stored; the first NS record is also stored in the authoritative domain name server whose IP address is 3.3.3.3; the first NS record is also stored in the authoritative domain name server whose IP address is 4.4.4.4; the IP address is
  • the first NS record described above is also stored in the authoritative domain name server of 5.5.5.5.
  • the recursive server may access any of the authoritative domain name servers in the first NS record according to the first NS record. For example, access the authoritative name server nsl with an IP address of 1.1.
  • the recursive server obtains the IP address corresponding to example.aaa.com through the authoritative domain name server nsl with IP address 1.1 ⁇ 1, assuming the IP address corresponding to example.aaa.com in the authoritative domain name server nsl 8.8.8.8, the authoritative domain name server nsl pre-stores the above-mentioned second NS record and the second NS A record (because the authoritative domain name server of the attacked or abnormal working state is not detected, it is still the first The NS record) and the IP address corresponding to example.aaa.com are sent to the recursive server from 8.8.8.8.
  • the normal resolution can be restored as soon as possible by deleting the authoritative domain name server that is attacked.
  • Each authoritative domain name server is subjected to a detailed explanation of the access process when it is attacked.
  • the authoritative domain name server nsl whose IP address is 1.1.1.1 in the first NS record is attacked, therefore, the authoritative domain name servers (ns2, ns3, ns4, ns5) of other normal services modify their stored NS records.
  • the authoritative domain name server nsl with the IP address of 1.1 ⁇ 1 is deleted, and the second NS record is obtained, as follows:
  • the upper-level domain name server of the authoritative domain name server (nsl, ns2, ns3, ns4, ns5) also updates the NS record stored by itself, thereby ensuring the accuracy of obtaining the NS record and the corresponding A record through the upper-level domain name server.
  • client 1 performs the example.aaa.com domain name resolution through recursive server 1, and the NS record of the authoritative domain name server for aaa.com.
  • ns5 changes, the corresponding NS records on the authoritative domain name server and the recursive server 1 corresponding to ns2, ns3, ns4, and ns5 are updated, that is, the authoritative domain name servers currently working normally are ns2, ns3, ns4, and ns5.
  • the client 2 performs the example.aaa.com domain name resolution through the recursive server 2. If the NS record of the upper-level domain name server is not updated, the NS record obtained by the recursive server 2 still includes the nsl in the abnormal working state.
  • embodiments of the present invention also provide a way to update an upper level domain name server to ensure that the recursive server obtains a valid NS record.
  • the corresponding A record of the second NS record is:
  • the DNS client accesses the examplel .aaa.com site for the first time, the DNS client sends a request for resolving the examplel .aaa.com domain name query request message to the configured recursive server (IP address 10.10.10.10). Ql). This is equivalent to saying "Please give me the IP address corresponding to examplel.aaa.com" to the recursive server.
  • the recursive server After receiving the request, the recursive server first queries the local cache. Since the recursive server has returned the domain name resolution result of example.aaa.com for the client, the recursive server determines the authoritative domain name server for the resolution according to the first NS record in the cache; wherein, the last domain name resolution is the nsl authoritative domain name. The server completes, so the recursive server sends a resolution request to the nsl authoritative domain name server with IP address 1.1.1.1 (Q2 in the figure);
  • the nsl authoritative domain name server is in an abnormal working state and cannot provide services for the recursive server.
  • the recursive server does not receive the rsl feedback analysis result after waiting for a while (Al in the figure). Therefore, the recursive server re-determines an authoritative domain name server according to the first NS record. If the re-selected authoritative domain name server is still in an abnormal working state, the recursive server selects again until the authoritative domain name server that can provide the resolution service is selected;
  • ns2 is in normal working state, domain name resolution is performed on examplel.aaa.com in the domain name query request message, and the corresponding IP address is obtained. Assuming that the IP address corresponding to examplel.aaa.com is 9.9.9.9, ns2 will The IP address corresponding to examplel.aaa.com is 9.9.9.9 and sent to the recursive server to send the second NS record stored by itself and the A record corresponding to the second NS record to the recursive server (A2 in the figure).
  • the recursive server determines whether the second NS record is the same as the first NS record, and if the second NS record is different from the first NS record, The second NS record replaces the first NS record.
  • the first NS record is as follows:
  • the second NS record is as follows:
  • the second NS record is different from the first NS record, so the first NS record is replaced with the second NS record.
  • other similar domain name such as xxx. Aaa.
  • Com again to resolve the request recursive server, since the NS record level domain recursive servers, and authoritative servers authoritative server in the server cache attacked nsl has been deleted, it xxx.aaa. Com will not be directed to the attacked nsl, but will be resolved by the normal ns2, ns3, ns4, ns5 in the second NS record, which eliminates the impact of the attacked nsl on domain name resolution.
  • the recursive server will return the IP address 9.9.9.9 corresponding to examplel .aaa.com returned by ns2 to the DNS client (A4 in the figure).
  • Embodiment 4
  • the authoritative domain name server ns1 with the IP address of 1.1.1.1 in the first NS record is attacked. Therefore, the IP address of the first NS record in each authoritative domain name server is 1 ⁇ 1.1
  • the authoritative domain name server nsl is deleted, and in order to ensure the normal development of the service, an authoritative domain name server ns6 is added to the domain name resolution system, so each authoritative domain name service
  • the upper-level domain name server of the authoritative domain name server needs to update its stored NS record, that is, the information of nsl is deleted in the first NS record and the information of ns6 is added.
  • the authoritative domain name server ns6 with an IP address of 6.6.6.6 can be added by writing the following code.
  • the NS records currently stored by the authoritative domain name servers that are working normally are the second NS records, as follows:
  • the corresponding A record of the second NS record is:
  • the information of the ns6 added in the second NS record is not configured by the top-level domain name server, so its life cycle can be self-set, thereby further making the update period of the NS record in the recursive server more flexible and shortened. Its update duration.
  • Ns6 has been replaced by normal service, so xxx.aaa.com will not be directed to the attacked nsl, but will be resolved by the normal ns2, ns3, ns4, ns5, n6 in the second NS record. Eliminated the attacked nsl domain name resolution Impact.
  • the update of the NS record may involve two changes to the authoritative domain name server name, such as abnormality in the first NS record.
  • the information of the working state of nsl is replaced by ns6, and the two records of nsl in the first NS need to be changed to ns6 (see the change in parentheses in the following example) to ns6: aaa.com. 172800 IN NS nsl (ns6 ) .aaa.com
  • the NS A record uses the generic domain name to point to the IP address. Because the matching range of the generic domain name is relatively large, take *.nsl.aaa.com as an example. 1. nsl . aaa .com, 2. nsl. aaa.com, 3. nsl. aaa.com, etc. ⁇ falls within the range of *. nsl. aaa.com. For each A information in the A record, the ancient woman only needs to ensure that the authoritative domain name server corresponding to the A information in the NS record falls within the matching range of the A information, and may be in the A record when the modification is made. The authoritative domain name server is not modified.
  • the second authoritative domain name server is modified into the third authoritative domain name server in the NS record, and the IP address corresponding to the pan domain name is modified in the corresponding A record of the NS.
  • the IP address of the third authoritative domain name server is modified into the third authoritative domain name server in the NS record.
  • pan-domain name to reduce the amount of modification and configuration.
  • the first NS record registered with the top-level domain server is as follows:
  • the first NS A record is as follows:
  • the first NS record configured on the authoritative domain name server is as follows:
  • the authoritative domain name server in the NS record is changed to the lower-level domain name form of the original authoritative domain name server, and the authoritative domain name server is changed into the pan-domain name form of the lower-level domain name of the original authoritative domain name server in the A record. Therefore, the workload of the modification and the configuration of the domain name can be reduced, thereby improving the working efficiency of the authoritative domain name server, thereby improving the efficiency of domain name resolution.
  • an embodiment of the present invention can be returned by using the first authoritative domain name server.
  • the second NS record refreshes the first NS record, wherein the second NS record records the record of the authoritative domain name server that can serve normally, thereby no longer exposing the attacked authoritative domain name server, so that the domain name resolution request is guided to the second
  • the NS records the authoritative domain name server that can be serviced to resolve the impact on the domain name resolution of the attacked domain name server. Therefore, the efficiency of domain name resolution can be improved.
  • the TTL value in the second NS record can also refresh the TTL value in the first NS record, so that the TTL value of the 172800 that is currently enforced by the top-level domain management mechanism does not affect the DNS resolution for a long time.
  • an embodiment of the present invention further provides a recursive server, as shown in FIG. 4, including:
  • a memory 401 configured to store program instructions
  • the processor 402 is configured to invoke the program instructions stored in the memory, and execute according to the obtained program: receiving a domain name query request message, where the domain name query request message carries a domain name that is not cached in the recursive server; The first NS record corresponding to the domain name and the A record of the first NS determine the first authoritative domain name server, and send the domain name query request message to the first authoritative domain name server; receive the first authoritative domain name server to return The A record of the domain name, the second NS record, and the A record of the second NS, wherein the second NS record records an authoritative domain name server for parsing the domain name and is in a normal working state; Recording a method step of replacing the first NS record and buffering the A record of the second NS.
  • the processor 402 is further configured to: perform, according to the obtained program, determining, according to the first NS record corresponding to the domain name and the A record of the first NS, the second authoritative domain name server, where the second authoritative domain name server is in the recursive server The authoritative domain name server of the same domain name that has successfully resolved the domain name; if the message returned by the second authoritative domain name server is not received, the first NS record corresponding to the domain name and the A record of the first NS are determined. The first authoritative domain name server; the second authoritative domain name server is not included in the second NS record.
  • An embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, where the computer executable instructions are used to cause the computer to execute the foregoing method.
  • the embodiment of the present invention further provides an authoritative domain name server, as shown in FIG. 5, including: a memory 501, configured to store program instructions;
  • the processor 502 is configured to invoke the program instructions stored in the memory, and execute according to the obtained program: receiving a domain name query request message sent by the recursive server, where the domain name query request message carries the cached server in the recursive server
  • the first authoritative domain name server is determined by the recursive server according to the first NS record and the A record of the first NS; and the A record, the second NS record, and the second of the domain name are sent to the recursive server.
  • the A record of the NS, wherein the second NS record records the step of authoritative domain name server for parsing the domain name and in a normal working state.
  • the processor 502 is further configured to: execute, according to the obtained program, deleting information of the domain name server in the non-normal working state of the first NS record and the A record of the first NS; or The information of the domain name server of the domain name replaces the information of the domain name server in the non-normal working state of the first NS record and the A record of the first NS.
  • the embodiment of the present invention further provides a computer storage medium storing computer executable instructions for causing the computer to execute the method steps performed by the authoritative domain name server in the foregoing embodiment.
  • the embodiment of the present invention further provides a DNS attack defense system, including a recursive server that performs the steps of the foregoing embodiments, and an authoritative domain name server that performs the steps of the foregoing embodiments.
  • a DNS attack defense system including a recursive server that performs the steps of the foregoing embodiments, and an authoritative domain name server that performs the steps of the foregoing embodiments.
  • the present invention is directed to a method, apparatus (system), and computer program product according to an embodiment of the present invention.
  • the flow chart and / or block diagram to describe. It will be understood that each flow and/or block of the flowcharts and/or block diagrams, and combinations of flow and I or blocks in the flowcharts and I or block diagrams can be implemented by computer program instructions.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例提供了一种DNS防攻击方法,包括:递归服务器接收域名查询请求报文;递归服务器根据域名对应的第一NS记录及第一NS的A记录确定第一权威域名服务器,并向所述第一权威域名服务器发送所述域名查询请求报文;所述递归服务器接收所述第一权威域名服务器返回的所述域名的A记录、第二NS记录及第二NS的A记录,所述第二NS记录中记载着用于解析所述域名且处于正常工作状态的权威域名服务器;所述递归服务器将所述第二NS记录替换所述第一NS记录,并缓存所述第二NS的A记录。可以看出,能够利用第一权威域名服务器返回的第二域名服务器NS记录刷新第一NS记录,从而不再暴露受攻击的权威域名服务器,因此,能够提升域名解析的效率。

Description

一种 DNS防攻击方法、 设备和系统 技术领域
本发明实施例涉及网络安全技术领域, 尤其涉及一种 DNS 防攻击方法、 设 备和系统。 背景技术
当前互联网上的网络攻击日益频繁, 攻击形式也日益多样, 其中针对 DNS ( Domain Name System , 域名系统)服务器的大规模 DDoS ( Distributed Den ial of Service , 分布式拒绝服务) 攻击影响尤为严重。
当客户端访问一个域名时,例如访问 aaa. com,会向递归服务器询问 aaa. com 的 A (Address ) 记录, 若递归服务器也没有缓存 aaa. com的 A记录, 递归服务 器会向根域名服务器(.)、 顶级域名服务器(. com)、 权威域名服务器(aaa. com) 递归查询 aaa. com对应的 A记录, 顶级域名服务器(. com)不会直接告诉递归服 务器 aaa. com所对应的 A记录, 而是将对应的权威域名服务器(aaa. com)的 NS ( Name Server )记录发送给递归服务器, NS记录中记载了可用于解析 aaa. com 的所有权威域名服务器的 NS记录, 例如:
aaa. com. 172800 IN NS ns l. aaadns. com.
aaa. com. 172800 IN NS ns2. aaadns. com.
aaa. com. 172800 IN NS ns3. aaadns. com.
aaa. com. 172800 IN NS ns4. aaadns. com.
权威域名服务器的 NS记录的 A记录, 例如:
nsl . aaadns. com. 172800 INA 1. 1. 1. 1
ns2. aaadns. com. 172800 INA 2. 2. 2. 2
ns3. aaadns. com. 172800 INA 3. 3. 3. 3 援引加入 (细则 20.6) ns4.aaadns. com. 172800IN A 4.4.4.4
然后, 递归服务器选择其中一个权威域名服务器进行访问, 如:
aaa. com. 172800 IN NS nsl. aaadns. com.
nsl. aaadns. com. 172800 INA 1.1.1.1
递归服务器向权威域名服务器 1.1.1.1 发起域名访问请求以获取 aaa.com 对应的 A记录, 权威域名服务器 1.1.1.1向递归服务器返回 aaa. com对应的 A 记录, 以完成一个域名的完整解析。 例如: aaa.com. 600 IN A 106.11.61.44
最后客户端根据该域名 aaa. com对应的 IP地址 106.11.61.44进行访问。 由于递归服务器后续会将权威域名服务器 1.1.1.1作为 aaa. com同类域名 解析的首选服务器。若权威域名服务器 1.1.1.1被攻击,由于 NS的过期时间 (TTL) 一般被顶级域管理机构强制定为 48 小时 (nsl.aaadns.com. 172800 IN A 1.1.1.1), 将导致大量域名长时间无法被解析, 降低了域名解析的效率。 发明内容
本发明实施例提供一种 DNS 防攻击方法、 设备和系统, 用以解决在权威域 名服务器被攻击时如何提升域名解析的效率。
本发明实施例提供了一种 DNS防攻击方法, 包括:
递归服务器接收域名査询请求报文, 所述域名查询请求报文中携带有所述 递归服务器中未缓存的域名;
所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A记录确定 第一权威域名服务器, 并向所述第一权威域名服务器发送所述域名查询请求报 文;
所述递归服务器接收所述第一权威域名服务器返回的所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所述域名 且处于正常工作状态的权威域名服务器;
2
援引加入 (细则 20.6) 所述递归服务器将所述第二 NS记录替换所述第一 NS记录, 并缓存所述第 二 NS的 A记录。
可选地, 所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A 记录确定第一权威域名服务器之前, 还包括:
所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A记录确定 第二权威域名服务器, 所述第二权威域名服务器是所述递归服务器中记录的已 成功解析所述域名的同类域名的权威域名服务器;
所述递归服务器在未接收到所述第二权威域名服务器返回的消息时, 根据 所述域名对应的第一 NS记录及第一 NS的 A记录确定所述第一权威域名服务器; 所述第二 NS记录中不包括所述第二权威域名服务器。
可选地, 所述递归服务器将所述第二 NS记录替换所述第一 NS记录, 并缓 存所述第二 NS的 A记录, 包括:
所述递归服务器在确定所述第二 NS记录与所述第一 NS记录不同时, 将所 述第二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录。
可选地, 所述第一 NS的 A记录和所述第二 NS的 A记录均采用泛域名指向 IP地址的形式;
针对所述第一 NS的 A记录和所述第二 NS的 A记录中的每个 A信息, 在 NS 记录中与所述 A信息对应的权威域名服务器落入所述 A信息的匹配范围内。
可选地, 第一权威域名服务器接收递归服务器发送的域名查询请求报文, 所述域名查询请求报文中携带有所述递归服务器中未缓存的域名; 所述第一权 威域名服务器是所述递归服务器根据第一 NS记录及第一 NS的 A记录确定的; 所述第一权威域名服务器向所述递归服务器发送所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所述域名且处 于正常工作状态的权威域名服务器。
可选地, 所述第二 NS记录及第二 NS的 A记录通过以下方式得到: 所述第一权威域名服务器删除所述第一 NS记录及第一 NS的 A记录中处于
3
援引加入 (细则 20.6) 非正常工作状态的域名服务器的信息; 或
所述第一权威域名服务器将新增的解析所述域名的域名服务器的信息替换 所述第一 NS记录及第一 NS的 A记录中处于非正常工作状态的域名服务器的信 息。
可选地, 所述第一权威域名服务器的上层域名服务器配置有所述第二 NS记 录及所述第二 NS的 A记录。
相应地, 本发明实施例提供了一种递归服务器, 包括:
存储器, 用于存储程序指令;
处理器, 用于调用所述存储器中存储的程序指令, 按照获得的程序执行: 递归服务器接收域名查询请求报文, 所述域名查询请求报文中携带有所述递归 服务器中未缓存的域名; 所述递归服务器根据所述域名对应的第一 NS记录及第 一 NS的 A记录确定第一权威域名服务器, 并向所述第一权威域名服务器发送所 述域名查询请求报文; 所述递归服务器接收所述第一权威域名服务器返回的所 述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着 用于解析所述域名且处于正常工作状态的权威域名服务器; 所述递归服务器将 所述第二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录。
本发明实施例提供了一种权威域名服务器, 包括:
存储器, 用于存储程序指令;
处理器, 用于调用所述存储器中存储的程序指令, 按照获得的程序执行: 第一权威域名服务器接收递归服务器发送的域名查询请求报文, 所述域名查询 请求报文中携带有所述递归服务器中未缓存的域名; 所述第一权威域名服务器 是所述递归服务器根据第一 NS记录及第一 NS的 A记录确定的; 所述第一权威 域名服务器向所述递归服务器发送所述域名的 A记录、 第二 NS记录及第二 NS 的 A记录, 所述第二 NS记录中记载着用于解析所述域名且处于正常工作状态的 权威域名服务器。
本发明实施例提供了一种计算机存储介质, 所述计算机存储介质存储有计
4
援引加入 (细则 20.6) 算机可执行指令, 所述计算机可执行指令用于使所述计算机执行上述任一种方 法。
本发明实施例提供了一种 DNS 防攻击系统, 包括上述递归服务器及上述权 威域名服务器。
上述实施例提供一种 DNS 防攻击方法、 设备和系统, 递归服务器查询未解 析过的域名对应的第一 NS记录及第一 NS的 A记录, 第一 NS记录中记载着解析 该域名的权威域名服务器; 递归服务器从中确定第一权威域名服务器; 第一权 威域名服务器除了返回该域名的 A记录, 还会返回第一权威域名服务器中存储 的第二 NS记录及第二 NS的 A记录, 该第二 NS记录中记载着用于解析该域名且 处于正常工作状态的权威域名服务器; 递归服务器将所述第二 NS记录替换所述 第一 NS记录, 并缓存所述第二 NS的 A记录。 可以看出, 递归服务器利用自身 存储的第一 NS记录来确定解析该域名的第一权威域名服务器, 然后通过正常工 作的第一权威域名服务器返回的第二 NS记录刷新第一 NS记录, 从而将受攻击 或不能正常工作的权威域名服务器的信息从 NS记录中删除掉, 使得被顶级域管 理机构强制设置的 TTL值不会对 DNS解析造成长时间的影响, 因此, 能够提升 域名解析的效率。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所 需要使用的附图作简要介绍。
图 1为本发明实施例提供的一种 DNS防攻击方法的流程示意图;
图 2为本发明二实施例提供的一种 DNS防攻击方法的流程示意图; 图 3为本发明三实施例提供的一种 DNS防攻击方法的流程示意图; 图 4为本发明实施例提供的一种递归服务器的结构示意图;
图 5为本发明实施例提供的一种权威域名服务器的结构示意图。
5
援引加入 (细则 20.6) 具体实施方式
为了使本发明的目的、 技术方案及有益效果更加清楚明白, 以下结合附图 及实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施 例仅仅用以解释本发明, 并不用于限定本发明。
实施例一
图 1示例性示出了本发明实施例提供的一种 DNS防攻击方法的流程示意图, 如图 1所示, 该方法可包括:
S10K 递归服务器接收域名查询请求报文, 所述域名查询请求报文中携带 有所述递归服务器中未缓存的域名;
递归服务器在接收到域名查询请求报文之后, 确定是否未缓存该域名查询 请求报文对应的域名的 IP地址信息, 若缓存有该域名的 IP地址信息, 则直接 向客户端反馈该域名对应的 IP地址信息; 若没有缓存该域名的 IP地址信息则 需要根据该域名对应的 NS记录来确定解析该域名的权威域名服务器。
例如, 若客户端想要访问 www. ddd. com, 而客户端所配置的递归服务器中缓 存了 www. ddd. com所对应的 IP地址, 则递归服务器可将 w . ddd. com所对应的 IP 地址发送给客户端; 另一种情况是在客户端所配置的递归服务器中未缓存 www. ddd. com所对应的 IP地址时, 则通过递归查询或者递归服务器中已经缓存 的 ddd. com的 NS记录及该 NS的 A记录获得域名查询请求报文 www. ddd. com所 对应的第一 NS记录及第一 NS的 A记录, 也即得到负责解析域名 www. ddd. com的 权威域名服务器的 NS记录及该 NS的 A记录。
S102、 所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A记 录确定第一权威域名服务器, 并向所述第一权威域名服务器发送所述域名查询 请求报文;
第一 NS记录中通常记载着多个解析该域名的权威域名服务器, 递归服务器 可随机的从中选择一个权威域名服务器; 通常, 若递归服务器之前通过某一个 权威域名服务器 (如第二权威域名服务器) 解析过该域名同类的域名, 则递归
6
援引加入 (细则 20.6) 服务器会将第二权威域名服务器作为首选服务器, 例如此次解析的域名为 example, aaa. com , 而第二权威域名服务器之前解析过 xxx. aaa. com , 则此次解 析 example. aaa. com 时递归服务器会将域名查询请求报文发送给第二权威域名 服务器。 如果递归服务器未接收到第二权威域名服务器返回的消息时, 则递归 服务器根据第一 NS记录及第一 NS的 A记录确定另一个权威域名服务器 (如第 一权威域名月艮务器)来进行域名解析。 以 example, aaa. com , xxx. aaa. com为例, 两者均是 aaa. com 的二级域名, 通常将上下级域名及同级域名归为同类域名, 同类域名通常对应同一组权威域名服务器。
S 103、 第一权威域名服务器向所述递归服务器返回的所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所述域名 且处于正常工作状态的权威域名服务器。
在第一权威域名服务器正常工作时, 第一权威域名服务器会返回解析的域 名的的 A记录; 除此之外, 第一权威域名服务器还会返回第二 NS记录及第二 NS 的 A记录; 第二 NS记录中记载着正常工作的权威域名服务器, 第二 NS记录中 的内容可以是各权威域名服务器通过心跳报文等机制互相检测得到的, 也可以 是根据报警信息更新 NS 记录得到的, 也可以是人为设置的等等。 以 example, aaa. com为例,各权威域名服务器中初始存储的是 aaa. com在注册时填 写的 NS信息, 随着 aaa. com对应的各权威域名服务器的状态变化, 各权威域名 服务器会更新自身存储的 aaa. com对应的 NS记录及 NS的 A记录。 以第二权威 域名服务器遭受 DDoS攻击为例, 此时各其它正常工作的权威域名服务器会将第 二权威域名服务器的信息从自身存储的 NS记录中删除, 而不是仅修改第二权威 域名服务器的 A记录, 从而实现刷新 NS记录得到第二 NS记录。 第二 NS记录可 以是第一 NS记录中记载的处于正常工作状态的权威域名服务器的信息、 或还包 括新增的第三权威域名服务器。 可选的本发明实施例还提供了一种获取第二 NS 记录及第二 NS的 A记录的方式:
所述第一权威域名服务器删除所述第一 NS记录中处于非正常工作状态的域 援引加入 (细则 20.6) 名服务器的信息; 或
所述第一权威域名服务器将新增的解析所述域名的域名服务器的信息替换 所述第一 NS记录及第一 NS的 A记录中处于非正常工作状态的域名服务器的信 息。
S104、 所述递归服务器将所述第二 NS记录替换所述第一 NS记录, 并缓存 所述第二 NS的 A记录。
由于第二 NS记录中删除了非正常工作的权威域名服务器的信息, 递归服务 器通过第二 NS记录就可以刷新第一 NS记录, 从而将受攻击或不能正常工作的 权威域名服务器的信息从 NS记录中删除掉, 避免了现有技术中由于顶级域管理 机构强制设置的 TTL值而造成对 DNS解析的长时间影响, 也避免了仅修改非正 常工作的权威域名服务器的 A 记录而导致的递归服务器无法刷新 NS 记录的问 题。
在步骤 104中, 递归服务器接收的第二 NS记录与第一 NS记录有可能相同, 一种实现方式是递归服务器直接根据第二 NS记录进行更新; 另一种实现方式为 所述递归服务器在确定所述第二 NS记录与所述第一 NS记录不同时, 将所述第 二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录。
可选的, 第一 NS记录中的 TTL (Time To Live , 过期时间) 被顶级域管理 机构强制定为 172800秒, 即 48小时, 且无法更改。 本发明实施例由于是在权 威域名服务器中得到的第二 NS记录, 因此第二 NS记录中的生存时间 TTL值是 可以设置的, 具体实践中可根据需要设置各权威域名服务器的生存时间 TTL值, 其中, 所述 TTL< 172800秒。 本发明实施例采用权威域名服务器自身设定的 NS 记录, 而非采用注册时在顶级域名填写的 NS记录, 可以更准确的为客户端提供 域名解析服务。 实施例二
下面通过一个具体的例子, 对第一 NS记录中的各权威域名服务器未遭受到
8
援引加入 (细则 20.6) 攻击时的访问流程进行详细的解释说明。
参见图 2, 假设客户端想要访问自己并未缓存的 example, aaa.com站点, 并 假设此客户端配置的递归服务器的 IP地址为 10.10.10.10, 递归服务器上配置 的根域名服务器的 IP地址为 20.20.20.20。 整个递归名称解析过程如图 2所示 (其中的 Q广 Q5表示发送 DNS查询请求, A广 A5是 DNS查询应答), 具体流程如 下:
(1) DNS客户端向所配置的递归服务器 (IP地址 10.10.10.10) 发出解析 example, aaa. com域名的 DNS请求报文(图中的 Ql)。相当于对递归服务器说"请 给我 example, aaa. com所对应的 IP地址"。
(2) 递归服务器收到请求后, 先查询本地缓存。 假设没有查到该域名对应 记录, 则递归服务器向所配置的根域名服务器 (IP地址 20.20.20.20) 发出解 析请求解析 example, aaa. com域名的 DNS请求报文 (图中的 Q2)。
(3)根域名服务器收到查询请求后, 通过查询得到 .com顶级域名所对应的 顶级域名服务器的 IP地址为 30.30.30.30, 然后向递归服务器返回一条应答报 文 (图中的 Al)。 相当说 "我不知道 example, aaa. com域名所对应的 IP地址, 但我现在告诉你. com域名所对应的顶级域名服务器的 IP地址为 30.30.30.30"。
在实际应用中, 根域名服务器除了可查询得到. com所对应的顶级域名服务 器的 IP, 还可查询得到 .uk所对应的顶级域名服务器的 IP、 .cn所对应的顶级 域名服务器的 IP、 . org所对应的顶级域名服务器的 IP等。
(4)递归服务器在收到根域名服务器的 DNS应答报文, 得到. com所对应的 顶级域名服务器的 IP地址 30.30.30.30后, 再次向对应的顶级域名服务器发送 一条请求解析 example, aaa. com域名的 DNS请求报文 (图中的 Q3)。
(5) .com顶级域名服务器在收到 DNS请求报文后, 先查询自己的缓存, 假 设也没有该域名的记录, 则查询 aaa.com 所对应的二级域名服务器, 然后也向 递归服务器返回一条 DNS 应答报文 (图中的 A3)。 相当于说 "我不知道 example, aaa. com域名所对应的 IP地址, 但我现在告诉你 aaa. com域名所对应
9
援引加入 (细则 20.6) 的权威域名服务器地址为 40. 40. 40. 40 "。
( 6 )递归服务器在收到. com顶级域名服务器的 DNS应答报文,得到 aaa. com 所对应的权威域名服务器的 IP地址 40. 40. 40. 40后, 再次向对应的权威域名服 务器发送一条请求解析 example, aaa. com域名的 DNS请求报文 (图中的 Q4)。
( 7 ) aaa. com权威域名服务器在收到 DNS请求报文后, 也先查自己的缓存, 假设也没有该域名的记录, 则将 example. aaa. com在顶级域注册时所填写的第 一 NS记录发送给递归服务器, 进一步假设 example, aaa. com在顶级域注册时所 填写的第一 NS记录, 如下:
aaa. com. 172800 IN NS nsl. aaa. com
aaa. com. 172800 IN NS ns2. aaa. com
aaa. com. 172800 IN NS ns3. aaa. com
aaa. com. 172800 IN NS ns4. aaa. com
aaa. com. 172800 IN NS ns5. aaa. com
第一 NS的 A记录, 如下:
nsl. aaa. com 172800 IN A 1. 1. 1. 1
ns2. aaa. com 172800 IN A 2. 2. 2. 2
ns3. aaa. com 172800 IN A 3. 3. 3. 3
ns4. aaa. com 172800 IN A 4. 4. 4. 4
ns5. aaa. com 172800 IN A 5. 5. 5. 5
所述第一 NS 记录也预先存储在各权威域名服务器中, 即在 IP 地址为 1. 1. 1. 1的权威域名服务器中存储有上述第一 NS记录; IP地址为 2. 2. 2. 2的权 威域名服务器中也存储有上述第一 NS记录; IP地址为 3. 3. 3. 3的权威域名服务 器中也存储有上述第一 NS记录; IP地址为 4. 4. 4. 4的权威域名服务器中也存储 有上述第一 NS记录; IP地址为 5. 5. 5. 5的权威域名服务器中也存储有上述第一 NS记录。
( 8 )递归服务器在收到 aaa. com权威域名服务器所返回的第一 NS记录后,
10
援引加入 (细则 20.6) 可根据第一 NS记录, 访问第一 NS记录中任意一个权威域名服务器。 例如, 访 问 IP地址为 1. 1. 1. 1的权威域名服务器 nsl。
( 9 ) 递归服务器通过 IP地址为 L 1. 1. 1的权威域名服务器 nsl可获取到 example, aaa. com 对应的 IP 地址, 假设在权威域名服务器 nsl 中 example, aaa. com所对应的 IP地址为 8. 8. 8. 8, 则权威域名服务器 nsl将自己 本身预先存储的上述第二 NS记录及第二 NS的 A记录 (由于未检测到受攻击或 非正常工作状态的权威域名服务器, 故依然是第一 NS 记录) 以及 example, aaa. com所对应的 IP地址为 8. 8. 8. 8一起发送给递归服务器。
( 10 ) 递归服务器在接收到权威域名服务器 ns l 返回的 example. aaa. com 所对应的 IP地址为 8. 8. 8. 8后,将 example, aaa. com所对应的 IP地址为 8. 8. 8. 8 返回
给客户端 (图中的 A5 )。
实施例三
在权威域名服务器遭受到攻击的情况下, 可通过删除受到攻击的权威域名 服务器的方式以尽快恢复正常的解析。
基于上述实施例二的基础上, 下面通过一个具体的例子, 对第一 NS记录中 各权威域名服务器遭受到攻击时的访问流程进行详细的解释说明。
假设检测到第一 NS记录中的 IP地址为 1. 1. 1. 1的权威域名服务器 nsl遭 受到攻击, 因此, 其它正常服务的权威域名服务器 (ns2、 ns3、 ns4、 ns5 ) 修 改自身存储的 NS记录中, 将 IP地址为 1. 1. 1. 1的权威域名服务器 ns l进行删 除, 得到第二 NS记录, 如下:
com. 172800 IN NS ns2. 3,3,3,, com
3,3,3,, com. 172800 IN NS ns3. com
com. 172800 IN NS ns4. com
3,3,3,, com. 172800 IN NS ns5. com
可选的, 权威域名服务器 (ns l、 ns2、 ns3、 ns4、 ns5 ) 的上层域名服务器
11
援引加入 (细则 20.6) 也对自身存储的 NS记录进行更新, 从而确保通过上层域名服务器来获取 NS记 录和对应的 A记录的准确性。如客户端 1通过递归服务器 1进行 example, aaa. com 域名解析,在针对 aaa. com.的权威域名服务器的 NS记录(由 ns l、 ns2、 ns3、 ns4、 ns5变更为 ns2、 ns3、 ns4、 ns5)发生变化时, ns2、 ns3、 ns4、 ns5对应的权威 域名服务器和递归服务器 1上对应的 NS记录已更新, 即目前正常工作的权威域 名服务器为 ns2、 ns3、 ns4、 ns5。 此时, 客户端 2 通过递归服务器 2 进行 example, aaa. com域名解析, 如果上层域名服务器的 NS记录没有更新, 则递归 服务器 2得到的 NS记录中依然会包括处于非正常工作状态的 nsl。 故本发明实 施例也提供了一种更新上层域名服务器的方式, 从而确保递归服务器获得有效 的 NS记录。
对于 NS记录对应的 A记录, 可以进行修改, 即删除 ns l的 A信息, 也可以 不做修改。 在不删除时, 由于 NS记录中己没有 ns l, 故 A记录中即便有 ns l的 A信息也没有影响, 在生命周期到达时会自动清除。 可选的, 第二 NS记录对应 的 A记录为:
ns2. aaa. com 172800 IN A 2. 2. 2. 2
ns3. aaa. com 172800 IN A 3. 3. 3. 3
ns4. aaa. com 172800 IN A 4. 4. 4. 4
ns5. aaa. com 172800 IN A 5. 5. 5. 5
如图 3所示:
( 1 )假设 DNS客户端第一次访问 examplel . aaa. com站点, DNS客户端向所 配置的递归服务器(IP地址 10. 10. 10. 10 ) 发出解析 examplel. aaa. com域名查 询请求报文 (图中的 Ql )。 相当于对递归服务器说 "请给我 examplel. aaa. com 所对应的 IP地址"。
( 2 ) 递归服务器收到请求后, 先查询本地缓存。 由于递归服务器之前为客 户端返回过 example. aaa. com 的域名解析结果, 故递归服务器会根据缓存中的 第一 NS记录确定此次解析的权威域名服务器; 其中, 上一次域名解析是 ns l权
12
援引加入 (细则 20.6) 威域名服务器完成的, 所以递归服务器向 IP地址为 1.1.1.1的 nsl权威域名服 务器发出解析请求 (图中的 Q2);
(3) nsl权威域名服务器由于受到了攻击, 处于非正常工作状态, 无法为 递归服务器提供服务, 递归服务器在等待一段时间后不会收到 nsl 反馈的解析 结果 (图中 Al)。 所以递归服务器会根据第一 NS记录重新确定一个权威域名服 务器, 若再次选择的权威域名服务器依然处于非正常工作状态, 则递归服务器 会再次选取, 直至选取到可提供解析服务的权威域名服务器;
(4)假设递归服务器选取了 ns2, 则向 IP地址为 2.2.2.2的 ns2发送域名 查询请求消息 (图中的 Q3);
(5) ns2处于正常工作状态, 对域名查询请求消息中的 examplel.aaa.com 进行域名解析, 得到对应的 IP地址, 假设 examplel. aaa. com所对应的 IP地址 为 9.9.9.9,则 ns2将 examplel. aaa. com所对应的 IP地址为 9.9.9.9发送给递 归服务器并将自己本身存储的上述第二 NS记录以及第二 NS记录对应的 A记录 发送给递归服务器 (图中的 A2)。
(6) 递归服务器在接收到权威域名服务器 ns2返回的第二 NS记录后, 判 断第二 NS记录是否与第一 NS记录相同, 若发现第二 NS记录与第一 NS记录不 相同, 则用第二 NS记录替换第一 NS记录。
此时, 第一 NS记录, 如下:
com. 172800 IN NS nsl. aaa. com
3,3,3,, com. 172800 IN NS ns2. aaa. com
3,3,3,, com. 172800 IN NS ns3. aaa. com
com. 172800 IN NS ns4. aaa. com
3,3,3,, com. 172800 IN NS ns5. aaa. com
而第二 NS记录如下:
aaa. com. 172800 IN NS ns2. aaa. com
aaa. com. 172800 IN NS ns3. aaa. com 援引加入 (细则 20.6) aaa. com. 172800 IN NS ns4. aaa. com
aaa. com. 172800 IN NS ns5. aaa. com
可以看出, 第二 NS记录与第一 NS记录不相同, 因此, 用第二 NS记录替换 第一 NS记录。 当其它同类域名如 XXX. aaa. com再次向递归服务器请求解析时, 由于递归服务器、 权威服务器及权威服务器的上层域名服务器中缓存的被攻击 的 nsl的 NS记录已经被删除, 故 XXX. aaa. com不会被引导到被攻击的 nsl上, 而是由第二 NS记录中能够正常服务的 ns2、 ns3、 ns4、 ns5负责解析, 及时消 除了被攻击的 nsl对域名解析的影响。
( 7 )递归服务器将接收到 ns2返回的 examplel. aaa. com所对应的 IP地址 9. 9. 9. 9返回给所述 DNS客户端 (如图中的 A4 )。 实施例四
在权威域名服务器遭受到攻击的情况下, 为了保证业务不受影响, 还可通 过增加权威域名服务器替换掉被攻击的权威域名服务器的方式预防攻击。
基于上述实施例三的基础上, 假设检测到第一 NS 记录中的 IP 地址为 1. 1. 1. 1的权威域名服务器 nsl遭受到攻击, 因此, 将各权威域名服务器中的第 一 NS记录中 IP地址为 1. 1. 1. 1的权威域名服务器 ns l进行删除, 同时为了保 证业务的正常开展, 在域名解析系统中新增一台权威域名服务器 ns6, 因而各权 威域名服务器及权威域名服务器的上层域名服务器需要更新自身存储的 NS 记 录, 即将第一 NS记录中删除 ns l的信息并增加 ns6的信息。
具体的, 可通过写入如下代码实现增加 IP地址为 6. 6. 6. 6的权威域名服务 器 ns60
aaa. com 600 IN NS ns6. aaa. com
ns6. aaa. com 7200 IN A 6. 6. 6. 6
在权威域名服务器删除 nsl增加 ns6之后, 各正常工作的权威域名服务器 现在存储的 NS记录为第二 NS记录, 如下:
14
援引加入 (细则 20.6) com. 172800 IN NS ns2. com
3,3,3,, com. 172800 IN NS ns3. com
com. 172800 IN NS ns4. com
com. 172800 IN NS ns5. 3,3,9,. com
com. 7200 IN NS ns6. com
第二 NS记录对应的 A记录为:
ns6. 3,9,9,. com 7200 IN A 6. 6. 6. 6
ns2. 3,9,3,. com 172800 IN A 2. 2. 2. 2
ns3. 3,9,3,. com 172800 IN A 3. 3. 3. 3
ns4. 3,9,3,. com 172800 IN A 4. 4. 4. 4
ns5. 9,9,3,. com 172800 IN A 5. 5. 5. 5
可以看出在第二 NS记录中新增的 ns6的信息由于不是顶级域名服务器配置 的, 故其生命周期可以自设定, 从而进一步使得递归服务器中的 NS记录的更新 期更灵活, 也缩短了其更新时长。
同样的, 当其它同类域名如 xxx. aaa. com再次向递归服务器请求解析时, 由于递归服务器、 权威服务器及权威服务器的上层域名服务器 (例如顶级域名 服务器) 中缓存的被攻击的 nsl 的 NS 记录己经能正常服务的 ns6 替换, 故 XXX . aaa. com不会被引导到被攻击的 nsl上, 而是由第二 NS记录中能够正常服 务的 ns2、 ns3、 ns4、 ns5、 n6负责解析, 及时消除了被攻击的 nsl对域名解析 的影响。
实施例五
基于上述各个实施例, 若存在新增的权威域名服务器替换非正常工作的权 威域名服务器时, 对 NS记录的更新会涉及两次对权威域名服务器名称的更改, 如将第一 NS记录中非正常工作状态的 nsl的信息替换为 ns6,需要将第一 NS中 的 nsl的两条记录中 nsl (见如下示例中括号内为更改后的) 更改为 ns6: aaa. com. 172800 IN NS nsl ( ns6 ) . aaa. com
15
援引加入 (细则 20.6) nsl ( ns6 ) . aaa. com 172800 IN A 1. 1. 1. 1
为了减少修改量及配置量, 可选的, NS的 A记录采用泛域名指向 IP地址的 形式, 因为泛域名的匹配范围比较大, 以 *. ns l. aaa. com为例, 1. nsl . aaa. com、 2. nsl. aaa. com , 3. ns l . aaa. com等等都落入 nsl. aaa. com 的匹酉己范围内。 故 针对 A记录中的每个 A信息, 只要确保在 NS记录中与所述 A信息对应的权威域 名服务器落入所述 A信息的匹配范围内, 则在进行修改时, 可以对 A记录中的 权威域名服务器不进行修改。 在新增第三权威域名服务器替换第二权威域名服 务器时, 在 NS记录中将第二权威域名服务器修改为第三权威域名服务器, 在对 应的 NS的 A记录中将泛域名对应的 IP地址修改为第三权威域名服务器的 IP地 址。
下面通过一个具体的例子, 对利用泛域名能够减少修改量及配置量进行详 细的解释说明。
例如, 在顶级域名服务器注册的第一 NS记录, 如下:
aaa. com 172800 IN NS 1. ns l. com
aaa. com 172800 IN NS 1. ns2. 3,3,3,. com
aaa. com 172800 IN NS 1. ns3. com
aaa. com 172800 IN NS 1. ns4. com
aaa. com 172800 IN NS 1. ns5. com
第一 NS的 A记录, 如下
1. ns l. aaa. com 172800 IN A 1. 1. 1. 1
1. ns2. aaa. com 172800 IN A 2. 2. 2. 2
1. ns3. aaa. com 172800 IN A 3. 3. 3. 3
1. ns4. aaa. com 172800 IN A 4. 4. 4. 4
1. ns5. aaa. com 172800 IN A 5. 5. 5. 5
而在权威域名服务器上配置的第一 NS记录, 如下:
aaa. com 7200 IN NS 1. nsl. aaa. com
16
援引加入 (细则 20.6) 9,3,9,. com 7200 IN NS 1. ns2. 9,9,9,. com
9,9,9,. com 7200 IN NS 1. ns3. 9,9,3,. com
9,3,9,. com 7200 IN NS 1. ns4. 9,9,3,. com
9,3,9,. com 7200 IN NS 1. ns5. 9,9,3,. com
第一 NS的 A 记录:
ns l. 3,3,9,. com 7200 IN A 1. 1. 1. 1
. ns2. 9,9,9,. com 7200 IN A 2. 2. 2. 2
ns3. 9,9,9,. com 7200 IN A 3. 3. 3. 3
ns4. 3,3,9,. com 7200 IN A 4. 4. 4. 4
ns5. 9,3,9,. com 7200 IN A 5. 5. 5. 5
在权威域名服务器 nsl 受到攻击的情况下, 需要新增一个权威域名服务器 替换 nsl, 因此, 需要分别修改权威域名服务器及权威域名服务器的上层域名服 务器 (顶级域名服务器) 上配置的第一 NS 记录, 只需要将 " 1. nsl. aaa. com " 修改为 " 2. ns l. aaa. com "或 " 3. nsl. aaa. com " 或 " 4. nsl. aaa. com "等, 同 时, 将 nsl. aaa. com 7200 IN A 1. 1. 1. 1 " 中的 IP地址 " 1. 1. 1. 1 "修改 为 " 6. 6. 6. 6,,即可, " 2. nsl. aaa. com,,、 " 3. nsl. aaa. com " 、 "4. nsl. aaa. com " 都会落入泛域名 *. nsl. aaa. com的解析范围。 可以看出, 在本发明实施例中, 将 NS记录中权威域名服务器变为原权威域名服务器的下级域名形式, 在 A记录中 将权威域名服务器变为原权威域名服务器的下级域名的泛域名形式, 因此, 能 够减少修改工作量及域名配置量, 从而提升权威域名服务器的工作效率, 进而 提升域名解析效率。
根据以上内容可以看出, 本发明实施例能够利用第一权威域名服务器返回 的第二 NS记录刷新第一 NS记录, 其中第二 NS记录中记载着能正常服务的权威 域名服务器的记录, 从而不再暴露受攻击的权威域名服务器, 使得域名解析请 求均被引导到第二 NS记录的能正常服务的权威域名服务器来解析, 减少受攻击 的域名服务器对域名解析的影响, 因此, 能够提升域名解析的效率。 此外, 第
17
援引加入 (细则 20.6) 二 NS记录中的 TTL值还能够刷新第一 NS记录中的 TTL值, 从而使得目前顶级 域管理机构强制设置的 172800的 TTL值不对 DNS解析造成长时间的影响。
基于相同的技术构思, 本发明实施例还提供了一种递归服务器, 如图 4 所 示, 包括:
存储器 401, 用于存储程序指令;
处理器 402,用于调用所述存储器中存储的程序指令,按照获得的程序执行: 接收域名查询请求报文, 所述域名查询请求报文中携带有所述递归服务器中未 缓存的域名; 根据所述域名对应的第一 NS记录及第一 NS的 A记录确定第一权 威域名服务器, 并向所述第一权威域名服务器发送所述域名查询请求报文; 接 收所述第一权威域名服务器返回的所述域名的 A记录、 第二 NS记录及第二 NS 的 A记录, 所述第二 NS记录中记载着用于解析所述域名且处于正常工作状态的 权威域名服务器; 将所述第二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录的方法步骤。
处理器 402, 还用于按照获得的程序执行: 根据所述域名对应的第一 NS记 录及第一 NS的 A记录确定第二权威域名服务器, 所述第二权威域名服务器是所 述递归服务器中记录的已成功解析所述域名的同类域名的权威域名服务器; 在 未接收到所述第二权威域名服务器返回的消息时, 根据所述域名对应的第一 NS 记录及第一 NS的 A记录确定所述第一权威域名服务器; 所述第二 NS记录中不 包括所述第二权威域名服务器。
本发明实施例还提供了一种计算机存储介质, 所述计算机存储介质存储有 计算机可执行指令, 所述计算机可执行指令用于使所述计算机执行前述方法中 递归服务器所实施的步骤。
本发明实施例还提供了一种权威域名服务器, 如图 5所示, 包括: 存储器 501, 用于存储程序指令;
处理器 502,用于调用所述存储器中存储的程序指令,按照获得的程序执行: 接收递归服务器发送的域名查询请求报文, 所述域名查询请求报文中携带有所
18
援引加入 (细则 20.6) 述递归服务器中未缓存的域名; 所述第一权威域名服务器是所述递归服务器根 据第一 NS记录及第一 NS的 A记录确定的;向所述递归服务器发送所述域名的 A 记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所 述域名且处于正常工作状态的权威域名服务器的步骤。
所述处理器 502, 还用于按照获得的程序执行: 删除所述第一 NS记录及第 一 NS的 A记录中处于非正常工作状态的域名服务器的信息; 或, 将新增的解析 所述域名的域名服务器的信息替换所述第一 NS记录及第一 NS的 A记录中处于 非正常工作状态的域名服务器的信息。
本发明实施例还提供了一种计算机存储介质, 计算机存储介质存储有计算 机可执行指令, 所述计算机可执行指令用于使所述计算机执行前述实施例中的 权威域名服务器所执行的方法步骤。
本发明实施例还提供了一种 DNS 防攻击系统, 包括如执行前述实施例步骤 的递归服务器及执行前述实施例步骤的权威域名服务器。
本领域内的技术人员应明白, 本发明的实施例可提供为方法、 或计算机程 序产品。 因此, 本发明可采用完全硬件实施例、 完全软件实施例、 或结合软件 和硬件方面的实施例的形式。 而且, 本发明可采用在一个或多个其中包含有计 算机可用程序代码的计算机可用存储介质 (包括但不限于磁盘存储器、 CD-R0M、 光学存储器等) 上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、 设备 (系统)、 和计算机程序产品 的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图和 / 或方框图中的每一流程和 I或方框、 以及流程图和 I或方框图中的流程和 I或 方框的结合。 可提供这些计算机程序指令到通用计算机、 专用计算机、 嵌入式 处理机或其他可编程数据处理设备的处理器以产生一个机器, 使得通过计算机 或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流 程或多个流程和 /或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备
19
援引加入 (细则 20.6) 以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存储器中的 指令产生包括指令装置的制造品, 该指令装置实现在流程图一个流程或多个流 程和 /或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上, 使 得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处 理, 从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例, 但本领域内的技术人员一旦得知了基 本创造性概念, 则可对这些实施例作出另外的变更和修改。 所以, 所附权利要 求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发 明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权利要求及 其等同技术的范围之内, 则本发明也意图包含这些改动和变型在内。
20
援引加入 (细则 20.6) 一种 DNS防攻击方法、 设备和系统 技术领域
本发明实施例涉及网络安全技术领域, 尤其涉及一种 DNS防攻击方法、 设 备禾口系统。 背景技术
当前互联网上的网络攻击日益频繁, 攻击形式也日益多样, 其中针对 DNS (Domain Name System,域名系统)服务器的大规模 DDoS (Distributed Denial of Service, 分布式拒绝服务) 攻击影响尤为严重。
当客户端访问一个域名时,例如访问 aaa.com,会向递归服务器询问 aaa.com 的 A (Address) 记录, 若递归服务器也没有缓存 aaa.com的 A记录, 递归服务 器会向根域名服务器 0、 顶级域名服务器 (.com)、 权威域名服务器 (aaa.com)递归 查询 aaa.com对应的 A记录, 顶级域名服务器 (.com)不会直接告诉递归服务器 aaa.com所对应的 A记录, 而是将对应的权威域名服务器aaa.com)的 NS (Name Server) 记录发送给递归服务器, NS记录中记载了可用于解析 aaa.com的所有 权威域名服务器的 NS记录, 例如:
aaa.com. 172800 IN NS nsl .aaadns.com.
aaa.com. 172800 IN NS ns2.aaadns.com.
aaa.com. 172800 IN NS ns3.aaadns.com.
aaa.com. 172800 IN NS ns4.aaadns.com.
权威域名服务器的 NS记录的 A记录, 例如:
nsl .aaadns.com. 172800 IN A 1.1.1.1
ns2.aaadns.com. 172800 IN A 2.2.2.2
ns3.aaadns.com. 172800 IN A 3.3.3.3
ns4.aaadns.com. 172800IN A 4.4.4.4 然后, 递归服务器选择其中一个权威域名服务器进行访问, 如:
aaa.com. 172800 IN NS nsl .aaadns.com.
nsl .aaadns.com. 172800 IN A 1.1.1.1
递归服务器向权威域名服务器 1.1丄1发起域名访问请求以获取 aaa.com对 应的 A记录,权威域名服务器 1.1丄 1向递归服务器返回 aaa.com对应的 A记录, 以完成一个域名的完整解析。 例如: aaa.com. 600 IN A 106.11.61.44 最后客户端根据该域名 aaa.com对应的 IP地址 106.11.61.44进行访问。
由于递归服务器后续会将权威域名服务器 1.1.1.1作为 aaa.com同类域名解 析的首选服务器。 若权威域名服务器 1.1丄 1被攻击, 由于 NS的过期时间 (TTL) 一般被顶级域管理机构强制定为 48 小时 (nsl .aaadns.com. 172800 IN A 1.1.1.1 ) , 将导致大量域名长时间无法被解析, 降低了域名解析的效率。 发明内容
本发明实施例提供一种 DNS防攻击方法、 设备和系统, 用以解决在权威域 名服务器被攻击时如何提升域名解析的效率。
【此部分内容与权利要求基本一致, 待审核通过后, 由代理人进行补充】 上述实施例提供一种 DNS防攻击方法、 设备和系统, 递归服务器查询未解 析过的域名对应的第一 NS记录及第一 NS的 A记录, 第一 NS记录中记载着解 析该域名的权威域名服务器; 递归服务器从中确定第一权威域名服务器; 第一 权威域名服务器除了返回该域名的 A记录, 还会返回第一权威域名服务器中存 储的第二 NS记录及第二 NS的 A记录, 该第二 NS记录中记载着用于解析该域 名且处于正常工作状态的权威域名服务器;递归服务器将所述第二 NS记录替换 所述第一 NS记录, 并缓存所述第二 NS的 A记录。 可以看出, 递归服务器利用 自身存储的第一 NS记录来确定解析该域名的第一权威域名服务器,然后通过正 常工作的第一权威域名服务器返回的第二 NS记录刷新第一 NS记录, 从而将受 攻击或不能正常工作的权威域名服务器的信息从 NS记录中删除掉,使得被顶级 域管理机构强制设置的 TTL值不会对 DNS解析造成长时间的影响, 因此, 能够 提升域名解析的效率。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所 需要使用的附图作简要介绍。
图 1为本发明实施例提供的一种 DNS防攻击方法的流程示意图; 图 2为本发明二实施例提供的一种 DNS防攻击方法的流程示意图; 图 3为本发明三实施例提供的一种 DNS防攻击方法的流程示意图; 图 4为本发明实施例提供的一种递归服务器的结构示意图;
图 5为本发明实施例提供的一种权威域名服务器的结构示意图。
具体实施方式
为了使本发明的目的、 技术方案及有益效果更加清楚明白, 以下结合附图 及实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施 例仅仅用以解释本发明, 并不用于限定本发明。
实施例一
图 1 示例性示出了本发明实施例提供的一种 DNS 防攻击方法的流程示意 图, 如图 1所示, 该方法可包括:
S101、 递归服务器接收域名查询请求报文, 所述域名查询请求报文中携带 有所述递归服务器中未缓存的域名;
递归服务器在接收到域名查询请求报文之后, 确定是否未缓存该域名查询 请求报文对应的域名的 IP地址信息, 若缓存有该域名的 IP地址信息, 则直接向 客户端反馈该域名对应的 IP地址信息;若没有缓存该域名的 IP地址信息则需要 根据该域名对应的 NS记录来确定解析该域名的权威域名服务器。
例如, 若客户端想要访问 www.ddd.com, 而客户端所配置的递归服务器中 缓存了 www.ddd.com所对应的 IP地址, 则递归服务器可将 www.ddd.com所对 应的 IP地址发送给客户端; 另一种情况是在客户端所配置的递归服务器中未缓 存 www.ddd.com所对应的 IP地址时,则通过递归查询或者递归服务器中已经缓 存的 ddd.com的 NS记录及该 NS的 A记录获得域名查询请求报文 www.ddd.com 所对应的第一 NS记录及第一 NS的 A记录,也即得到负责解析域名 www.ddd.com 的权威域名服务器的 NS记录及该 NS的 A记录。
5102、所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A记 录确定第一权威域名服务器, 并向所述第一权威域名服务器发送所述域名查询 请求报文;
第一 NS记录中通常记载着多个解析该域名的权威域名服务器,递归服务器 可随机的从中选择一个权威域名服务器; 通常, 若递归服务器之前通过某一个 权威域名服务器 (如第二权威域名服务器) 解析过该域名同类的域名, 则递归 服务器会将第二权威域名服务器作为首选服务器, 例如此次解析的域名为 example.aaa.com, 而第二权威域名服务器之前解析过 xxx.aaa.com, 则此次解析 example.aaa.com 时递归服务器会将域名查询请求报文发送给第二权威域名服务 器。 如果递归服务器未接收到第二权威域名服务器返回的消息时, 则递归服务 器根据第一 NS记录及第一 NS的 A记录确定另一个权威域名服务器(如第一权 威域名服务器) 来进行域名解析。 以 example.aaa.com、 xxx.aaa.com为例, 两者 均是 aaa.com的二级域名, 通常将上下级域名及同级域名归为同类域名, 同类域 名通常对应同一组权威域名服务器。
5103、 第一权威域名服务器向所述递归服务器返回的所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所述域 名且处于正常工作状态的权威域名服务器。
在第一权威域名服务器正常工作时, 第一权威域名服务器会返回解析的域 名的的 A记录; 除此之外, 第一权威域名服务器还会返回第二 NS记录及第二 NS的 A记录; 第二 NS记录中记载着正常工作的权威域名服务器, 第二 NS记 录中的内容可以是各权威域名服务器通过心跳报文等机制互相检测得到的, 也 可以是根据报警信息更新 NS 记录得到的, 也可以是人为设置的等等。 以 example.aaa.com为例, 各权威域名服务器中初始存储的是 aaa.com在注册时填 写的 NS信息, 随着 aaa.com对应的各权威域名服务器的状态变化, 各权威域名 服务器会更新自身存储的 aaa.com对应的 NS记录及 NS的 A记录。 以第二权威 域名服务器遭受 DDoS攻击为例, 此时各其它正常工作的权威域名服务器会将 第二权威域名服务器的信息从自身存储的 NS记录中删除,而不是仅修改第二权 威域名服务器的 A记录, 从而实现刷新 NS记录得到第二 NS记录。 第二 NS记 录可以是第一 NS记录中记载的处于正常工作状态的权威域名服务器的信息、或 还包括新增的第三权威域名服务器。 可选的本发明实施例还提供了一种获取第 二 NS记录及第二 NS的 A记录的方式:
所述第一权威域名服务器删除所述第一 NS 记录中处于非正常工作状态的 域名服务器的信息; 或
所述第一权威域名服务器将新增的解析所述域名的域名服务器的信息替换 所述第一 NS记录及第一 NS的 A记录中处于非正常工作状态的域名服务器的信 息。
S104、 所述递归服务器将所述第二 NS记录替换所述第一 NS记录, 并缓存 所述第二 NS的 A记录。
由于第二 NS记录中删除了非正常工作的权威域名服务器的信息,递归服务 器通过第二 NS记录就可以刷新第一 NS记录, 从而将受攻击或不能正常工作的 权威域名服务器的信息从 NS记录中删除掉,避免了现有技术中由于顶级域管理 机构强制设置的 TTL值而造成对 DNS解析的长时间影响,也避免了仅修改非正 常工作的权威域名服务器的 A记录而导致的递归服务器无法刷新 NS记录的问 题。 在步骤 104中,递归服务器接收的第二 NS记录与第一 NS记录有可能相同, 一种实现方式是递归服务器直接根据第二 NS记录进行更新;另一种实现方式为 所述递归服务器在确定所述第二 NS记录与所述第一 NS记录不同时, 将所述第 二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录。
可选的, 第一 NS记录中的 TTL (Time To Live, 过期时间) 被顶级域管理 机构强制定为 172800秒, 即 48小时, 且无法更改。 本发明实施例由于是在权 威域名服务器中得到的第二 NS记录,因此第二 NS记录中的生存时间 TTL值是 可以设置的,具体实践中可根据需要设置各权威域名服务器的生存时间 TTL值, 其中,所述 TTL< 172800秒。本发明实施例采用权威域名服务器自身设定的 NS 记录, 而非采用注册时在顶级域名填写的 NS记录, 可以更准确的为客户端提供 域名解析服务。 实施例二
下面通过一个具体的例子,对第一 NS记录中的各权威域名服务器未遭受到 攻击时的访问流程进行详细的解释说明。
参见图 2, 假设客户端想要访问自己并未缓存的 example.aaa.com站点, 并 假设此客户端配置的递归服务器的 IP地址为 10.10.10.10, 递归服务器上配置的 根域名服务器的 IP地址为 20.20.20.20。 整个递归名称解析过程如图 2所示 (其 中的 Q1 Q5表示发送 DNS查询请求, A1 A5是 DNS查询应答), 具体流程如 下:
( 1 ) DNS客户端向所配置的递归服务器 (IP地址 10.10.10.10) 发出解析 example.aaa.com域名的 DNS请求报文(图中的 Q1 )。相当于对递归服务器说"请 给我 example.aaa.com所对应的 IP地址"。
(2) 递归服务器收到请求后, 先查询本地缓存。 假设没有查到该域名对应 记录, 则递归服务器向所配置的根域名服务器 (IP地址 20.20.20.20) 发出解析 请求解析 example.aaa.com域名的 DNS请求报文 (图中的 Q2 )。 ( 3 )根域名服务器收到查询请求后, 通过查询得到 .com顶级域名所对应的 顶级域名服务器的 IP地址为 30.30.30.30, 然后向递归服务器返回一条应答报文
(图中的 Al )。 相当说 "我不知道 example.aaa.com域名所对应的 IP地址, 但我 现在告诉你 .com域名所对应的顶级域名服务器的 IP地址为 30.30.30.30"。
在实际应用中, 根域名服务器除了可查询得到 .com所对应的顶级域名服务 器的 IP, 还可查询得到 .uk所对应的顶级域名服务器的 IP、 .cn所对应的顶级域 名服务器的 IP、 .org所对应的顶级域名服务器的 IP等。
(4 ) 递归服务器在收到根域名服务器的 DNS应答报文, 得到. com所对应 的顶级域名服务器的 IP地址 30.30.30.30后,再次向对应的顶级域名服务器发送 一条请求解析 example.aaa.com域名的 DNS请求报文 (图中的 Q3 )。
( 5 ) .com顶级域名服务器在收到 DNS请求报文后, 先查询自己的缓存, 假设也没有该域名的记录, 则查询 aaa.com所对应的二级域名服务器, 然后也向 递归服务器返回一条 DNS 应答报文 (图中的 A3 )。 相当于说 "我不知道 example.aaa.com域名所对应的 IP地址, 但我现在告诉你 aaa.com域名所对应的 权威域名服务器地址为 40.40.40.40"。
(6 )递归服务器在收到. com顶级域名服务器的 DNS应答报文,得到 aaa.com 所对应的权威域名服务器的 IP地址 40.40.40.40后,再次向对应的权威域名服务 器发送一条请求解析 example.aaa.com域名的 DNS请求报文 (图中的 Q4 )。
(7 ) aaa.com权威域名服务器在收到 DNS请求报文后,也先查自己的缓存, 假设也没有该域名的记录, 则将 example.aaa.com在顶级域注册时所填写的第一 NS记录发送给递归服务器, 进一步假设 example.aaa.com在顶级域注册时所填 写的第一 NS记录, 如下:
aaa.com. 172800 IN NS nsl .aaa.com
aaa.com. 172800 IN NS ns2.aaa.com
aaa.com. 172800 IN NS ns3.aaa.com
aaa.com. 172800 IN NS ns4.aaa.com
aaa.com. 172800 IN NS ns5.aaa.com 第一 NS的 A记录, 如下
nsl .aaa.com 172800 IN A 1.1.1.1
ns2.aaa.com 172800 IN A 2.2.2.2
ns3.aaa.com 172800 IN A 3.3.3.3
ns4.aaa.com 172800 IN A 4.4.4.4
ns5.aaa.com 172800 IN A 5.5.5.5
所述第一 NS记录也预先存储在各权威域名服务器中,即在 IP地址为 1.1.1.1 的权威域名服务器中存储有上述第一 NS记录; IP地址为 2.2.2.2的权威域名服 务器中也存储有上述第一 NS记录; IP地址为 3.3.3.3的权威域名服务器中也存 储有上述第一 NS记录; IP地址为 4.4.4.4的权威域名服务器中也存储有上述第 一 NS记录; IP地址为 5.5.5.5的权威域名服务器中也存储有上述第一 NS记录。
( 8 )递归服务器在收到 aaa.com权威域名服务器所返回的第一 NS记录后, 可根据第一 NS记录, 访问第一 NS记录中任意一个权威域名服务器。 例如, 访 问 IP地址为 1丄 1.1的权威域名服务器 nsl。
( 9 ) 递归服务器通过 IP地址为 1.1丄 1 的权威域名服务器 nsl 可获取到 example.aaa.com对应的 IP地址,假设在权威域名月艮务器 nsl中 example.aaa.com 所对应的 IP地址为 8.8.8.8, 则权威域名服务器 nsl将自己本身预先存储的上述 第二 NS记录及第二 NS的 A记录(由于未检测到受攻击或非正常工作状态的权 威域名服务器, 故依然是第一 NS记录) 以及 example.aaa.com所对应的 IP地址 为 8.8.8.8—起发送给递归服务器。
( 10 ) 递归服务器在接收到权威域名服务器 nsl返回的 example.aaa.com所 对应的 IP地址为 8.8.8.8后,将 example.aaa.com所对应的 IP地址为 8.8.8.8返回 给客户端 (图中的 A5 )。
实施例三
在权威域名服务器遭受到攻击的情况下, 可通过删除受到攻击的权威域名 服务器的方式以尽快恢复正常的解析。
基于上述实施例二的基础上, 下面通过一个具体的例子, 对第一 NS记录中 各权威域名服务器遭受到攻击时的访问流程进行详细的解释说明。
假设检测到第一 NS记录中的 IP地址为 1.1.1.1的权威域名服务器 nsl遭受 到攻击, 因此, 其它正常服务的权威域名服务器 (ns2、 ns3、 ns4、 ns5 ) 修改自 身存储的 NS记录中, 将 IP地址为 1.1丄 1的权威域名服务器 nsl进行删除, 得 二 NS记录, 如下:
aaa.com. 172800 IN NS ns2.aaa.com
aaa.com. 172800 IN NS ns3.aaa.com
aaa.com. 172800 IN NS ns4.aaa.com
aaa.com. 172800 IN NS ns5.aaa.com
可选的, 权威域名服务器 (nsl、 ns2、 ns3、 ns4、 ns5 ) 的上层域名服务器 也对自身存储的 NS记录进行更新, 从而确保通过上层域名服务器来获取 NS记 录和对应的 A记录的准确性。如客户端 1通过递归服务器 1进行 example.aaa.com 域名解析,在针对 aaa.com.的权威域名服务器的 NS记录 (:由 nsl、 ns2、 ns3、 ns4、 ns5变更为 ns2、 ns3、 ns4、 ns5)发生变化时, ns2、 ns3、 ns4、 ns5对应的权威域 名服务器和递归服务器 1上对应的 NS记录已更新,即目前正常工作的权威域名 服务器为 ns2、 ns3、 ns4、 ns5。 此时, 客户端 2 通过递归服务器 2 进行 example.aaa.com域名解析, 如果上层域名服务器的 NS记录没有更新, 则递归 服务器 2得到的 NS记录中依然会包括处于非正常工作状态的 nsl。 故本发明实 施例也提供了一种更新上层域名服务器的方式, 从而确保递归服务器获得有效 的 NS记录。
对于 NS记录对应的 A记录, 可以进行修改, 即删除 nsl的 A信息, 也可 以不做修改。 在不删除时, 由于 NS记录中已没有 nsl, 故 A记录中即便有 nsl 的 A信息也没有影响, 在生命周期到达时会自动清除。 可选的, 第二 NS记录 对应的 A记录为:
ns2.aaa.com 172800 IN A 2.2.2.2
ns3.aaa.com 172800 IN A 3.3.3.3
ns4.aaa.com 172800 IN A 4.4.4.4 ns5.aaa.com 172800 IN A 5.5.5.5
如图 3所示:
( 1 ) 假设 DNS客户端第一次访问 examplel .aaa.com站点, DNS客户端向 所配置的递归服务器 (IP地址 10.10.10.10 ) 发出解析 examplel .aaa.com域名查 询请求报文(图中的 Ql )。相当于对递归服务器说"请给我 examplel .aaa.com所 对应的 IP地址"。
(2 ) 递归服务器收到请求后, 先查询本地缓存。 由于递归服务器之前为客 户端返回过 example.aaa.com的域名解析结果, 故递归服务器会根据缓存中的第 一 NS记录确定此次解析的权威域名服务器; 其中, 上一次域名解析是 nsl权威 域名服务器完成的, 所以递归服务器向 IP地址为 1.1.1.1的 nsl权威域名服务器 发出解析请求 (图中的 Q2 );
( 3 ) nsl 权威域名服务器由于受到了攻击, 处于非正常工作状态, 无法为 递归服务器提供服务,递归服务器在等待一段时间后不会收到 nsl反馈的解析结 果(图中 Al )。所以递归服务器会根据第一 NS记录重新确定一个权威域名服务 器, 若再次选择的权威域名服务器依然处于非正常工作状态, 则递归服务器会 再次选取, 直至选取到可提供解析服务的权威域名服务器;
(4 )假设递归服务器选取了 ns2, 则向 IP地址为 2.2.2.2的 ns2发送域名查 询请求消息 (图中的 Q3 );
( 5 ) ns2 处于正常工作状态, 对域名查询请求消息中的 examplel .aaa.com 进行域名解析, 得到对应的 IP地址, 假设 examplel .aaa.com所对应的 IP地址为 9.9.9.9, 则 ns2将 examplel .aaa.com所对应的 IP地址为 9.9.9.9发送给递归服务 器并将自己本身存储的上述第二 NS记录以及第二 NS记录对应的 A记录发送给 递归服务器 (图中的 A2)。
(6 ) 递归服务器在接收到权威域名服务器 ns2返回的第二 NS记录后, 判 断第二 NS记录是否与第一 NS记录相同, 若发现第二 NS记录与第一 NS记录 不相同, 则用第二 NS记录替换第一 NS记录。 此时, 第一 NS记录, 如下:
aaa.com. 172800 IN NS nsl .aaa.com
aaa.com. 172800 IN NS ns2.aaa.com
aaa.com. 172800 IN NS ns3.aaa.com
aaa.com. 172800 IN NS ns4.aaa.com
aaa.com. 172800 IN NS ns5.aaa.com
而第二 NS记录如下:
aaa.com. 172800 IN NS ns2.aaa.com
aaa.com. 172800 IN NS ns3.aaa.com
aaa.com. 172800 IN NS ns4.aaa.com
aaa.com. 172800 IN NS ns5.aaa.com
可以看出, 第二 NS记录与第一 NS记录不相同, 因此, 用第二 NS记录替 换第一 NS记录。当其它同类域名如 xxx.aaa.com再次向递归服务器请求解析时, 由于递归服务器、 权威服务器及权威服务器的上层域名服务器中缓存的被攻击 的 nsl的 NS记录已经被删除, 故 xxx.aaa.com不会被引导到被攻击的 nsl上, 而是由第二 NS记录中能够正常服务的 ns2、 ns3、 ns4、 ns5负责解析, 及时消除 了被攻击的 nsl对域名解析的影响。
(7 ) 递归服务器将接收到 ns2返回的 examplel .aaa.com所对应的 IP地址 9.9.9.9返回给所述 DNS客户端 (如图中的 A4)。 实施例四
在权威域名服务器遭受到攻击的情况下, 为了保证业务不受影响, 还可通 过增加权威域名服务器替换掉被攻击的权威域名服务器的方式预防攻击。
基于上述实施例三的基础上,假设检测到第一 NS记录中的 IP地址为 1.1.1.1 的权威域名服务器 nsl遭受到攻击, 因此, 将各权威域名服务器中的第一 NS记 录中 IP地址为 1丄 1.1的权威域名服务器 nsl进行删除, 同时为了保证业务的正 常开展, 在域名解析系统中新增一台权威域名服务器 ns6, 因而各权威域名服务 器及权威域名服务器的上层域名服务器需要更新自身存储的 NS记录,即将第一 NS记录中删除 nsl的信息并增加 ns6的信息。
具体的, 可通过写入如下代码实现增加 IP地址为 6.6.6.6的权威域名服务器 ns6。
aaa.com 600 IN NS ns6.aaa.com
ns6.aaa.com 7200 IN A 6.6.6.6
在权威域名服务器删除 nsl增加 ns6之后,各正常工作的权威域名服务器现 在存储的 NS记录为第二 NS记录, 如下:
aaa.com. 172800 IN NS ns2.aaa.com
aaa.com. 172800 IN NS ns3.aaa.com
aaa.com. 172800 IN NS ns4.aaa.com
aaa.com. 172800 IN NS ns5.aaa.com
aaa.com. 7200 IN NS ns6.aaa.com
第二 NS记录对应的 A记录为:
ns6.aaa.com 7200 IN A 6.6.6.6
ns2.aaa.com 172800 IN A 2.2.2.2
ns3.aaa.com 172800 IN A 3.3.3.3
ns4.aaa.com 172800 IN A 4.4.4.4
ns5.aaa.com 172800 IN A 5.5.5.5
可以看出在第二 NS记录中新增的 ns6的信息由于不是顶级域名服务器配置 的, 故其生命周期可以自设定, 从而进一步使得递归服务器中的 NS记录的更新 期更灵活, 也缩短了其更新时长。
同样的, 当其它同类域名如 xxx.aaa.com再次向递归服务器请求解析时, 由 于递归服务器、 权威服务器及权威服务器的上层域名服务器 (例如顶级域名服 务器) 中缓存的被攻击的 nsl 的 NS 记录已经能正常服务的 ns6 替换, 故 xxx.aaa.com不会被引导到被攻击的 nsl上, 而是由第二 NS记录中能够正常服 务的 ns2、 ns3、 ns4、 ns5、 n6负责解析, 及时消除了被攻击的 nsl对域名解析 的影响。
实施例五
基于上述各个实施例, 若存在新增的权威域名服务器替换非正常工作的权 威域名服务器时, 对 NS记录的更新会涉及两次对权威域名服务器名称的更改, 如将第一 NS记录中非正常工作状态的 nsl 的信息替换为 ns6, 需要将第一 NS 中的 nsl的两条记录中 nsl (见如下示例中括号内为更改后的) 更改为 ns6: aaa.com. 172800 IN NS nsl (ns6) .aaa.com
nsl (ns6) .aaa.com 172800 IN A 1.1.1.1
为了减少修改量及配置量, 可选的, NS的 A记录采用泛域名指向 IP地址 的形式, 因为泛域名的匹配范围比较大, 以 *.nsl .aaa.com为例, 1. nsl . aaa.com、 2. nsl . aaa.com、 3. nsl . aaa.com等等者 β落入 *. nsl . aaa.com的匹酉己范围内。 古女针对 A 记录中的每个 A信息, 只要确保在 NS记录中与所述 A信息对应的权威域名服 务器落入所述 A信息的匹配范围内, 则在进行修改时, 可以对 A记录中的权威 域名服务器不进行修改。 在新增第三权威域名服务器替换第二权威域名服务器 时, 在 NS记录中将第二权威域名服务器修改为第三权威域名服务器, 在对应的 NS的 A记录中将泛域名对应的 IP地址修改为第三权威域名服务器的 IP地址。
下面通过一个具体的例子, 对利用泛域名能够减少修改量及配置量进行详 细的解释说明。
例如, 在顶级域名服务器注册的第一 NS记录, 如下:
aaa.com 172800 IN NS Lnsl .aaa.com
aaa.com 172800 IN NS 1. ns2.aaa.com
aaa.com 172800 IN NS 1. ns3.aaa.com
aaa.com 172800 IN NS 1. ns4.aaa.com
aaa.com 172800 IN NS 1. ns5.aaa.com
第一 NS的 A记录, 如下:
Lnsl .aaa.com 172800 IN A 1.1.1.1
1.ns2.aaa.com 172800 IN A 2.2.2.2 1.ns3.aaa.com 172800 IN A 3.3.3.3
1.ns4.aaa.com 172800 IN A 4.4.4.4
1.ns5.aaa.com 172800 IN A 5.5.5.5
而在权威域名服务器上配置的第一 NS记录, 如下:
aaa.com 7200 IN NS 1 .nsl.aaa.com
aaa.com 7200 IN NS 1 .ns2.aaa.com
aaa.com 7200 IN NS 1 .ns3.aaa.com
aaa.com 7200 IN NS 1 .ns4.aaa.com
aaa.com 7200 IN NS 1 .ns5.aaa.com
第一 NS的 A记录:
*. nsl.aaa.com 7200 IN A 1.1.1.1
*. ns2.aaa.com 7200 IN A 2.2.2.2
*. ns3.aaa.com 7200 IN A 3.3.3.3
*. ns4.aaa.com 7200 IN A 4.4.4.4
*. ns5.aaa.com 7200 IN A 5.5.5.5 在权威域名服务器 nsl受到攻击的情况下,需要新增一个权威域名服务器替 换 nsl, 因此, 需要分别修改权威域名服务器及权威域名服务器的上层域名服务 器 (顶级域名服务器) 上配置的第一 NS记录, 只需要将 "1. nsl. aaa.com"修改 为 " 2. nsl. aaa.com " 或 " 3. nsl. aaa.com" 或 " 4.nsl. aaa.com"等, 同时, 将 "*. nsl. aaa.com 7200 IN Al.1.1.1" 中的 IP地址 " 1.1.1.1"修改为 "6.6.6.6" 即可, "2.nsl. aaa.com"、 "3. nsl. aaa.com" 、 "4.nsl. aaa.com" 都会落入泛域名 *. nsl. aaa.com的解析范围。 可以看出, 在本发明实施例中, 将 NS记录中权威域 名服务器变为原权威域名服务器的下级域名形式, 在 A记录中将权威域名服务 器变为原权威域名服务器的下级域名的泛域名形式, 因此, 能够减少修改工作 量及域名配置量, 从而提升权威域名服务器的工作效率, 进而提升域名解析效 率。
根据以上内容可以看出, 本发明实施例能够利用第一权威域名服务器返回 的第二 NS记录刷新第一 NS记录, 其中第二 NS记录中记载着能正常服务的权 威域名服务器的记录, 从而不再暴露受攻击的权威域名服务器, 使得域名解析 请求均被引导到第二 NS记录的能正常服务的权威域名服务器来解析,减少受攻 击的域名服务器对域名解析的影响, 因此, 能够提升域名解析的效率。 此外, 第二 NS记录中的 TTL值还能够刷新第一 NS记录中的 TTL值, 从而使得目前 顶级域管理机构强制设置的 172800的 TTL值不对 DNS解析造成长时间的影响。 基于相同的技术构思, 本发明实施例还提供了一种递归服务器, 如图 4所 示, 包括:
存储器 401, 用于存储程序指令;
处理器 402,用于调用所述存储器中存储的程序指令,按照获得的程序执行: 接收域名查询请求报文, 所述域名查询请求报文中携带有所述递归服务器中未 缓存的域名;根据所述域名对应的第一 NS记录及第一 NS的 A记录确定第一权 威域名服务器, 并向所述第一权威域名服务器发送所述域名查询请求报文; 接 收所述第一权威域名服务器返回的所述域名的 A记录、 第二 NS记录及第二 NS 的 A记录, 所述第二 NS记录中记载着用于解析所述域名且处于正常工作状态 的权威域名服务器; 将所述第二 NS记录替换所述第一 NS记录, 并缓存所述第 二 NS的 A记录的方法步骤。
处理器 402, 还用于按照获得的程序执行: 根据所述域名对应的第一 NS记 录及第一 NS的 A记录确定第二权威域名服务器, 所述第二权威域名服务器是 所述递归服务器中记录的已成功解析所述域名的同类域名的权威域名服务器; 在未接收到所述第二权威域名服务器返回的消息时, 根据所述域名对应的第一 NS记录及第一 NS的 A记录确定所述第一权威域名服务器; 所述第二 NS记录 中不包括所述第二权威域名服务器。
本发明实施例还提供了一种计算机存储介质, 所述计算机存储介质存储有 计算机可执行指令, 所述计算机可执行指令用于使所述计算机执行前述方法中 本发明实施例还提供了一种权威域名服务器, 如图 5所示, 包括: 存储器 501, 用于存储程序指令;
处理器 502,用于调用所述存储器中存储的程序指令,按照获得的程序执行: 接收递归服务器发送的域名查询请求报文, 所述域名查询请求报文中携带有所 述递归服务器中未缓存的域名; 所述第一权威域名服务器是所述递归服务器根 据第一 NS记录及第一 NS的 A记录确定的;向所述递归服务器发送所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解 析所述域名且处于正常工作状态的权威域名服务器的步骤。
所述处理器 502, 还用于按照获得的程序执行: 删除所述第一 NS记录及第 一 NS的 A记录中处于非正常工作状态的域名服务器的信息; 或, 将新增的解 析所述域名的域名服务器的信息替换所述第一 NS记录及第一 NS的 A记录中处 于非正常工作状态的域名服务器的信息。
本发明实施例还提供了一种计算机存储介质, 计算机存储介质存储有计算 机可执行指令, 所述计算机可执行指令用于使所述计算机执行前述实施例中的 权威域名服务器所执行的方法步骤。 本发明实施例还提供了一种 DNS防攻击系统, 包括如执行前述实施例步骤 的递归服务器及执行前述实施例步骤的权威域名服务器。 本领域内的技术人员应明白, 本发明的实施例可提供为方法、 或计算机程 序产品。 因此, 本发明可采用完全硬件实施例、 完全软件实施例、 或结合软件 和硬件方面的实施例的形式。 而且, 本发明可采用在一个或多个其中包含有计 算机可用程序代码的计算机可用存储介质 (包括但不限于磁盘存储器、 CD-ROM, 光学存储器等) 上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、 设备 (系统)、 和计算机程序产品 的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图和 / 或方框图中的每一流程和 I或方框、 以及流程图和 I或方框图中的流程和 I或 方框的结合。 可提供这些计算机程序指令到通用计算机、 专用计算机、 嵌入式 处理机或其他可编程数据处理设备的处理器以产生一个机器, 使得通过计算机 或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流 程或多个流程和 /或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备 以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存储器中的 指令产生包括指令装置的制造品, 该指令装置实现在流程图一个流程或多个流 程和 /或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上, 使 得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处 理, 从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例, 但本领域内的技术人员一旦得知了基 本创造性概念, 则可对这些实施例作出另外的变更和修改。 所以, 所附权利要 求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发 明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权利要求及 其等同技术的范围之内, 则本发明也意图包含这些改动和变型在内。

Claims

权 利 要 求 书
1、 一种 DNS防攻击方法, 其特征在于, 包括:
递归服务器接收域名查询请求报文, 所述域名查询请求报文中携带有所述 递归服务器中未缓存的域名;
所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A记录确定 第一权威域名服务器, 并向所述第一权威域名服务器发送所述域名查询请求报 文;
所述递归服务器接收所述第一权威域名服务器返回的所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所述域 名且处于正常工作状态的权威域名服务器;
所述递归服务器将所述第二 NS记录替换所述第一 NS记录, 并缓存所述第 二 NS的 A记录。
2、 如权利要求 1所述的方法, 其特征在于, 所述递归服务器根据所述域名 对应的第一 NS记录及第一 NS的 A记录确定第一权威域名服务器之前,还包括: 所述递归服务器根据所述域名对应的第一 NS记录及第一 NS的 A记录确定 第二权威域名服务器, 所述第二权威域名服务器是所述递归服务器中记录的已 成功解析所述域名的同类域名的权威域名服务器;
所述递归服务器在未接收到所述第二权威域名服务器返回的消息时, 根据 所述域名对应的第一 NS记录及第一 NS的 A记录确定所述第一权威域名服务 器; 所述第二 NS记录中不包括所述第二权威域名服务器。
3、 如权利要求 1 所述的方法, 其特征在于, 所述递归服务器将所述第二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录, 包括:
所述递归服务器在确定所述第二 NS记录与所述第一 NS记录不同时, 将所 述第二 NS记录替换所述第一 NS记录, 并缓存所述第二 NS的 A记录。
4、 如权利要求 1~3任一项所述的方法, 其特征在于, 所述第一 NS的 A记录和所述第二 NS的 A记录均采用泛域名指向 IP地址 的形式;
针对所述第一 NS的 A记录和所述第二 NS的 A记录中的每个 A信息, 在 NS记录中与所述 A信息对应的权威域名服务器落入所述 A信息的匹配范围内。
5、 一种 DNS防攻击方法, 其特征在于, 包括:
第一权威域名服务器接收递归服务器发送的域名查询请求报文, 所述域名 查询请求报文中携带有所述递归服务器中未缓存的域名; 所述第一权威域名服 务器是所述递归服务器根据第一 NS记录及第一 NS的 A记录确定的;
所述第一权威域名服务器向所述递归服务器发送所述域名的 A记录、 第二 NS记录及第二 NS的 A记录, 所述第二 NS记录中记载着用于解析所述域名且 处于正常工作状态的权威域名服务器。
6、 如权利要求 5所述的方法, 其特征在于, 所述第二 NS记录及第二 NS 的 A记录通过以下方式得到:
所述第一权威域名服务器删除所述第一 NS记录及第一 NS的 A记录中处于 非正常工作状态的域名服务器的信息; 或
所述第一权威域名服务器将新增的解析所述域名的域名服务器的信息替换 所述第一 NS记录及第一 NS的 A记录中处于非正常工作状态的域名服务器的信 息。
7、 如权利要求 5所述的方法, 其特征在于, 所述第一权威域名服务器的上 层域名服务器配置有所述第二 NS记录及所述第二 NS的 A记录。
8、 一种递归服务器, 其特征在于, 包括:
存储器, 用于存储程序指令;
处理器, 用于调用所述存储器中存储的程序指令, 按照获得的程序执行如 权利要求 1至 4任一项所述的方法。
9、 一种计算机存储介质, 其特征在于, 所述计算机存储介质存储有计算机 可执行指令, 所述计算机可执行指令用于使所述计算机执行权利要求 1至 4任 一项所述的方法。
10、 一种权威域名服务器, 其特征在于, 包括:
存储器, 用于存储程序指令;
处理器, 用于调用所述存储器中存储的程序指令, 按照获得的程序执行如 权利要求 5至 7任一项所述的方法。
11、 一种计算机存储介质, 其特征在于, 所述计算机存储介质存储有计算 机可执行指令, 所述计算机可执行指令用于使所述计算机执行权利要求 5 至 7 任一项所述的方法。
12、 一种 DNS防攻击系统, 包括如权利要求 8所述的递归服务器及如权利 要求 10所述的权威域名服务器。
PCT/CN2018/077553 2017-06-23 2018-02-28 一种dns防攻击方法、设备和系统 Ceased WO2018233312A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP18820776.5A EP3557841A4 (en) 2017-06-23 2018-02-28 Dns attack defense method, apparatus and system
US16/464,761 US11044262B2 (en) 2017-06-23 2018-02-28 Method, apparatus and system for anti-attacking in domain name system (DNS)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710488513.5 2017-06-23
CN201710488513.5A CN107222492A (zh) 2017-06-23 2017-06-23 一种dns防攻击方法、设备和系统

Publications (1)

Publication Number Publication Date
WO2018233312A1 true WO2018233312A1 (zh) 2018-12-27

Family

ID=59950881

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077553 Ceased WO2018233312A1 (zh) 2017-06-23 2018-02-28 一种dns防攻击方法、设备和系统

Country Status (4)

Country Link
US (1) US11044262B2 (zh)
EP (1) EP3557841A4 (zh)
CN (1) CN107222492A (zh)
WO (1) WO2018233312A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210328811A1 (en) * 2018-04-05 2021-10-21 T-Mobile Usa, Inc. Recursive token binding for cascaded service calls

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222492A (zh) 2017-06-23 2017-09-29 网宿科技股份有限公司 一种dns防攻击方法、设备和系统
US11082448B2 (en) * 2018-06-14 2021-08-03 International Business Machines Corporation Preventing phishing using DNS
CN110636006B (zh) * 2018-06-25 2021-11-02 中国电信股份有限公司 域名查询方法和系统、路由节点、控制节点和防护节点
CN108471458A (zh) * 2018-07-10 2018-08-31 北京云枢网络科技有限公司 权威dns服务提供方法及系统
CN110784559B (zh) * 2019-09-17 2022-06-07 大唐软件技术股份有限公司 一种dns解析时延采集方法和装置
CN111200667B (zh) * 2019-12-18 2021-08-10 网宿科技股份有限公司 一种域名解析方法、权威域名服务器和本地域名服务器
CN111314502B (zh) * 2020-03-09 2022-02-18 网宿科技股份有限公司 一种基于域名解析系统的域名部署方法及装置
CN112637175B (zh) * 2020-12-17 2021-08-20 山东云天安全技术有限公司 一种用于工业物联网的防御方法及装置
CN115150358B (zh) * 2021-03-31 2024-02-13 贵州白山云科技股份有限公司 域名获取的方法、电子装置以及系统
CN113839938B (zh) * 2021-09-16 2022-07-08 武汉绿色网络信息服务有限责任公司 一种域名接管漏洞的检测方法和装置
CN114726625B (zh) * 2022-04-08 2024-08-20 Oppo广东移动通信有限公司 检测方法及装置、服务器及存储介质
CN115473870B (zh) * 2022-09-06 2024-05-10 中国电子信息产业集团有限公司第六研究所 顶级域名解析方法、系统、电子设备及存储介质
WO2025128429A1 (en) * 2023-12-12 2025-06-19 Centurylink Intellectual Property Llc Systems and methods for publishing and using images of dns zone configurations
CN119892690B (zh) * 2025-01-09 2025-10-17 哈尔滨工业大学 基于dnskey平滑变更的权威服务器异常变更检测方法和系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685599A (zh) * 2013-12-09 2014-03-26 中国科学院计算机网络信息中心 一种域名递归服务的预判干预方法
US20140129699A1 (en) * 2012-11-06 2014-05-08 Mark E. Jeftovic System and method for maintaining domain name service
CN105357328A (zh) * 2015-09-28 2016-02-24 互联网域名系统北京市工程研究中心有限公司 域名解析方法、dns递归服务器及域名解析系统
CN106209832A (zh) * 2016-07-08 2016-12-07 中国互联网络信息中心 基于ns记录转移授权缓解域名权威记录劫持影响的方法
CN106375492A (zh) * 2016-08-31 2017-02-01 贵州白山云科技有限公司 一种cdn业务的处理方法、相关设备及通信系统
CN107222492A (zh) * 2017-06-23 2017-09-29 网宿科技股份有限公司 一种dns防攻击方法、设备和系统

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8214524B2 (en) * 2007-12-21 2012-07-03 Hostway Corporation System and method for selecting an optimal authoritative name server
WO2013116530A1 (en) * 2012-02-01 2013-08-08 Xerocole, Inc. Dns outage avoidance method for recursive dns servers
US10805190B2 (en) * 2014-03-06 2020-10-13 Verisign, Inc. Name collision risk manager
CN103957285B (zh) * 2014-04-18 2015-09-09 北京奇虎科技有限公司 提供根域名解析服务的方法和系统
US9426171B1 (en) * 2014-09-29 2016-08-23 Amazon Technologies, Inc. Detecting network attacks based on network records
US10530734B2 (en) * 2014-12-16 2020-01-07 Verisign, Inc. Balancing visibility in the domain name system
US10673767B2 (en) * 2015-09-04 2020-06-02 Dynamic Network Services, Inc. Methods and apparatus for real-time traffic steering using real-time user monitoring data
WO2017156231A1 (en) * 2016-03-09 2017-09-14 Dynamic Network Services, Inc. Methods and apparatus for intelligent domain name system forwarding
US10554697B1 (en) * 2016-06-14 2020-02-04 Open Invention Network Llc Browser application selection and navigation operations in a co-browsing environment
US10862344B2 (en) * 2017-09-28 2020-12-08 Ossia Inc. Wafer-level integrated antenna array for wireless battery charging

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140129699A1 (en) * 2012-11-06 2014-05-08 Mark E. Jeftovic System and method for maintaining domain name service
CN103685599A (zh) * 2013-12-09 2014-03-26 中国科学院计算机网络信息中心 一种域名递归服务的预判干预方法
CN105357328A (zh) * 2015-09-28 2016-02-24 互联网域名系统北京市工程研究中心有限公司 域名解析方法、dns递归服务器及域名解析系统
CN106209832A (zh) * 2016-07-08 2016-12-07 中国互联网络信息中心 基于ns记录转移授权缓解域名权威记录劫持影响的方法
CN106375492A (zh) * 2016-08-31 2017-02-01 贵州白山云科技有限公司 一种cdn业务的处理方法、相关设备及通信系统
CN107222492A (zh) * 2017-06-23 2017-09-29 网宿科技股份有限公司 一种dns防攻击方法、设备和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3557841A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210328811A1 (en) * 2018-04-05 2021-10-21 T-Mobile Usa, Inc. Recursive token binding for cascaded service calls
US11956371B2 (en) * 2018-04-05 2024-04-09 T-Mobile Usa, Inc. Recursive token binding for cascaded service calls

Also Published As

Publication number Publication date
CN107222492A (zh) 2017-09-29
US11044262B2 (en) 2021-06-22
EP3557841A4 (en) 2020-02-19
EP3557841A1 (en) 2019-10-23
US20190394217A1 (en) 2019-12-26

Similar Documents

Publication Publication Date Title
WO2018233312A1 (zh) 一种dns防攻击方法、设备和系统
US12463956B2 (en) DNS package in a network
US20230216884A1 (en) Method for minimizing the risk and exposure duration of improper or hijacked dns records
JP5893034B2 (ja) ネットワーク環境における要求ルーティング
US9300623B1 (en) Domain name system cache integrity check
JP4095892B2 (ja) ネットワーク要素ネームおよびアドレスを隠蔽するための技術
CN102984286B (zh) 一种dns服务器的缓存更新方法、装置及系统
CN102025795B (zh) Dns响应报文处理方法、dns服务器及系统
CN111917896B (zh) 一种可信的域名解析方法、系统、电子设备及存储介质
CN105472056B (zh) Dns递归服务器分层缓存方法和系统
US9954815B2 (en) Domain name collaboration service using domain name dependency server
WO2017067443A1 (zh) 一种安全域名系统及其故障处理方法
WO2015039475A1 (zh) 一种域名解析方法、服务器及系统
CN106210158B (zh) 一种域名解析的同步方法和设备
CN116938875A (zh) 域名检测方法、域名解析器、电子设备和存储介质
CN112689030A (zh) Dns缓存更新方法及系统
CN106331205B (zh) 域名资源记录缓存的集中管控方法、装置和相关设备
WO2017124883A1 (zh) 一种新型权威域名解析服务方法和装置
CN107222588A (zh) 一种提高dns可用性的方法及系统
CN112532766B (zh) Dns应答结果的缓存方法、dns服务器及计算机可读存储介质
CN112187900B (zh) 基于区块链共享缓存的dns数据更新方法和系统
CN109413220B (zh) 一种以别名方式接入ddos云防护系统中避免dns传播的方法
CN105472057A (zh) 一种针对dns中不存在域名查询的处理方法
CN106209832A (zh) 基于ns记录转移授权缓解域名权威记录劫持影响的方法
CN111371747A (zh) 一种防御域名解析服务器信息泄露方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18820776

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018820776

Country of ref document: EP

Effective date: 20190718

NENP Non-entry into the national phase

Ref country code: DE