[go: up one dir, main page]

WO2021142867A1 - Dns server selection method and proxy server - Google Patents

Dns server selection method and proxy server Download PDF

Info

Publication number
WO2021142867A1
WO2021142867A1 PCT/CN2020/074972 CN2020074972W WO2021142867A1 WO 2021142867 A1 WO2021142867 A1 WO 2021142867A1 CN 2020074972 W CN2020074972 W CN 2020074972W WO 2021142867 A1 WO2021142867 A1 WO 2021142867A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
dns server
domain name
server
proxy server
Prior art date
Application number
PCT/CN2020/074972
Other languages
French (fr)
Chinese (zh)
Inventor
张瑶
Original Assignee
厦门网宿有限公司
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 厦门网宿有限公司 filed Critical 厦门网宿有限公司
Publication of WO2021142867A1 publication Critical patent/WO2021142867A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Definitions

  • This application relates to the field of Internet technology, and in particular to a method for selecting a DNS server and a proxy server.
  • the deployment method is to deploy resource nodes in different regions, which also leads to the existence of multiple origin sites for the same domain name.
  • the locally configured DNS server Before the user sends an access request for data resources, when the destination IP address cannot be obtained from the local host table, the locally configured DNS server must first perform domain name resolution to obtain the server IP corresponding to the access domain name.
  • a default DNS server and an alternate DNS server are usually configured locally, and the default DNS server is used first, and a DNS request is sent to the default DNS server to obtain the destination address information (port number and IP address), and then based on the The destination address information constructs an access request and sends it to the server pointed to by the destination address.
  • the existing preferential use of the default DNS server to respond to the user's domain name resolution request has the following characteristics: When a certain DNS server is selected as the default DNS server, the system will only be able to respond to the destination address information normally when the DNS server cannot normally feed back the destination address information. Select an alternate DNS server for domain name resolution; when the DNS server successfully resolves a domain name, no matter whether the resolved origin site can respond normally or not, the user's access request for the domain name will always be directed to the origin site. .
  • the purpose of some embodiments of this application is to provide a DNS server selection method and proxy server, which can automatically select a suitable DNS server for a domain name.
  • this application provides a method for selecting a DNS server.
  • the method is applied to a proxy server.
  • the proxy server is configured with a default DNS server and at least one candidate DNS server, and stores historical resolution records.
  • the method includes: obtaining a target data access request, and parsed from the target data access request to obtain the carried target domain name; according to the target historical resolution record corresponding to the target domain name, the default DNS server and the at least one Determine the target DNS server among the candidate DNS servers, so that the target DNS server can resolve the target domain name; receive the resolution result fed back by the target DNS server, and send the target data access request to the resolution
  • the proxy server includes a memory and a processor.
  • the memory is used to store a computer program.
  • the computer program is executed by the processor, the The above DNS server selection method.
  • the proxy server obtains the user's access request and resolves to obtain the target domain name, and selects the DNS server based on the historical resolution record, and performs secondary resolution on the target domain name, thereby ensuring the DNS server
  • the origin server pointed to by the destination address information of the response can respond normally.
  • the default DNS server and at least one alternative DNS server can be preset in the proxy server, and the historical resolution records of each domain name can be stored.
  • the historical resolution records can be stored first
  • the target historical resolution record corresponding to the target domain name is queried, and then according to the value recorded in the target historical resolution record, the target DNS server is determined from the default DNS server and at least one candidate DNS server, and the target DNS server determines the target domain name. Perform domain name resolution.
  • the target DNS server After the target DNS server completes the domain name resolution of the target domain name, the target DNS server can feed back the resolution result to the proxy server, so that the proxy server can forward the target data access request to the target origin site pointed to by the resolution result, and the proxy server can also target The source site’s response results update the target historical resolution records, so that the values recorded in the target historical resolution records can reflect the latest resolution status of each DNS server, which can be used as a basis for the next resolution of the target domain name. It can not only ensure the maximum use of existing resources, but also ensure that users' access requests can be responded to in a timely manner.
  • the technical solution provided by this application forwards the user's access request by introducing a proxy server, and the proxy server can select the forwarding path to ensure the transmission rate of the access request and the control of operating costs.
  • FIG. 1 is a schematic diagram of the architecture of a DNS server selection system in an embodiment of the present application
  • FIG. 2 is a flowchart of a method for selecting a DNS server in Embodiment 1 of the present application
  • Fig. 3 is a schematic diagram of functional modules of a DNS server selection device in an embodiment of the present application
  • Fig. 4 is a schematic diagram of the structure of a proxy server in an embodiment of the present application.
  • the origin site IP obtained through the resolution of different DNS servers is generally different.
  • the DNS server No. 1 when the DNS server No. 1 is selected to be responsible for domain name resolution, the origin site deployed in the northern region can be preferentially directed.
  • the user usually sets the default DNS server locally.
  • the user's domain name resolution request is dispatched to an area where the network cost is relatively cheap.
  • the resolution result obtained after the DNS server resolves contains the IP address of the source site, and the default DNS server feedback
  • the source station corresponding to the source station IP is usually a closer physical distance from the requesting end, or a resource node of the same operator.
  • a proxy server is a transfer station for network information, which can obtain network information on behalf of users. Its most basic function is connection. In addition, it also includes functions such as security, caching, content filtering, and access control management.
  • a complete proxy request process is: the client first establishes a connection with the proxy server, and then according to the proxy protocol used by the proxy server, it requests to establish a connection to the target server, or obtain the specified resources of the target server, or use NAT (Network Address Translation) , Network address translation) technology to implement the transparent proxy, the request sent by the client to the source station is redirected to the proxy server by its network exit device or local proxy program, and the proxy server processes the request and passes the response result through the original The path is fed back to the client.
  • NAT Network Address Translation
  • the network exit device includes the routing device for the user to access the Internet. Generally speaking, the data traffic sent by the user will pass through the network exit device and finally reach the destination server.
  • FIG. 1 is a schematic diagram of the architecture of the DNS server selection system in an embodiment of this application.
  • the DNS server selection system includes at least one requester (user A, B), a proxy server, a default DNS server and an alternative DNS server, and an origin site corresponding to the default DNS server and the alternative DNS server respectively. S1 and source station S2. All data access requests sent by users will be directed to the proxy server, which is responsible for data interaction with the source site.
  • the DNS server selection system can direct the data access request sent by the user to the proxy server through traffic mirroring or policy routing.
  • the proxy server locally maintains a historical resolution record.
  • the historical resolution record records the relevant resolution record value of each domain name received by the proxy server, which specifically includes the domain name information, the number of abnormal results, and the DNS server type.
  • a DNS server list can be created in the configuration file of the proxy server, and multiple DNS servers are recorded in order in the above DNS server list, and the priority of each DNS server can be in accordance with the order in which it is arranged in the DNS server list.
  • the arrangement order of each DNS server in the DNS server list can be set based on factors such as the performance of each DNS server or network cost.
  • the DNS server selection system can use the polling mechanism in the above Choose between multiple DNS servers.
  • the default DNS server and the alternative DNS server are two completely independent DNS servers. They have the same status in the network architecture and can independently respond to domain name requests, as shown in the full text.
  • the operator usually deploys multiple DNS servers to resolve requests in the area.
  • the preferred feedback is the content server (origin site) in the area where the DNS server is located. Therefore, usually the default DNS server and the alternate DNS server maintain different domain name to IP address mapping records. Assuming that at a certain moment, both the default DNS server and the alternate DNS server are used to resolve the domain name of the same access request. The IP address of the source station resolved by the default DNS server and the alternate DNS server may be different.
  • FIG. 2 is a flowchart of a method for selecting a DNS server in Embodiment 1 of this application.
  • the method for selecting a DNS server in this embodiment is applied to a proxy server, and the method may include the following steps.
  • S101 Obtain a target data access request, and parse the target data access request to obtain a carried target domain name.
  • all data access requests sent by users in the system will be directed to the proxy server.
  • the proxy server For one of the data access requests (that is, the target data access request), when the proxy server obtains the target data access request, The proxy server may perform preliminary analysis on the target data access request to obtain the target domain name carried in the target data access request. It should be particularly pointed out that the proxy server will perform a preliminary analysis on all data access requests received to obtain the domain name information carried in each data access request.
  • the proxy server can obtain the target data access request by receiving the target data access request sent by the user's network exit device, where the target data access request is redirected to the proxy server by the aforementioned network exit device (that is, in The network exit device intercepts user traffic and forwards it to the proxy server), and/or receives the target data access request forwarded by the local proxy (that is, the user traffic is directed to the proxy server by embedding the SDK in the client).
  • the proxy server parses the target domain name carried in the target data access request can be implemented in the following manner.
  • the proxy server parses the URI (Uniform Resource Identifier, Uniform Resource Identifier) from the data message corresponding to the target data access request. Identifier), and then determine the target domain name from the resolved URI.
  • a data access request is composed of multiple data messages. Taking the http protocol as an example, an http data access request includes at least a TCP connection request message, a data request message including a URI, etc.
  • the proxy server can parse out the data request message containing the URI in the data message, and then parse the data request message containing the URI to obtain the target domain name carried therein.
  • S102 Determine a target DNS server from the default DNS server and the at least one candidate DNS server according to the target historical resolution record corresponding to the target domain name, so that the target DNS server resolves the target domain name .
  • the proxy server can query the historical resolution record of the target historical resolution record corresponding to the target domain name according to the target domain name, and analyze the value in the target historical record according to the target domain name.
  • the target DNS server is determined from the default DNS server and the at least one candidate DNS server, and then the proxy server constructs a domain name resolution request based on the target domain name and sends it to the target DNS server, so that the target DNS server performs Parsing.
  • the historical resolution record contains at least the domain name information, the number of abnormal results, and the DNS server type.
  • Each domain name obtained by the proxy server will be recorded in the historical resolution record, and for each domain name, the historical resolution record contains the number of abnormal results corresponding to the domain name and the type of DNS server. For example, for the domain name "www.abc.com", the historical resolution record will record the type information of all DNS servers that have performed domain name resolution on www.abc.com.
  • the type information includes at least the unique identification information of the DNS server and the DNS server.
  • the availability status of the DNS server, the load status of the DNS server, etc., and the response results corresponding to the source station resolved by each DNS server and the number of abnormal response results (that is, the number of abnormal results) are also recorded in the historical analysis record.
  • the historical analysis record can have the structure shown in Table 1:
  • the first alternative DNS server available 60 www.abc.com
  • the second alternative DNS server unavailable 100 www.xy.com Default DNS server, unavailable 80 www.xy.com
  • the first alternative DNS server available 20 ... ... ...
  • the proxy server can query the historical analysis records corresponding to www.abc.com in the historical analysis records, that is,
  • the proxy server can determine that the default DNS server and the first candidate DNS server are available, and the number of abnormal results corresponding to the default DNS server is less than the number of abnormal results corresponding to the first candidate DNS server. Therefore, the proxy server can select the default DNS server as the target DNS server for the domain name "www.abc.com", and the default DNS server will perform domain name resolution on the domain name "www.abc.com”.
  • the following steps may be adopted to determine the target DNS server among the default DNS server and at least one candidate DNS server.
  • the target DNS server is determined from the default DNS server and at least one candidate DNS server.
  • the proxy server can query the historical resolution records for all relevant resolution record values that contain the target domain name according to the target domain name, and based on the above query All relevant analysis record values of, determine the target historical analysis record.
  • the proxy server can obtain the number of abnormal results corresponding to each DNS server from the historical resolution record of the target, and then determine the record item whose abnormal number does not exceed the target threshold, and then from the above record items
  • the corresponding DNS server type is queried, and based on the queried DNS server type and preset rules, the target DNS server is determined from the default DNS server and the at least one candidate DNS server.
  • the proxy server can obtain from the target historical resolution record that the number of abnormal results corresponding to the default DNS server is 20.
  • the number of abnormal results corresponding to one candidate DNS server is 60, and the number of abnormal results corresponding to the second candidate DNS server is 100.
  • the proxy server can determine that the record items whose abnormal results do not exceed 80 are included The record item of the default DNS server type, and the record item containing the first candidate DNS server type.
  • the preset rule is to first determine the available status of the DNS server, if all are available, then determine the number of abnormal results, and select the DNS server with a small number of abnormal results as the target DNS server, then the proxy server will follow the records in the DNS server type, First, it can be determined that both the default DNS server and the first candidate DNS server are available, and then it is determined that the number of abnormal results corresponding to the default DNS server is less than the number of abnormal results corresponding to the first candidate DNS server. Therefore, the proxy server will select the default DNS server As the target DNS server for www.abc.com. Generally speaking, when configuring the DNS server, the selection of the default DNS server will be confirmed based on factors such as network cost and quality. Therefore, the default DNS server is often a better choice. In other embodiments of this application, preset rules may also be used. Include When the default DNS server is included in the available DNS servers, the default DNS server is preferred.
  • S103 Receive the resolution result fed back by the target DNS server, and send the target data access request to the target source station pointed to by the resolution result, and update the target historical resolution based on the response result of the target source station record.
  • the resolution result of the target domain name can be obtained.
  • the resolution result is usually the address information of a certain source station that provides resource services for the target domain name, including IP address.
  • the target DNS server will feed back the above analysis result to the proxy server.
  • the proxy server can send the target data access request to the source represented by the above IP address according to the address information in the analysis result.
  • Station that is, the target source station.
  • the proxy server can determine the data information requested by the user by analyzing each request message contained in the target data access request, and encapsulate a new access request based on the data information and the address information of the source station, and send it to Source station.
  • the target source site When the proxy server sends the target data access request to the target source site, the target source site will feedback the response data to the proxy server. After the proxy server receives the above response data, it can obtain the response status code through the header information of the response data, and according to The above response status code determines whether the target source station can respond normally. If the response status code is "5xx" (server error), such as "500", "503" and other information, the proxy server can determine that the target source station responds abnormally, and the source station cannot feed back the requested data normally.
  • server error server error
  • the proxy server can determine that the target source station responds normally, and the proxy server will receive the request data and target data fed back by the source station Access the data resource pointed to by the request. After the proxy server obtains the response result of the target source station, it can update the target historical analysis record according to the response result of the target source station.
  • updating the target historical analysis record may include the following steps.
  • the proxy server When the proxy server knows the response status code through the header information of the response data, it can judge whether the target source station can respond normally according to the above response status code. If the proxy server judges that the target source station can respond normally (that is, the response result is normal), then the proxy The server can reset the number of abnormal results corresponding to the target source station to zero, or reduce the number of abnormal results by 1. If the proxy server determines that the target source station cannot respond normally (that is, the response result is abnormal), then the proxy server can reset the target source station The corresponding number of abnormal results plus one. Through the response results of the target source site, the number of abnormal results in the historical analysis record of the target is updated, which can indirectly monitor the working status of the target DNS server corresponding to the target source site.
  • the proxy server can be set when the result is abnormal. After the number of times exceeds the specified value, the working state of the corresponding DNS server is adjusted to be unavailable, or, when the number of abnormal results is less than the specified value, the working state of the corresponding DNS server is adjusted to be available.
  • the proxy server in addition to the source station’s own reasons that cause the proxy server to judge the source station’s response abnormally, such as the source station’s address information has been updated or the source station’s failure, there may also be factors such as network congestion that cause the proxy server to judge the source The station responds abnormally. For example, the source station can respond normally, but the proxy server judges that the source station's response is timed out due to network congestion. At this time, the proxy server will also judge that the source station's response is abnormal. Therefore, the proxy server can adjust the number of abnormal results according to the number of continuous responses from the source station.
  • the proxy server when the proxy server determines that the target source station responds normally, the proxy server may set the number of abnormal results corresponding to the target source station to zero. When the proxy server determines that the target source station responds abnormally, the proxy server may set the target source station to respond abnormally.
  • the number of abnormal results corresponding to the station is the sum of the current value and the specified positive integer.
  • the proxy server sends the corresponding nth data access request to the target source station according to the nth domain name resolution result of the target domain name fed back by the DNS server, and when it is judged that the nth data access request is a normal response from the target source station After that, the proxy server can set the number of abnormal results corresponding to the target source site to zero, and then the proxy server sends the corresponding n+1th data access request according to the n+1th domain name resolution result of the target domain name fed back by the DNS server To the target source site, after judging that the n+1th data access request obtains an abnormal response from the target source site, the proxy server can set the number of abnormal results corresponding to the target source site to 1, and then the proxy server continues to follow the target feedback from the DNS server The n+2th domain name resolution result of the domain name, the corresponding n+2th data access request is sent to the target source site.
  • the proxy server After judging that the n+2th data access request obtains an abnormal response from the target source site, the proxy server can Set the number of abnormal results corresponding to the target source station to 2, and so on.
  • the number of abnormal results corresponding to the target source station will increase, which can reduce the proxy server judgment due to network congestion and other factors to a certain extent.
  • the source station responds abnormally, and the number of abnormal results can more truly reflect the working status of the target source station.
  • the concurrent traffic on the proxy server is constantly changing. If the target threshold is set to a fixed value, the proxy server will not be able to adjust the DNS server selection conditions according to the actual load. For example, if the target threshold is set to 100, and the concurrent traffic of the proxy server reaches 3000 at a certain time, the number of abnormal results of the target domain name may reach 100 in a short time, and the proxy server will check the available status of the currently used DNS server Adjust to unavailable, and then select other DNS servers for subsequent resolution of the target domain name. In fact, the currently used DNS server still has not reached the maximum load, and it can still continue to perform domain name resolution on other domain names. Therefore, the proxy server can also dynamically adjust the target threshold according to the concurrent traffic.
  • the proxy server may also set an initial threshold in advance, calculate the adjustment threshold according to the concurrent traffic in the update period and a preset proportional coefficient, and then generate the target threshold according to the initial threshold and the adjustment threshold. For example, the proxy server sets the initial threshold to 100 and the preset scale factor to 0.1 based on experience. If the concurrent traffic of the proxy server reaches 3000 at a certain moment, the proxy server can calculate the adjustment threshold to be 300 and set the target The threshold is set to 400; if the concurrent traffic of the proxy server reaches 1000 at a certain moment, the proxy server can calculate the adjustment threshold to be 100 and set the target threshold to 200. To prevent the proxy server from frequently adjusting the target threshold, the proxy server can also set trigger conditions for adjusting the target threshold. For example, the adjustment threshold is calculated only when the concurrent traffic exceeds 1000, and the target threshold is reset; or every 10 minutes, the current proxy is taken Concurrent traffic value on the server, calculate the adjustment threshold, and reset the target threshold.
  • the proxy server can set the same initial threshold for all domain names, or set different initial thresholds for different domain names.
  • the proxy server can set the same preset scale factor for all domain names. Different preset ratio coefficients can be set for different domain names, which is not limited in this application.
  • the default DNS server set by the operator can dispatch the user's data access request to an area where the network cost is relatively cheap. Therefore, when the DNS server selection system is used for the first time, the default DNS server can be set to resolve all data access requests.
  • the DNS server selection system is used for the first time, no domain name is usually recorded in the historical resolution records. Therefore, for all data access requests sent by users, the proxy server will use the default DNS server to resolve the above data access requests, and according to The response result of the target origin site updates the historical resolution records of each domain name.
  • the proxy server may update the historical analysis record based on active detection, which specifically includes the following steps.
  • a first detection message is constructed based on the domain name to be detected, and sent to the corresponding DNS server to be detected to obtain the resolution result.
  • a second detection message is constructed based on the analysis result and sent to the source station pointed to by the analysis result, and the historical resolution record corresponding to the DNS server to be detected is updated according to the response result of the source station.
  • the proxy server can set the detection threshold, and query all the domain names with abnormal times greater than the detection threshold in the historical analysis records, and determine the corresponding DNS server, and then mark the queried domain name and the corresponding DNS server as the domain name to be detected and the domain name to be detected. DNS server.
  • the proxy server may construct a first detection message based on the domain name to be detected.
  • the first detection message carries the domain name to be detected, and then sends the first detection message to the corresponding domain name to be detected. Detecting the DNS server. After the DNS server to be detected resolves the domain name to be detected in the first detection message, the domain name resolution result can be obtained.
  • the domain name resolution result is usually the IP address of a certain source station that provides access services for the domain name to be detected .
  • the proxy server After the proxy server receives the domain name resolution result fed back by the DNS server to be detected, the proxy server can construct a second detection message based on the above analysis result, and the second detection message carries the information of the source station that provides access services for the domain name to be detected. IP address, and then the proxy server sends the above-mentioned second detection message to the source station, and according to the response result of the source station, updates the historical resolution record corresponding to the DNS server to be detected.
  • the proxy server sets the detection threshold to 90.
  • the proxy server can determine that the domain name with abnormal results greater than 90 is: www.abc.com, and its corresponding DNS server is the second backup. Select the DNS server, so the proxy server marks www.abc.com as the domain name to be detected, and marks the second candidate DNS server as the DNS server to be detected. Then the proxy server constructs a first detection message containing "www.abc.com" information, and sends the first detection message to the second candidate DNS server, and the second candidate DNS server pairs www.abc.com Perform analysis to obtain the IP address of the source site that provides access to www.abc.com.
  • the second candidate DNS server After the second candidate DNS server obtains the IP address of the source site that provides access services for www.abc.com, the second candidate DNS server will feed back the above IP address to the proxy server so that the proxy server can construct the IP address containing the above IP Address of the second detection message, the proxy server can send the above-mentioned second detection message to the source station represented by the IP address.
  • the source station After receiving the second detection message, the source station can feedback response data to the proxy server, and the proxy server can send the response data to the proxy server according to The status code in the response data determines whether the source station can respond normally.
  • the proxy server can reset the number of abnormal results corresponding to the second candidate DNS server to zero (that is, by Update 100 to 0), or reduce the number of abnormal results by 1 (that is, update from 100 to 99); if the proxy server determines that the source station cannot respond normally (that is, the response result is abnormal), then the proxy server can change the second candidate DNS The number of abnormal results corresponding to the server is increased by 1 (that is, updated from 100 to 101).
  • the proxy server can also update the working status of the DNS server according to the number of abnormal results.
  • the proxy server sets the DNS server to be available when the number of abnormal results is less than 70, then the proxy server updates the number of abnormal results corresponding to the second candidate DNS server according to the response results of the source site. When the updated number of abnormal results becomes 69, the proxy server will update the working status of the second candidate DNS server to "available".
  • the proxy server can also set each domain name to be detected The same/different detection period, so that the proxy server constructs the first detection message based on the detection period corresponding to each domain name to be detected.
  • the proxy server can set the detection period for www.abc.com and www.xy.com respectively.
  • the length of the detection period can be the same or different.
  • the proxy server is based on www.abc.com and www.xy.com.
  • the first detection message is constructed for www.abc.com and www.xy.com respectively, and the first detection message of www.abc.com is sent to the second candidate DNS server, and www.xy.com is sent to the second candidate DNS server.
  • the first detection message of com is sent to the default DNS server, so as to update the historical resolution records corresponding to the second candidate DNS server and the default DNS server according to the response result of the source station.
  • the proxy server can actively detect each DNS server to be detected periodically, so as to update the working status of each DNS server to be detected in time.
  • the proxy server may respond to the target data access request based on the response result. Specifically, when the proxy server sends response data to the user, it can construct a data packet based on the response result of the source station, using the user's address as the destination address, and send the data packet to the user; or, the proxy server can follow the original receiving path Return, and the export device or local agent will convert the address, and change the source address of the response packet to the original destination address and the destination address to the original source address.
  • this application also provides a DNS server selection device, the device is applied to a proxy server, the proxy server is set with a default DNS server and at least one candidate DNS server, and stores historical resolution records ,
  • the device includes the following modules.
  • the data receiving module is used to obtain the target data access request, and parse the target domain name carried from the target data access request.
  • the DNS selection module is configured to determine a target DNS server among the default DNS server and the at least one candidate DNS server according to the target historical resolution record corresponding to the target domain name, so that the target DNS server can The target domain name is resolved.
  • the device further includes: a threshold setting module, configured to set an initial threshold, and calculate an adjustment threshold according to the concurrent traffic in the update period and a preset proportional coefficient, and according to the initial threshold and the adjustment threshold The target threshold is generated.
  • a threshold setting module configured to set an initial threshold, and calculate an adjustment threshold according to the concurrent traffic in the update period and a preset proportional coefficient, and according to the initial threshold and the adjustment threshold The target threshold is generated.
  • the device further includes: an active detection module, configured to determine the domain name and the corresponding DNS server whose number of abnormal results in the historical analysis record is greater than the detection threshold, as the domain name to be detected and the DNS server to be detected; And construct a first detection message based on the domain name to be detected and send it to the corresponding DNS server to be detected to obtain a resolution result; and construct a second detection message based on the resolution result and send it to the resolution
  • an active detection module configured to determine the domain name and the corresponding DNS server whose number of abnormal results in the historical analysis record is greater than the detection threshold, as the domain name to be detected and the DNS server to be detected.
  • a first detection message based on the domain name to be detected and send it to the corresponding DNS server to be detected to obtain a resolution result
  • construct a second detection message based on the resolution result and send it to the resolution
  • the present application also provides a proxy server, the proxy server includes a memory and a processor, the memory is used to store a computer program, when the computer program is executed by the processor, can achieve as described above DNS server selection method.
  • the data conversion server may include a processor, an internal bus, and a memory.
  • the memory may include memory and non-volatile memory.
  • the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it.
  • the proxy server may also include more or fewer components than shown in FIG.
  • the default DNS server and at least one alternative DNS server can be preset in the proxy server, and the historical resolution records of each domain name can be stored.
  • the proxy server receives the target from the user After the target data access request of the domain name, the target historical resolution record corresponding to the target domain name can be queried in the stored historical resolution records, and then according to the value recorded in the target historical resolution record, the default DNS server and at least one backup
  • the target DNS server is determined from the selected DNS server, and the target DNS server performs domain name resolution on the target domain name.
  • each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware.
  • the above technical solution essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic A disc, an optical disc, etc., include several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiment.

Landscapes

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

Abstract

Disclosed is a DNS server selection method. The method comprises: obtaining a target data access request, and resolving the target data access request to obtain a carried target domain name (S101); determining a target DNS server in a default DNS server and at least one alternative DNS server according to a target historical resolution record corresponding to the target domain name, such that the target DNS server resolves the target domain name (S102); and receiving a resolution result fed back by the target DNS server, sending the target data access request to a target source station to which the resolution result points, and updating the target historical resolution record on the basis of a response result of the target source station (S103).

Description

一种DNS服务器选择方法和代理服务器A DNS server selection method and proxy server
交叉引用cross reference
本申请引用于2020年1月7日递交的名称为“一种DNS服务器选择方法和代理服务器”的第202010052800.3号中国专利申请,其通过引用被全部并入本申请。This application refers to the Chinese patent application No. 202010052800.3 filed on January 7, 2020, entitled "A DNS server selection method and proxy server", which is fully incorporated into this application by reference.
技术领域Technical field
本申请涉及互联网技术领域,特别涉及一种DNS服务器选择方法和代理服务器。This application relates to the field of Internet technology, and in particular to a method for selecting a DNS server and a proxy server.
背景技术Background technique
随着互联网的快速发展,网络环境日趋复杂,传统的资源节点集中部署方式已不能满足用户的需求,为保证不同地区的用户在访问网站时都可以获得良好的体验,很多内容提供商会采用分布式部署的方式,在不同的地区分别部署资源节点,这也导致同一个域名存在多个源站。用户在发出针对数据资源的访问请求之前,在无法从本地host表中获取目的IP地址时,需先由本地配置的DNS服务器进行域名解析,以获取访问域名对应的服务器IP,一般而言,用户本地通常配置有默认DNS服务器,及备用DNS服务器,并优先使用默认DNS服务器,并向默认DNS服务器发送域名解析请求(DNS request),以获得目的地址信息(端口号及IP地址),然后基于该目的地址信息构建访问请求,并发送至目的地址指向的服务器。With the rapid development of the Internet and the increasingly complex network environment, the traditional centralized deployment of resource nodes can no longer meet the needs of users. To ensure that users in different regions can get a good experience when visiting websites, many content providers will use distributed The deployment method is to deploy resource nodes in different regions, which also leads to the existence of multiple origin sites for the same domain name. Before the user sends an access request for data resources, when the destination IP address cannot be obtained from the local host table, the locally configured DNS server must first perform domain name resolution to obtain the server IP corresponding to the access domain name. Generally speaking, the user A default DNS server and an alternate DNS server are usually configured locally, and the default DNS server is used first, and a DNS request is sent to the default DNS server to obtain the destination address information (port number and IP address), and then based on the The destination address information constructs an access request and sends it to the server pointed to by the destination address.
但是,现有的优先使用默认DNS服务器对用户的域名解析请求进行响应存在以下特点:当选择某一个DNS服务器作为默认DNS服务器后,只有当该DNS服务器无法正常反馈目的地址信息时,系统才会选择备用DNS服务器进行域名 解析;当DNS服务器成功对某一个域名进行解析后,不论解析出的源站是否可以正常响应,用户针对该域名的访问请求都将一直导向该源站。。However, the existing preferential use of the default DNS server to respond to the user's domain name resolution request has the following characteristics: When a certain DNS server is selected as the default DNS server, the system will only be able to respond to the destination address information normally when the DNS server cannot normally feed back the destination address information. Select an alternate DNS server for domain name resolution; when the DNS server successfully resolves a domain name, no matter whether the resolved origin site can respond normally or not, the user's access request for the domain name will always be directed to the origin site. .
鉴于此,有必要提供一种新的DNS服务器选择方法和代理服务器以解决上述不足。In view of this, it is necessary to provide a new DNS server selection method and proxy server to solve the above shortcomings.
发明内容Summary of the invention
本申请部分实施例的目的在于提供一种DNS服务器选择方法和代理服务器,可以自动为域名选择合适的DNS服务器。The purpose of some embodiments of this application is to provide a DNS server selection method and proxy server, which can automatically select a suitable DNS server for a domain name.
为实现上述目的,本申请一方面提供DNS服务器选择方法,所述方法应用于代理服务器中,所述代理服务器中配置有默认DNS服务器和至少一台备选DNS服务器,并储存有历史解析记录,所述方法包括:获取目标数据访问请求,并从所述目标数据访问请求中解析得到携带的目标域名;根据所述目标域名对应的目标历史解析记录,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器,以使得所述目标DNS服务器对所述目标域名进行解析;接收所述目标DNS服务器反馈的解析结果,并将所述目标数据访问请求发送至所述解析结果指向的目标源站,并基于所述目标源站的响应结果,更新所述目标历史解析记录。In order to achieve the above-mentioned purpose, on the one hand, this application provides a method for selecting a DNS server. The method is applied to a proxy server. The proxy server is configured with a default DNS server and at least one candidate DNS server, and stores historical resolution records. The method includes: obtaining a target data access request, and parsed from the target data access request to obtain the carried target domain name; according to the target historical resolution record corresponding to the target domain name, the default DNS server and the at least one Determine the target DNS server among the candidate DNS servers, so that the target DNS server can resolve the target domain name; receive the resolution result fed back by the target DNS server, and send the target data access request to the resolution The target source station pointed to by the result, and based on the response result of the target source station, the target historical analysis record is updated.
为实现上述目的,本申请另一方面还提供一种代理服务器,所述代理服务器包括存储器和处理器,所述存储器用于存储计算机程序,当所述计算机程序被所述处理器执行时,实现上述DNS服务器选择方法。In order to achieve the foregoing objective, another aspect of the present application also provides a proxy server. The proxy server includes a memory and a processor. The memory is used to store a computer program. When the computer program is executed by the processor, the The above DNS server selection method.
由此可见,本申请提供的技术方案,代理服务器通过对用户的访问请求进行获取,并解析得到目标域名,并基于历史解析记录选择出DNS服务器,对目标域名进行二次解析,从而保证DNS服务器响应的目的地址信息指向的源站服务器可正常响应。It can be seen that, in the technical solution provided by this application, the proxy server obtains the user's access request and resolves to obtain the target domain name, and selects the DNS server based on the historical resolution record, and performs secondary resolution on the target domain name, thereby ensuring the DNS server The origin server pointed to by the destination address information of the response can respond normally.
具体而言,代理服务器中可以预先设置默认DNS服务器和至少一台备选DNS服务器,并储存各个域名的历史解析记录,当接收到用户发送的访问请求后,可以首先在储存的历史解析记录中查询到与目标域名相对应的目标历史解析记 录,然后根据目标历史解析记录中记录的数值,在默认DNS服务器和至少一台备选DNS服务器中确定出目标DNS服务器,由目标DNS服务器对目标域名进行域名解析。当目标DNS服务器完成对目标域名的域名解析工作后,目标DNS服务器可以向代理服务器反馈解析结果,使得代理服务器可以将目标数据访问请求转发至解析结果指向的目标源站,并且代理服务器还可以目标源站的响应结果,更新目标历史解析记录,这样目标历史解析记录中记录的数值便可以反映出各个DNS服务器的最新的解析状态,以用于下一次针对目标域名的解析时作选择依据,这样既可以保证最大限度的利用现有资源,又可以保证用户的访问请求都能及时得到响应。Specifically, the default DNS server and at least one alternative DNS server can be preset in the proxy server, and the historical resolution records of each domain name can be stored. When the access request sent by the user is received, the historical resolution records can be stored first The target historical resolution record corresponding to the target domain name is queried, and then according to the value recorded in the target historical resolution record, the target DNS server is determined from the default DNS server and at least one candidate DNS server, and the target DNS server determines the target domain name. Perform domain name resolution. After the target DNS server completes the domain name resolution of the target domain name, the target DNS server can feed back the resolution result to the proxy server, so that the proxy server can forward the target data access request to the target origin site pointed to by the resolution result, and the proxy server can also target The source site’s response results update the target historical resolution records, so that the values recorded in the target historical resolution records can reflect the latest resolution status of each DNS server, which can be used as a basis for the next resolution of the target domain name. It can not only ensure the maximum use of existing resources, but also ensure that users' access requests can be responded to in a timely manner.
本申请提供的技术方案通过引入代理服务器对用户的访问请求进行转发,代理服务器可对转发路径进行选取,以保障访问请求的传输速率、以及运营成本的控制。The technical solution provided by this application forwards the user's access request by introducing a proxy server, and the proxy server can select the forwarding path to ensure the transmission rate of the access request and the control of operating costs.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1是本申请实施例中DNS服务器选择系统的架构示意图;FIG. 1 is a schematic diagram of the architecture of a DNS server selection system in an embodiment of the present application;
图2是本申请实施例一中DNS服务器选择方法的流程图;FIG. 2 is a flowchart of a method for selecting a DNS server in Embodiment 1 of the present application;
图3是本申请实施例中DNS服务器选择装置的功能模块示意图;Fig. 3 is a schematic diagram of functional modules of a DNS server selection device in an embodiment of the present application;
图4是本申请实施例中代理服务器的结构示意图。Fig. 4 is a schematic diagram of the structure of a proxy server in an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作详细描述。In order to make the purpose, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
随着互联网的快速发展,网络环境日趋复杂,互联不互通、区域ISP地 域局限、出口带宽受限制等种种因素都造成了网站的区域性无法访问,因此传统的资源节点集中部署方式已不能满足用户的需求,为保证不同地区的用户在访问网站时都可以获得良好的体验,很多内容提供商会采用分布式部署的方式,在不同的地区分别部署资源节点,这也导致同一个域名存在分布在不同区域的多个源站,而不同区域其网络成本是不同的。出于降低网络成本,以及容灾性考虑,运营商通常会部署多个DNS服务器,例如运营商可以针对北方区域的资源节点部署1号DNS服务器,针对南方区域的资源节点部署2号DNS服务器,经由不同DNS服务器解析得到的源站IP一般存在差异,例如,当选择1号DNS服务器负责域名解析时,便可以优先导向部署在北方区域的源站。在实际应用中,用户本地通常会设置默认DNS服务器,例如,将用户的域名解析请求调度到网络成本较为便宜的区域,DNS服务器解析后获得的解析结果包含源站的IP地址,默认DNS服务器反馈的源站IP所对应的源站,通常是离请求端物理距离较近的,或者是同运营商的资源节点。With the rapid development of the Internet, the network environment is becoming more and more complex. Various factors such as interoperability, regional ISP limitations, and limited export bandwidth have caused the regional inaccessibility of the website. Therefore, the traditional centralized deployment of resource nodes can no longer satisfy users. In order to ensure that users in different regions can get a good experience when visiting the website, many content providers will adopt a distributed deployment method, deploying resource nodes in different regions, which also leads to the existence of the same domain name in different locations. There are multiple source stations in a region, and the network cost is different in different regions. To reduce network costs and consider disaster tolerance, operators usually deploy multiple DNS servers. For example, operators can deploy DNS server No. 1 for resource nodes in the northern region, and DNS server No. 2 for resource nodes in the southern region. The origin site IP obtained through the resolution of different DNS servers is generally different. For example, when the DNS server No. 1 is selected to be responsible for domain name resolution, the origin site deployed in the northern region can be preferentially directed. In practical applications, the user usually sets the default DNS server locally. For example, the user's domain name resolution request is dispatched to an area where the network cost is relatively cheap. The resolution result obtained after the DNS server resolves contains the IP address of the source site, and the default DNS server feedback The source station corresponding to the source station IP is usually a closer physical distance from the requesting end, or a resource node of the same operator.
但是,现有的优先使用默认DNS服务器对用户的域名解析请求进行响应存在背景技术中的问题,因此,如何根据源站的响应情况,为数据访问请求选择合适的DNS服务器,进而保证用户发来的每一个数据访问请求都可以及时得到源站的响应,便成为本领域亟需解决的课题。However, the existing prioritized use of the default DNS server to respond to the user’s domain name resolution request has a problem in the background technology. Therefore, how to select a suitable DNS server for the data access request according to the response of the origin site, and then ensure that the user sends it Every data access request of the company can get a response from the source site in time, which has become an urgent issue in this field.
本申请提供的技术方案可以解决上述不足。The technical solution provided by this application can solve the above-mentioned shortcomings.
为便于理解对本申请中涉及到的代理服务器进行简要介绍。In order to facilitate understanding, the proxy server involved in this application is briefly introduced.
代理服务器是网络信息的中转站,可以代理用户获取网络信息,其最基本的功能是连接,此外还包括安全性、缓存、内容过滤、访问控制管理等功能。一个完整的代理请求过程为:客户端首先与代理服务器创建连接,然后根据代理服务器所使用的代理协议,请求对目标服务器创建连接、或者获得目标服务器的指定资源,或者在基于NAT(Network Address Translation,网络地址转换)技术实现的透明代理中,客户端向源站发送的请求被其网络出口设备或本地代理程序重定向至代理服务器,并由代理服务器对请求进行处理,并将响应结果通过原路径反馈给客户端。A proxy server is a transfer station for network information, which can obtain network information on behalf of users. Its most basic function is connection. In addition, it also includes functions such as security, caching, content filtering, and access control management. A complete proxy request process is: the client first establishes a connection with the proxy server, and then according to the proxy protocol used by the proxy server, it requests to establish a connection to the target server, or obtain the specified resources of the target server, or use NAT (Network Address Translation) , Network address translation) technology to implement the transparent proxy, the request sent by the client to the source station is redirected to the proxy server by its network exit device or local proxy program, and the proxy server processes the request and passes the response result through the original The path is fed back to the client.
网络出口设备包含用户接入互联网的路由设备,一般而言,用户发送的数据流量都将经过网络出口设备,并最终达到目的服务器。The network exit device includes the routing device for the user to access the Internet. Generally speaking, the data traffic sent by the user will pass through the network exit device and finally reach the destination server.
请参阅图1,为本申请实施例中DNS服务器选择系统的架构示意图。Please refer to FIG. 1, which is a schematic diagram of the architecture of the DNS server selection system in an embodiment of this application.
在本实施例中,DNS服务器选择系统包括至少一个请求端(用户A、B)、代理服务器、默认DNS服务器和备选DNS服务器,以及分别与默认DNS服务器和备选DNS服务器相对应的源站S1和源站S2。所有用户发送的数据访问请求都将被引导至代理服务器上,由代理服务器负责与源站进行数据交互。具体的,DNS服务器选择系统可以通过流量镜像,或者策略路由的方式,将用户发送的数据访问请求引导至代理服务器。代理服务器本地维护有历史解析记录,历史解析记录中记录有代理服务器接收到的各个域名的相关解析记录值,具体包含域名信息、结果异常次数及DNS服务器类型。In this embodiment, the DNS server selection system includes at least one requester (user A, B), a proxy server, a default DNS server and an alternative DNS server, and an origin site corresponding to the default DNS server and the alternative DNS server respectively. S1 and source station S2. All data access requests sent by users will be directed to the proxy server, which is responsible for data interaction with the source site. Specifically, the DNS server selection system can direct the data access request sent by the user to the proxy server through traffic mirroring or policy routing. The proxy server locally maintains a historical resolution record. The historical resolution record records the relevant resolution record value of each domain name received by the proxy server, which specifically includes the domain name information, the number of abnormal results, and the DNS server type.
在一个实施例中,可以在代理服务器的配置文件中创建DNS服务器列表,上述DNS服务器列表中按顺序记录有多台DNS服务器,各个DNS服务器的优先级可以按照其在DNS服务器列表中的排列顺序确定,例如,将排列在第一位的DNS服务器设置为默认DNS服务器,将排列在第二位及其之后的DNS服务器设置为备选DNS服务器。另外,还可以将DNS服务器列表中排列在第二位的DNS服务器设置为第一备选DNS服务器,将DNS服务器列表中排列在第三位的DNS服务器设置为第二备选DNS服务器,以此类推。各个DNS服务器在DNS服务器列表中的排列顺序可以基于各个DNS服务器的性能,或者网络成本等因素进行设定。In one embodiment, a DNS server list can be created in the configuration file of the proxy server, and multiple DNS servers are recorded in order in the above DNS server list, and the priority of each DNS server can be in accordance with the order in which it is arranged in the DNS server list. Determine, for example, set the DNS server ranked first as the default DNS server, and set the DNS server ranked second and later as alternative DNS servers. In addition, you can also set the DNS server ranked second in the DNS server list as the first candidate DNS server, and set the DNS server ranked third in the DNS server list as the second candidate DNS server. analogy. The arrangement order of each DNS server in the DNS server list can be set based on factors such as the performance of each DNS server or network cost.
需要特别指出的是,备选DNS服务器的数量可以设置为一台,也可以设置为多台,当设置有多台DNS服务器为备选DNS服务器时,DNS服务器选择系统可以采用轮询机制在上述多台DNS服务器之间进行选择。It is important to point out that the number of alternative DNS servers can be set to one or multiple. When multiple DNS servers are set as alternative DNS servers, the DNS server selection system can use the polling mechanism in the above Choose between multiple DNS servers.
需要特别指出的是,在本申请中,默认DNS服务器和备选DNS服务器是两个完全独立的DNS服务器,在网络架构中它们有相同的地位,分别可对域名请求进行独立响应,如全文所述,运营商通常会部署多个DNS服务器用于对所在区域的请求的解析,相应的,该些DNS服务器的解析结果中,优选反馈的是 与该DNS服务器所在区域的内容服务器(源站),因此,通常默认DNS服务器和备选DNS服务器维护的域名到IP地址的映射记录是不同的,假设在某一时刻,同时使用默认DNS服务器和备选DNS服务器对同一个访问请求进行域名解析,默认DNS服务器和备选DNS服务器解析到的源站的IP地址可能是不相同的。It is important to point out that in this application, the default DNS server and the alternative DNS server are two completely independent DNS servers. They have the same status in the network architecture and can independently respond to domain name requests, as shown in the full text. As mentioned, the operator usually deploys multiple DNS servers to resolve requests in the area. Correspondingly, among the resolution results of these DNS servers, the preferred feedback is the content server (origin site) in the area where the DNS server is located. Therefore, usually the default DNS server and the alternate DNS server maintain different domain name to IP address mapping records. Assuming that at a certain moment, both the default DNS server and the alternate DNS server are used to resolve the domain name of the same access request. The IP address of the source station resolved by the default DNS server and the alternate DNS server may be different.
请参阅图2,为本申请实施例一中DNS服务器选择方法的流程图,本实施例中的DNS服务器选择方法应用于代理服务器中,所述方法可以包括以下步骤。Please refer to FIG. 2, which is a flowchart of a method for selecting a DNS server in Embodiment 1 of this application. The method for selecting a DNS server in this embodiment is applied to a proxy server, and the method may include the following steps.
S101:获取目标数据访问请求,并从所述目标数据访问请求中解析得到携带的目标域名。S101: Obtain a target data access request, and parse the target data access request to obtain a carried target domain name.
在一个实施例中,系统中所有用户发送的数据访问请求都将被引导至代理服务器上,针对其中一个数据访问请求(即目标数据访问请求),当代理服务器获取到该目标数据访问请求后,代理服务器可以对上述目标数据访问请求进行初步解析,以获取目标数据访问请求中携带的目标域名。需要特别指出的是,代理服务器对接收到的所有数据访问请求,都将对其进行初步分析,以获取各个数据访问请求中携带的域名信息。In one embodiment, all data access requests sent by users in the system will be directed to the proxy server. For one of the data access requests (that is, the target data access request), when the proxy server obtains the target data access request, The proxy server may perform preliminary analysis on the target data access request to obtain the target domain name carried in the target data access request. It should be particularly pointed out that the proxy server will perform a preliminary analysis on all data access requests received to obtain the domain name information carried in each data access request.
在一个实施例中,代理服务器获取目标数据访问请求可以通过如下方式实现,接收由用户网络出口设备发送的目标数据访问请求,其中目标数据访问请求被上述网络出口设备重定向至代理服务器(即在网络出口设备处拦截用户流量并转发至代理服务器),和/或接收由本地代理转发的目标数据访问请求(即通过在客户端中嵌入SDK将用户流量引导至代理服务器)。In one embodiment, the proxy server can obtain the target data access request by receiving the target data access request sent by the user's network exit device, where the target data access request is redirected to the proxy server by the aforementioned network exit device (that is, in The network exit device intercepts user traffic and forwards it to the proxy server), and/or receives the target data access request forwarded by the local proxy (that is, the user traffic is directed to the proxy server by embedding the SDK in the client).
在一个实施例中,代理服务器从目标数据访问请求中解析得到携带的目标域名可以通过如下方式实现,代理服务器从目标数据访问请求对应的数据报文中解析出URI(统一资源标识符,Uniform Resource Identifier),再从解析出的URI中确定出目标域名。通常一个数据访问请求由多个数据报文构成的,以http协议为例,一个http数据访问请求至少包含tcp的连接请求报文、包含URI的数据请求报文等,当代理服务器接收到http数据访问请求后,代理服务器便可以解析出数据报文中包含URI的数据请求报文,然后对上述包含URI的数据请求报文解析,以获取其中携带的目标域名。In one embodiment, the proxy server parses the target domain name carried in the target data access request can be implemented in the following manner. The proxy server parses the URI (Uniform Resource Identifier, Uniform Resource Identifier) from the data message corresponding to the target data access request. Identifier), and then determine the target domain name from the resolved URI. Usually a data access request is composed of multiple data messages. Taking the http protocol as an example, an http data access request includes at least a TCP connection request message, a data request message including a URI, etc. When the proxy server receives http data After the access request, the proxy server can parse out the data request message containing the URI in the data message, and then parse the data request message containing the URI to obtain the target domain name carried therein.
S102:根据所述目标域名对应的目标历史解析记录,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器,以使得所述目标DNS服务器对所述目标域名进行解析。S102: Determine a target DNS server from the default DNS server and the at least one candidate DNS server according to the target historical resolution record corresponding to the target domain name, so that the target DNS server resolves the target domain name .
当代理服务器获取到目标数据访问请求中携带的目标域名后,代理服务器可以根据上述目标域名,在历史解析记录中查询与目标域名相对应的目标历史解析记录,并根据目标历史解析记录中的数值,在默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器,然后代理服务器基于该目标域名构建域名解析请求,并发送至目标DNS服务器,以使得目标DNS服务器对上述目标域名进行解析。After the proxy server obtains the target domain name carried in the target data access request, the proxy server can query the historical resolution record of the target historical resolution record corresponding to the target domain name according to the target domain name, and analyze the value in the target historical record according to the target domain name. , The target DNS server is determined from the default DNS server and the at least one candidate DNS server, and then the proxy server constructs a domain name resolution request based on the target domain name and sends it to the target DNS server, so that the target DNS server performs Parsing.
在实际应用中,历史解析记录中至少包含域名信息、结果异常次数以及DNS服务器类型。代理服务器获取到的每一个域名,都将记录在历史解析记录中,并且针对每一个域名,历史解析记录中都有与该域名相对应的结果异常次数以及DNS服务器类型。例如,针对域名“www.abc.com”,历史解析记录中会记录对www.abc.com进行过域名解析的所有DNS服务器的类型信息,该类型信息至少包括DNS服务器的唯一标识信息、DNS服务器的可用状态、DNS服务器的负载情况等,并且历史解析记录中还会记录各个DNS服务器解析到的源站对应的响应结果,以及响应结果为异常的次数(即结果异常次数)。In practical applications, the historical resolution record contains at least the domain name information, the number of abnormal results, and the DNS server type. Each domain name obtained by the proxy server will be recorded in the historical resolution record, and for each domain name, the historical resolution record contains the number of abnormal results corresponding to the domain name and the type of DNS server. For example, for the domain name "www.abc.com", the historical resolution record will record the type information of all DNS servers that have performed domain name resolution on www.abc.com. The type information includes at least the unique identification information of the DNS server and the DNS server The availability status of the DNS server, the load status of the DNS server, etc., and the response results corresponding to the source station resolved by each DNS server and the number of abnormal response results (that is, the number of abnormal results) are also recorded in the historical analysis record.
例如,历史解析记录可以具有如表1所示的结构:For example, the historical analysis record can have the structure shown in Table 1:
表1(历史解析记录)Table 1 (historical analysis records)
域名信息Domain name information DNS服务器类型DNS server type 结果异常次数Number of abnormal results
www.abc.comwww.abc.com 默认DNS服务器,可用Default DNS server, available 2020
www.abc.comwww.abc.com 第一备选DNS服务器,可用The first alternative DNS server, available 6060
www.abc.comwww.abc.com 第二备选DNS服务器,不可用The second alternative DNS server, unavailable 100100
www.xy.comwww.xy.com 默认DNS服务器,不可用Default DNS server, unavailable 8080
www.xy.comwww.xy.com 第一备选DNS服务器,可用The first alternative DNS server, available 2020
当代理服务器获取到域名“www.abc.com”后,代理服务器可以在历史解析记录中查询到www.abc.com对应的目标历史解析记录,即When the proxy server obtains the domain name "www.abc.com", the proxy server can query the historical analysis records corresponding to www.abc.com in the historical analysis records, that is,
www.abc.comwww.abc.com 默认DNS服务器,可用Default DNS server, available 2020
www.abc.comwww.abc.com 第一备选DNS服务器,可用The first alternative DNS server, available 6060
www.abc.comwww.abc.com 第二备选DNS服务器,不可用The second alternative DNS server, unavailable 100100
通过解析目标历史解析记录中的数值,代理服务器可以确定默认DNS服务器和第一备选DNS服务器为可用状态,并且默认DNS服务器对应的结果异常次数小于第一备选DNS服务器对应的结果异常次数,因此代理服务器可以选择默认DNS服务器作为域名“www.abc.com”的目标DNS服务器,由默认DNS服务器对域名“www.abc.com”进行域名解析。By parsing the values in the historical resolution records of the target, the proxy server can determine that the default DNS server and the first candidate DNS server are available, and the number of abnormal results corresponding to the default DNS server is less than the number of abnormal results corresponding to the first candidate DNS server. Therefore, the proxy server can select the default DNS server as the target DNS server for the domain name "www.abc.com", and the default DNS server will perform domain name resolution on the domain name "www.abc.com".
需要特别指出的是,上述表1所示的结构只是一种示意,并不是对历史解析记录的限定,基于本申请的思想,本领域的技术人员也可以采用其它形式(例如日志表)以实现历史解析记录。It should be particularly pointed out that the structure shown in Table 1 above is only an illustration, and is not a limitation on historical analysis records. Based on the idea of this application, those skilled in the art can also use other forms (such as log tables) to achieve this. Historical analysis records.
在一个实施例中,根据目标域名对应的目标历史解析记录,在默认DNS服务器和至少一台备选DNS服务器中确定目标DNS服务器可以采用以下步骤。In one embodiment, according to the target historical resolution record corresponding to the target domain name, the following steps may be adopted to determine the target DNS server among the default DNS server and at least one candidate DNS server.
首先,根据目标域名在历史解析记录中确定目标历史解析记录。First, determine the target historical resolution record in the historical resolution record according to the target domain name.
其次,获取目标历史解析记录中结果异常次数不超过目标阈值的DNS服务器类型。Secondly, obtain the DNS server type whose number of abnormal results in the target historical analysis record does not exceed the target threshold.
最后,基于DNS服务器类型和预设规则,在默认DNS服务器和至少一台备选DNS服务器中确定目标DNS服务器。Finally, based on the DNS server type and preset rules, the target DNS server is determined from the default DNS server and at least one candidate DNS server.
由于历史解析记录中记录有代理服务器接收到的所有域名的相关解析记录值,因此代理服务器可以根据目标域名,在历史解析记录中查询包含有目标域名的所有相关解析记录值,并基于上述查询到的所有相关解析记录值,确定目标历史解析记录。Since the historical resolution records record the relevant resolution record values of all domain names received by the proxy server, the proxy server can query the historical resolution records for all relevant resolution record values that contain the target domain name according to the target domain name, and based on the above query All relevant analysis record values of, determine the target historical analysis record.
当代理服务器确定目标历史解析记录后,代理服务器可以从目标历史解析记录中获取到各个DNS服务器对应的结果异常次数,然后确定出结果异常次数不超过目标阈值的记录项,进而从上述记录项中查询到相应的DNS服务器类型,基于上述查询到的DNS服务器类型和预设规则,在默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器。After the proxy server determines the target historical resolution record, the proxy server can obtain the number of abnormal results corresponding to each DNS server from the historical resolution record of the target, and then determine the record item whose abnormal number does not exceed the target threshold, and then from the above record items The corresponding DNS server type is queried, and based on the queried DNS server type and preset rules, the target DNS server is determined from the default DNS server and the at least one candidate DNS server.
继续以表1为例,代理服务器在历史解析记录中查询到www.abc.com对应的目标历史解析记录后,可以从目标历史解析记录中获取到默认DNS服务器对应的结果异常次数为20,第一备选DNS服务器对应的结果异常次数为60,第二备选DNS服务器对应的结果异常次数为100,假设目标阈值为80,那么代理服务器可以确定出结果异常次数不超过80的记录项为包含默认DNS服务器类型的记录项,以及包含第一备选DNS服务器类型的记录项。如果预设规则为首先判断DNS服务器的可用状态,如果都为可用状态,再判断结果异常次数大小,选择结果异常次数小的DNS服务器作为目标DNS服务器,那么代理服务器根据DNS服务器类型中的记录,首先可以确定默认DNS服务器和第一备选DNS服务器都为可用状态,然后判断默认DNS服务器对应的结果异常次数小于第一备选DNS服务器对应的结果异常次数,因此,代理服务器将选择默认DNS服务器作为www.abc.com的目标DNS服务器。一般而言,在配置DNS服务器时,默认DNS服务器的选择会基于网络成本、质量等因素进行确认,因此默认DNS服务器往往是较优的选择,本申请的其他实施例中,预设规则也可包含当可用的DNS服务器中包含默认DNS服务器时,优先选择默认DNS服务器。Continuing to take Table 1 as an example, after the proxy server finds the target historical resolution record corresponding to www.abc.com in the historical resolution record, it can obtain from the target historical resolution record that the number of abnormal results corresponding to the default DNS server is 20. The number of abnormal results corresponding to one candidate DNS server is 60, and the number of abnormal results corresponding to the second candidate DNS server is 100. Assuming the target threshold is 80, then the proxy server can determine that the record items whose abnormal results do not exceed 80 are included The record item of the default DNS server type, and the record item containing the first candidate DNS server type. If the preset rule is to first determine the available status of the DNS server, if all are available, then determine the number of abnormal results, and select the DNS server with a small number of abnormal results as the target DNS server, then the proxy server will follow the records in the DNS server type, First, it can be determined that both the default DNS server and the first candidate DNS server are available, and then it is determined that the number of abnormal results corresponding to the default DNS server is less than the number of abnormal results corresponding to the first candidate DNS server. Therefore, the proxy server will select the default DNS server As the target DNS server for www.abc.com. Generally speaking, when configuring the DNS server, the selection of the default DNS server will be confirmed based on factors such as network cost and quality. Therefore, the default DNS server is often a better choice. In other embodiments of this application, preset rules may also be used. Include When the default DNS server is included in the available DNS servers, the default DNS server is preferred.
S103:接收所述目标DNS服务器反馈的解析结果,并将所述目标数据访问请求发送至所述解析结果指向的目标源站,并基于所述目标源站的响应结果,更新所述目标历史解析记录。S103: Receive the resolution result fed back by the target DNS server, and send the target data access request to the target source station pointed to by the resolution result, and update the target historical resolution based on the response result of the target source station record.
在一个实施例中,当目标DNS服务器成功完成目标域名的域名解析工作后,可以获得目标域名的解析结果,该解析结果通常是为目标域名提供资源服务的某一个源站的地址信息,包含IP地址。目标DNS服务器会向代理服务器反馈上述解析结果,当代理服务器接收到目标DNS服务器反馈的解析结果后,代理服务器可以根据解析结果中的地址信息,将目标数据访问请求发送至上述IP地址表征的源站(即目标源站)。具体而言,代理服务器可通过解析目标数据访问请求中包含的各请求报文,以确定用户所请求的数据信息,并基于该数据信息和源站的地址信息封装一个新的访问请求,发送至源站。In one embodiment, after the target DNS server successfully completes the domain name resolution work of the target domain name, the resolution result of the target domain name can be obtained. The resolution result is usually the address information of a certain source station that provides resource services for the target domain name, including IP address. The target DNS server will feed back the above analysis result to the proxy server. After the proxy server receives the analysis result fed back by the target DNS server, the proxy server can send the target data access request to the source represented by the above IP address according to the address information in the analysis result. Station (that is, the target source station). Specifically, the proxy server can determine the data information requested by the user by analyzing each request message contained in the target data access request, and encapsulate a new access request based on the data information and the address information of the source station, and send it to Source station.
当代理服务器将目标数据访问请求发送至目标源站后,目标源站将向代 理服务器反馈响应数据,代理服务器接收到上述响应数据后,可以通过响应数据的头部信息获知响应状态码,并根据上述响应状态码判断目标源站是否可以正常响应。如果响应状态码为“5xx”(服务器错误),例如“500”、“503”等信息时,代理服务器可以判断目标源站响应异常,源站无法正常反馈请求数据。如果响应状态码为“2xx”(成功),例如“200”、“201”等信息时,代理服务器可以判断目标源站响应正常,代理服务器将会接收到源站反馈的请求数据,及目标数据访问请求所指向的数据资源。当代理服务器获得目标源站的响应结果后,可以根据目标源站的响应结果,更新目标历史解析记录。When the proxy server sends the target data access request to the target source site, the target source site will feedback the response data to the proxy server. After the proxy server receives the above response data, it can obtain the response status code through the header information of the response data, and according to The above response status code determines whether the target source station can respond normally. If the response status code is "5xx" (server error), such as "500", "503" and other information, the proxy server can determine that the target source station responds abnormally, and the source station cannot feed back the requested data normally. If the response status code is "2xx" (success), such as "200", "201" and other information, the proxy server can determine that the target source station responds normally, and the proxy server will receive the request data and target data fed back by the source station Access the data resource pointed to by the request. After the proxy server obtains the response result of the target source station, it can update the target historical analysis record according to the response result of the target source station.
在一个实施例中,基于目标源站的响应结果,更新目标历史解析记录可用包括以下步骤。In one embodiment, based on the response result of the target source station, updating the target historical analysis record may include the following steps.
首先,判断响应结果是否正常,若是,则对目标源站对应的结果异常次数进行重置;若否,则对目标源站对应的结果异常次数进行累计。First, determine whether the response result is normal. If so, reset the number of abnormal results corresponding to the target source station; if not, accumulate the number of abnormal results corresponding to the target source station.
当代理服务器通过响应数据的头部信息获知响应状态码后,可以根据上述响应状态码判断目标源站是否可以正常响应,如果代理服务器判断目标源站可以正常响应(即响应结果正常),那么代理服务器可以将目标源站对应的结果异常次数重置为零,或者将结果异常次数减1;如果代理服务器判断目标源站不可以正常响应(即响应结果异常),那么代理服务器可以将目标源站对应的结果异常次数加1。通过目标源站的响应结果,对目标历史解析记录中的结果异常次数进行更新,从而可以间接实现对目标源站相对应的目标DNS服务器的工作状态进行监控,例如代理服务器可以设置为当结果异常次数超过规定值后,将相应的DNS服务器的工作状态调整为不可用,或者,当结果异常次数小于规定值后,将相应的DNS服务器的工作状态调整为可用。When the proxy server knows the response status code through the header information of the response data, it can judge whether the target source station can respond normally according to the above response status code. If the proxy server judges that the target source station can respond normally (that is, the response result is normal), then the proxy The server can reset the number of abnormal results corresponding to the target source station to zero, or reduce the number of abnormal results by 1. If the proxy server determines that the target source station cannot respond normally (that is, the response result is abnormal), then the proxy server can reset the target source station The corresponding number of abnormal results plus one. Through the response results of the target source site, the number of abnormal results in the historical analysis record of the target is updated, which can indirectly monitor the working status of the target DNS server corresponding to the target source site. For example, the proxy server can be set when the result is abnormal. After the number of times exceeds the specified value, the working state of the corresponding DNS server is adjusted to be unavailable, or, when the number of abnormal results is less than the specified value, the working state of the corresponding DNS server is adjusted to be available.
在实际应用中,除了存在因源站自身原因导致代理服务器判断源站响应异常外,例如源站地址信息已更新,或源站出现故障等,还可能存在因网络拥塞等因素导致代理服务器判断源站响应异常。例如源站可以正常响应,但是因为网络拥塞导致代理服务器判断源站响应超时,此时代理服务器也将判断源站响应异常。因此,代理服务器可以根据源站连续响应异常的次数来调整结果异 常次数。In practical applications, in addition to the source station’s own reasons that cause the proxy server to judge the source station’s response abnormally, such as the source station’s address information has been updated or the source station’s failure, there may also be factors such as network congestion that cause the proxy server to judge the source The station responds abnormally. For example, the source station can respond normally, but the proxy server judges that the source station's response is timed out due to network congestion. At this time, the proxy server will also judge that the source station's response is abnormal. Therefore, the proxy server can adjust the number of abnormal results according to the number of continuous responses from the source station.
在一个实施例中,当代理服务器判断目标源站响应正常时,代理服务器可以将目标源站对应的结果异常次数设置为零,当代理服务器判断目标源站响应异常时,代理服务器可以将目标源站对应的结果异常次数设置当前值与指定正整数之和。例如,代理服务器根据DNS服务器反馈的目标域名的第n次域名解析结果,将对应的第n次数据访问请求发送至目标源站,当判断上述第n次数据访问请求获得目标源站的正常响应后,代理服务器可以将目标源站对应的结果异常次数设置为零,然后代理服务器根据DNS服务器反馈的目标域名的第n+1次域名解析结果,将对应的第n+1次数据访问请求发送至目标源站,当判断第n+1次数据访问请求获得目标源站的异常响应后,代理服务器可以将目标源站对应的结果异常次数设置为1,然后代理服务器继续根据DNS服务器反馈的目标域名的第n+2次域名解析结果,将对应的第n+2次数据访问请求发送至目标源站,当判断第n+2次数据访问请求获得目标源站的异常响应后,代理服务器可以将目标源站对应的结果异常次数设置为2,以此类推。通过上述方式,只有当代理服务器判断目标域名连续无法获得目标源站的正常响应时,目标源站对应的结果异常次数才会增加,这样可以在一定程度上减少因网络拥塞等因素导致代理服务器判断源站响应异常,结果异常次数可以更加真实的反映目标源站的工作状态。In one embodiment, when the proxy server determines that the target source station responds normally, the proxy server may set the number of abnormal results corresponding to the target source station to zero. When the proxy server determines that the target source station responds abnormally, the proxy server may set the target source station to respond abnormally. The number of abnormal results corresponding to the station is the sum of the current value and the specified positive integer. For example, the proxy server sends the corresponding nth data access request to the target source station according to the nth domain name resolution result of the target domain name fed back by the DNS server, and when it is judged that the nth data access request is a normal response from the target source station After that, the proxy server can set the number of abnormal results corresponding to the target source site to zero, and then the proxy server sends the corresponding n+1th data access request according to the n+1th domain name resolution result of the target domain name fed back by the DNS server To the target source site, after judging that the n+1th data access request obtains an abnormal response from the target source site, the proxy server can set the number of abnormal results corresponding to the target source site to 1, and then the proxy server continues to follow the target feedback from the DNS server The n+2th domain name resolution result of the domain name, the corresponding n+2th data access request is sent to the target source site. After judging that the n+2th data access request obtains an abnormal response from the target source site, the proxy server can Set the number of abnormal results corresponding to the target source station to 2, and so on. Through the above method, only when the proxy server judges that the target domain name is continuously unable to obtain the normal response of the target source station, the number of abnormal results corresponding to the target source station will increase, which can reduce the proxy server judgment due to network congestion and other factors to a certain extent. The source station responds abnormally, and the number of abnormal results can more truly reflect the working status of the target source station.
在实际应用中,代理服务器上的并发流量是不断变化的,如果目标阈值设定为固定值,代理服务器将无法根据实际负载情况调整DNS服务器选择条件。例如,假设目标阈值设定为100,而某一时刻代理服务器的并发流量达到3000,那么目标域名的结果异常次数可能在很短时间内达到100,代理服务器会将当前使用的DNS服务器的可用状态调整为不可用,然后选择其它DNS服务器对目标域名进行后继解析。实际上当前使用的DNS服务器仍未达到最大负荷,其仍然可以继续对其它域名进行域名解析,因此代理服务器还可以根据并发流量动态调整目标阈值。In practical applications, the concurrent traffic on the proxy server is constantly changing. If the target threshold is set to a fixed value, the proxy server will not be able to adjust the DNS server selection conditions according to the actual load. For example, if the target threshold is set to 100, and the concurrent traffic of the proxy server reaches 3000 at a certain time, the number of abnormal results of the target domain name may reach 100 in a short time, and the proxy server will check the available status of the currently used DNS server Adjust to unavailable, and then select other DNS servers for subsequent resolution of the target domain name. In fact, the currently used DNS server still has not reached the maximum load, and it can still continue to perform domain name resolution on other domain names. Therefore, the proxy server can also dynamically adjust the target threshold according to the concurrent traffic.
在一个实施例中,代理服务器还可以预先设置初始阈值,并根据更新周 期内并发流量和预设比例系数计算调整阈值,然后根据初始阈值和调整阈值生成目标阈值。例如,代理服务器根据使用经验将初始阈值设置为100,将预设比例系数设置为0.1,如果在某一时刻代理服务器的并发流量达到3000,代理服务器便可以计算出调整阈值为300,并将目标阈值设置为400;如果在某一时刻代理服务器的并发流量达到1000,代理服务器便可以计算出调整阈值为100,并将目标阈值设置为200。为避免代理服务器频繁调整目标阈值,代理服务器还可以设置调整目标阈值的触发条件,例如,只有当并发流量超过1000时才计算调整阈值,并重新设置目标阈值;或者每隔10分钟,取当前代理服务器上的并发流量值,计算调整阈值,并重新设置目标阈值。In an embodiment, the proxy server may also set an initial threshold in advance, calculate the adjustment threshold according to the concurrent traffic in the update period and a preset proportional coefficient, and then generate the target threshold according to the initial threshold and the adjustment threshold. For example, the proxy server sets the initial threshold to 100 and the preset scale factor to 0.1 based on experience. If the concurrent traffic of the proxy server reaches 3000 at a certain moment, the proxy server can calculate the adjustment threshold to be 300 and set the target The threshold is set to 400; if the concurrent traffic of the proxy server reaches 1000 at a certain moment, the proxy server can calculate the adjustment threshold to be 100 and set the target threshold to 200. To prevent the proxy server from frequently adjusting the target threshold, the proxy server can also set trigger conditions for adjusting the target threshold. For example, the adjustment threshold is calculated only when the concurrent traffic exceeds 1000, and the target threshold is reset; or every 10 minutes, the current proxy is taken Concurrent traffic value on the server, calculate the adjustment threshold, and reset the target threshold.
需要特别指出的是,代理服务器可以针对所有的域名设置相同的初始阈值,也可以针对不同的域名设置不同的初始阈值,相应的,代理服务器可以针对所有的域名设置相同的预设比例系数,也可以针对不同的域名设置不同的预设比例系数,本申请对此不作限制。It should be pointed out that the proxy server can set the same initial threshold for all domain names, or set different initial thresholds for different domain names. Correspondingly, the proxy server can set the same preset scale factor for all domain names. Different preset ratio coefficients can be set for different domain names, which is not limited in this application.
由于在实际应用中,运营商设置的默认DNS服务器,可以将用户的数据访问请求调度至网络成本较为便宜的区域。因此,当DNS服务器选择系统初次使用时,可以设置由默认DNS服务器对所有的数据访问请求进行解析。在初次使用DNS服务器选择系统时,历史解析记录中通常并未记录任何域名,因此,针对用户发来的所有数据访问请求,代理服务器都将使用默认DNS服务器对上述数据访问请求进行解析,并根据目标源站的响应结果,更新各个域名的历史解析记录。In practical applications, the default DNS server set by the operator can dispatch the user's data access request to an area where the network cost is relatively cheap. Therefore, when the DNS server selection system is used for the first time, the default DNS server can be set to resolve all data access requests. When the DNS server selection system is used for the first time, no domain name is usually recorded in the historical resolution records. Therefore, for all data access requests sent by users, the proxy server will use the default DNS server to resolve the above data access requests, and according to The response result of the target origin site updates the historical resolution records of each domain name.
在一个实施例中,代理服务器可以基于主动探测,对历史解析记录进行更新,具体包括以下步骤。In one embodiment, the proxy server may update the historical analysis record based on active detection, which specifically includes the following steps.
首先,确定历史解析记录中结果异常次数大于探测阈值的域名及对应的DNS服务器,以作为待探测域名及待探测DNS服务器。First, determine the domain name and the corresponding DNS server with the number of abnormal results in the historical analysis record greater than the detection threshold as the domain name to be detected and the DNS server to be detected.
然后,基于待探测域名构建第一探测报文,并发送至对应的待探测DNS服务器,以获取解析结果。Then, a first detection message is constructed based on the domain name to be detected, and sent to the corresponding DNS server to be detected to obtain the resolution result.
最后,基于解析结果构建第二探测报文,并发送至解析结果指向的源站, 并根据源站的响应结果,更新待探测DNS服务器对应的历史解析记录。Finally, a second detection message is constructed based on the analysis result and sent to the source station pointed to by the analysis result, and the historical resolution record corresponding to the DNS server to be detected is updated according to the response result of the source station.
代理服务器可以设置探测阈值,并在历史解析记录中查询所有结果异常次数大于探测阈值的域名,并确定对应的DNS服务器,然后将查询出的域名以及对应的DNS服务器标记为待探测域名、待探测DNS服务器。The proxy server can set the detection threshold, and query all the domain names with abnormal times greater than the detection threshold in the historical analysis records, and determine the corresponding DNS server, and then mark the queried domain name and the corresponding DNS server as the domain name to be detected and the domain name to be detected. DNS server.
代理服务器在确定待探测域名和待探测DNS服务器之后,可以基于待探测域名构建第一探测报文,上述第一探测报文中携带有待探测域名,然后将第一探测报文发送至对应的待探测DNS服务器,待探测DNS服务器对第一探测报文中的待探测域名进行解析后,可以获取域名解析结果,该域名解析结果通常是为待探测域名提供访问服务的某一个源站的IP地址。After determining the domain name to be detected and the DNS server to be detected, the proxy server may construct a first detection message based on the domain name to be detected. The first detection message carries the domain name to be detected, and then sends the first detection message to the corresponding domain name to be detected. Detecting the DNS server. After the DNS server to be detected resolves the domain name to be detected in the first detection message, the domain name resolution result can be obtained. The domain name resolution result is usually the IP address of a certain source station that provides access services for the domain name to be detected .
当代理服务器接收到待探测DNS服务器反馈的域名解析结果后,代理服务器可以基于上述解析结果构建第二探测报文,上述第二探测报文中携带有为待探测域名提供访问服务的源站的IP地址,之后代理服务器将上述第二探测报文发送至该源站,并根据该源站的响应结果,更新待探测DNS服务器对应的历史解析记录。After the proxy server receives the domain name resolution result fed back by the DNS server to be detected, the proxy server can construct a second detection message based on the above analysis result, and the second detection message carries the information of the source station that provides access services for the domain name to be detected. IP address, and then the proxy server sends the above-mentioned second detection message to the source station, and according to the response result of the source station, updates the historical resolution record corresponding to the DNS server to be detected.
继续以表1为例,假设代理服务器设置探测阈值为90,代理服务器通过查询历史解析记录,可以确定结果异常次数大于90的域名为:www.abc.com,其对应的DNS服务器为第二备选DNS服务器,因此代理服务器将www.abc.com标记为待探测域名,将第二备选DNS服务器标记为待探测DNS服务器。然后代理服务器构建包含有“www.abc.com”信息的第一探测报文,并将上述第一探测报文发送至第二备选DNS服务器,第二备选DNS服务器对www.abc.com进行解析,以获取为www.abc.com提供访问服务的源站的IP地址。当第二备选DNS服务器获取到为www.abc.com提供访问服务的源站的IP地址后,第二备选DNS服务器会向代理服务器反馈上述IP地址,使得代理服务器可以构建包含有上述IP地址的第二探测报文,代理服务器可以将上述第二探测报文发送至该IP地址表征的源站,源站接收到第二探测报文后,可以向代理服务器反馈响应数据,代理服务器根据响应数据中的状态码判断源站是否可以正常响应,如果该源站可以正常响应(即响应结果正常),代理服务器可以将第二备选DNS服务器对应的 结果异常次数重置为零(即由100更新为0),或者将结果异常次数减1(即由100更新为99);如果代理服务器判断该源站不可以正常响应(即响应结果异常),那么代理服务器可以将第二备选DNS服务器对应的结果异常次数加1(即由100更新为101)。Continuing to take Table 1 as an example, suppose the proxy server sets the detection threshold to 90. The proxy server can determine that the domain name with abnormal results greater than 90 is: www.abc.com, and its corresponding DNS server is the second backup. Select the DNS server, so the proxy server marks www.abc.com as the domain name to be detected, and marks the second candidate DNS server as the DNS server to be detected. Then the proxy server constructs a first detection message containing "www.abc.com" information, and sends the first detection message to the second candidate DNS server, and the second candidate DNS server pairs www.abc.com Perform analysis to obtain the IP address of the source site that provides access to www.abc.com. After the second candidate DNS server obtains the IP address of the source site that provides access services for www.abc.com, the second candidate DNS server will feed back the above IP address to the proxy server so that the proxy server can construct the IP address containing the above IP Address of the second detection message, the proxy server can send the above-mentioned second detection message to the source station represented by the IP address. After receiving the second detection message, the source station can feedback response data to the proxy server, and the proxy server can send the response data to the proxy server according to The status code in the response data determines whether the source station can respond normally. If the source station can respond normally (that is, the response result is normal), the proxy server can reset the number of abnormal results corresponding to the second candidate DNS server to zero (that is, by Update 100 to 0), or reduce the number of abnormal results by 1 (that is, update from 100 to 99); if the proxy server determines that the source station cannot respond normally (that is, the response result is abnormal), then the proxy server can change the second candidate DNS The number of abnormal results corresponding to the server is increased by 1 (that is, updated from 100 to 101).
另外,代理服务器还可以根据结果异常次数更新DNS服务器的工作状态。继续以表1为例,假设代理服务器设定当结果异常次数小于70时,DNS服务器为可用状态,那么代理服务器根据源站的响应结果,更新第二备选DNS服务器对应的结果异常次数,当更新后的结果异常次数变为69时,代理服务器将把第二备选DNS服务器的工作状态更新为“可用”。In addition, the proxy server can also update the working status of the DNS server according to the number of abnormal results. Continuing to take Table 1 as an example, assuming that the proxy server sets the DNS server to be available when the number of abnormal results is less than 70, then the proxy server updates the number of abnormal results corresponding to the second candidate DNS server according to the response results of the source site. When the updated number of abnormal results becomes 69, the proxy server will update the working status of the second candidate DNS server to "available".
在一个实施例中,当代理服务器确定历史解析记录中结果异常次数大于探测阈值的域名及对应的DNS服务器,以作为待探测域名及待探测DNS服务器之后,代理服务器还可以为各个待探测域名设置相同的/不同的探测周期,以使得代理服务器基于各个待探测域名对应的探测周期,构建第一探测报文。In one embodiment, after the proxy server determines the domain name and the corresponding DNS server whose number of abnormal results in the historical analysis record is greater than the detection threshold, as the domain name to be detected and the DNS server to be detected, the proxy server can also set each domain name to be detected The same/different detection period, so that the proxy server constructs the first detection message based on the detection period corresponding to each domain name to be detected.
继续以表1为例,假设待探测域名1为www.abc.com,其对应的DNS服务器为第二备选DNS服务器,待探测域名2为www.xy.com,其对应的DNS服务器为默认DNS服务器,那么代理服务器可以为www.abc.com和www.xy.com分别设置探测周期,上述探测周期的时长可以相同也可以不同,代理服务器基于www.abc.com和www.xy.com的探测周期,分别为www.abc.com和www.xy.com构建第一探测报文,并将www.abc.com的第一探测报文发送至第二备选DNS服务器,将www.xy.com的第一探测报文发送至默认DNS服务器,从而根据源站的响应结果,更新第二备选DNS服务器和默认DNS服务器对应的历史解析记录。Continuing to take Table 1 as an example, suppose the domain name 1 to be detected is www.abc.com, its corresponding DNS server is the second candidate DNS server, the domain name 2 to be detected is www.xy.com, and its corresponding DNS server is the default DNS server, then the proxy server can set the detection period for www.abc.com and www.xy.com respectively. The length of the detection period can be the same or different. The proxy server is based on www.abc.com and www.xy.com. In the detection cycle, the first detection message is constructed for www.abc.com and www.xy.com respectively, and the first detection message of www.abc.com is sent to the second candidate DNS server, and www.xy.com is sent to the second candidate DNS server. The first detection message of com is sent to the default DNS server, so as to update the historical resolution records corresponding to the second candidate DNS server and the default DNS server according to the response result of the source station.
通过为各个待探测域名设置探测周期,代理服务器可以周期性的对各个待探测DNS服务器进行主动探测,从而及时更新各个待探测DNS服务器的工作状态。By setting the detection period for each domain name to be detected, the proxy server can actively detect each DNS server to be detected periodically, so as to update the working status of each DNS server to be detected in time.
在一个实施例中,当代理服务器接收到目标源站反馈的响应数据后,代理服务器可以基于响应结果对目标数据访问请求进行响应。具体的,代理服务器在向用户发送响应数据时,可以基于源站的响应结果,将用户的地址作为目 的地址构建数据包,并将该数据包发送至用户;或者,代理服务器可以按照原接收路径进行返回,并由出口设备或本地代理对地址进行转换,将响应包的源地址改为原目的地址,目的地址改为原源地址。In an embodiment, after the proxy server receives the response data fed back by the target source station, the proxy server may respond to the target data access request based on the response result. Specifically, when the proxy server sends response data to the user, it can construct a data packet based on the response result of the source station, using the user's address as the destination address, and send the data packet to the user; or, the proxy server can follow the original receiving path Return, and the export device or local agent will convert the address, and change the source address of the response packet to the original destination address and the destination address to the original source address.
请参阅图3,本申请还提供一种DNS服务器选择装置,所述装置应用于代理服务器中,所述代理服务器中设置有默认DNS服务器和至少一台备选DNS服务器,并储存有历史解析记录,所述装置包括以下模块。Please refer to FIG. 3, this application also provides a DNS server selection device, the device is applied to a proxy server, the proxy server is set with a default DNS server and at least one candidate DNS server, and stores historical resolution records , The device includes the following modules.
数据接收模块,用于获取目标数据访问请求,并从所述目标数据访问请求中解析得到携带的目标域名。The data receiving module is used to obtain the target data access request, and parse the target domain name carried from the target data access request.
DNS选择模块,用于根据所述目标域名对应的目标历史解析记录,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器,以使得所述目标DNS服务器对所述目标域名进行解析。The DNS selection module is configured to determine a target DNS server among the default DNS server and the at least one candidate DNS server according to the target historical resolution record corresponding to the target domain name, so that the target DNS server can The target domain name is resolved.
解析记录更新模块,用于接收所述目标DNS服务器反馈的解析结果,并将所述目标数据访问请求发送至所述解析结果指向的目标源站,并基于所述目标源站的响应结果,更新所述目标历史解析记录。The resolution record update module is used to receive the resolution result fed back by the target DNS server, and send the target data access request to the target source station pointed to by the resolution result, and update based on the response result of the target source station The target historical analysis record.
在一个实施例中,所述历史解析记录中至少包含域名信息、结果异常次数以及DNS服务器类型。In an embodiment, the historical resolution record includes at least domain name information, number of abnormal results, and DNS server type.
在一个实施例中,根据所述目标域名对应的目标历史解析记录,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器包括以下步骤:根据所述目标域名在所述历史解析记录中确定目标历史解析记录;获取所述目标历史解析记录中结果异常次数不超过目标阈值的DNS服务器类型;基于所述DNS服务器类型和预设规则,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器。In one embodiment, determining the target DNS server among the default DNS server and the at least one candidate DNS server according to the target historical resolution record corresponding to the target domain name includes the following steps: Determine the target historical resolution record in the historical resolution record; obtain the DNS server type whose number of abnormal results in the target historical resolution record does not exceed the target threshold; based on the DNS server type and preset rules, in the default DNS server and the The target DNS server is determined among the at least one candidate DNS server.
在一个实施例中,基于所述目标源站的响应结果,更新所述目标历史解析记录包括:判断所述响应结果是否正常,若是,则对所述目标源站对应的结果异常次数进行重置;若否,则对所述目标源站对应的结果异常次数进行累计。In one embodiment, based on the response result of the target source station, updating the target historical analysis record includes: judging whether the response result is normal, and if so, resetting the number of abnormal results corresponding to the target source station ; If not, accumulate the number of abnormal results corresponding to the target source station.
在一个实施例中,所述装置还包括:阈值设定模块,用于设置初始阈值,并根据更新周期内并发流量和预设比例系数计算调整阈值,以及根据所述初始 阈值和所述调整阈值生成所述目标阈值。In one embodiment, the device further includes: a threshold setting module, configured to set an initial threshold, and calculate an adjustment threshold according to the concurrent traffic in the update period and a preset proportional coefficient, and according to the initial threshold and the adjustment threshold The target threshold is generated.
在一个实施例中,所述装置还包括:主动探测模块,用于确定所述历史解析记录中结果异常次数大于探测阈值的域名及对应的DNS服务器,以作为待探测域名及待探测DNS服务器;并基于所述待探测域名构建第一探测报文,并发送至所述对应的待探测DNS服务器,以获取解析结果;以及基于所述解析结果构建第二探测报文,并发送至所述解析结果指向的源站,并根据所述源站的响应结果,更新所述待探测DNS服务器对应的历史解析记录。In an embodiment, the device further includes: an active detection module, configured to determine the domain name and the corresponding DNS server whose number of abnormal results in the historical analysis record is greater than the detection threshold, as the domain name to be detected and the DNS server to be detected; And construct a first detection message based on the domain name to be detected and send it to the corresponding DNS server to be detected to obtain a resolution result; and construct a second detection message based on the resolution result and send it to the resolution The result points to the source station, and according to the response result of the source station, the historical resolution record corresponding to the DNS server to be detected is updated.
请参阅图4,本申请还提供一种代理服务器,所述代理服务器包括存储器和处理器,所述存储器用于存储计算机程序,当所述计算机程序被所述处理器执行时,可以实现如上述的DNS服务器选择方法。具体地,在硬件层面,该数据转换服务器可以包括处理器、内部总线和存储器。所述存储器可以包括内存以及非易失性存储器。处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行。本领域普通技术人员可以理解,图4所示的结构仅为示意,其并不对上述代理服务器的结构造成限定。例如,所述代理服务器还可包括比图4中所示更多或者更少的组件,例如还可以包括其他的处理硬件,如GPU(Graphics Processing Unit,图像处理器),或者对外通信端口等。当然,除了软件实现方式之外,本申请并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等。4, the present application also provides a proxy server, the proxy server includes a memory and a processor, the memory is used to store a computer program, when the computer program is executed by the processor, can achieve as described above DNS server selection method. Specifically, at the hardware level, the data conversion server may include a processor, an internal bus, and a memory. The memory may include memory and non-volatile memory. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it. Those of ordinary skill in the art can understand that the structure shown in FIG. 4 is only for illustration, and it does not limit the structure of the proxy server described above. For example, the proxy server may also include more or fewer components than shown in FIG. 4, for example, may also include other processing hardware, such as a GPU (Graphics Processing Unit, image processor), or an external communication port. Of course, in addition to software implementation, this application does not exclude other implementations, such as logic devices or a combination of software and hardware, and so on.
本实施例中,所述的处理器可以包括中央处理器(CPU)或图形处理器(GPU),当然也可以包括其他的具有逻辑处理能力的单片机、逻辑门电路、集成电路等,或其适当组合。本实施例所述的存储器可以是用于保存信息的记忆设备。在数字系统中,能保存二进制数据的设备可以是存储器;在集成电路中,一个没有实物形式的具有存储功能的电路也可以为存储器,如RAM、FIFO等;在系统中,具有实物形式的存储设备也可以叫存储器等。实现的时候,该存储器也可以采用云存储器的方式实现,具体实现方式,本说明书不做限定。In this embodiment, the processor may include a central processing unit (CPU) or a graphics processing unit (GPU), of course, may also include other single-chip microcomputers, logic gate circuits, integrated circuits, etc. with logic processing capabilities, or appropriate combination. The memory described in this embodiment may be a memory device for storing information. In a digital system, a device that can store binary data can be a memory; in an integrated circuit, a circuit with storage function without physical form can also be a memory, such as RAM, FIFO, etc.; in a system, it has physical storage The device can also be called a memory and so on. When implemented, the memory may also be implemented in the form of cloud storage, and the specific implementation manner is not limited in this specification.
需要说明的是,本说明书中的代理服务器,具体的实现方式可以参照方法实施例的描述,在此不作一一赘述。It should be noted that, for the specific implementation of the proxy server in this specification, reference may be made to the description of the method embodiment, which will not be repeated here.
由此可见,本申请提供的技术方案,代理服务器中可以预先设置默认DNS服务器和至少一台备选DNS服务器,并储存各个域名的历史解析记录,当代理服务器接收到用户发来的携带有目标域名的目标数据访问请求后,可以首先在储存的历史解析记录中查询到与目标域名相对应的目标历史解析记录,然后根据目标历史解析记录中记录的数值,在默认DNS服务器和至少一台备选DNS服务器中确定出目标DNS服务器,由目标DNS服务器对目标域名进行域名解析。当目标DNS服务器完成对目标域名的域名解析工作后,目标DNS服务器可以向代理服务器反馈解析结果,使得代理服务器可以将目标数据访问请求发送至解析结果指向的目标源站,并且代理服务器还可以目标源站的响应结果,更新目标历史解析记录,这样目标历史解析记录中记录的数值便可以根据反映出各个DNS服务器的最新的工作状态,基于各个DNS服务器的最新的工作状态,代理服务器便可以为目标域名选择最佳的DNS服务器,这样既可以保证最大限度的利用现有资源,又可以保证用户的访问请求都能及时得到响应。It can be seen that, in the technical solution provided by this application, the default DNS server and at least one alternative DNS server can be preset in the proxy server, and the historical resolution records of each domain name can be stored. When the proxy server receives the target from the user After the target data access request of the domain name, the target historical resolution record corresponding to the target domain name can be queried in the stored historical resolution records, and then according to the value recorded in the target historical resolution record, the default DNS server and at least one backup The target DNS server is determined from the selected DNS server, and the target DNS server performs domain name resolution on the target domain name. After the target DNS server completes the domain name resolution of the target domain name, the target DNS server can feed back the resolution result to the proxy server, so that the proxy server can send the target data access request to the target source site pointed to by the resolution result, and the proxy server can also target The source station’s response result updates the target historical resolution record, so that the value recorded in the target historical resolution record can reflect the latest working status of each DNS server. Based on the latest working status of each DNS server, the proxy server can be Select the best DNS server for the target domain name, which can ensure the maximum use of existing resources and ensure that users' access requests can be responded to in time.
通过以上的实施例的描述,本领域的技术人员可以清楚地了解到各实施例可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic A disc, an optical disc, etc., include several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiment.
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of this application, and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection of this application. Within range.

Claims (11)

  1. 一种DNS服务器选择方法,所述方法应用于代理服务器中,所述代理服务器中配置有默认DNS服务器和至少一台备选DNS服务器,并储存有历史解析记录,所述方法包括:A method for selecting a DNS server, the method is applied to a proxy server, the proxy server is configured with a default DNS server and at least one candidate DNS server, and stores historical resolution records, the method includes:
    获取目标数据访问请求,并从所述目标数据访问请求中解析得到携带的目标域名;Obtaining a target data access request, and parsed from the target data access request to obtain the carried target domain name;
    根据所述目标域名对应的目标历史解析记录,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器,以使得所述目标DNS服务器对所述目标域名进行解析;Determine a target DNS server from the default DNS server and the at least one candidate DNS server according to the target historical resolution record corresponding to the target domain name, so that the target DNS server resolves the target domain name;
    接收所述目标DNS服务器反馈的解析结果,并将所述目标数据访问请求发送至所述解析结果指向的目标源站,并基于所述目标源站的响应结果,更新所述目标历史解析记录。Receive the resolution result fed back by the target DNS server, and send the target data access request to the target source station pointed to by the resolution result, and update the target historical resolution record based on the response result of the target source station.
  2. 根据权利要求1所述的方法,其中,所述历史解析记录中至少包含域名信息、结果异常次数以及DNS服务器类型。The method according to claim 1, wherein the historical resolution record contains at least domain name information, number of abnormal results, and DNS server type.
  3. 根据权利要求2所述的方法,其中,根据所述目标域名对应的目标历史解析记录,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器包括:The method according to claim 2, wherein, according to the target historical resolution record corresponding to the target domain name, determining the target DNS server from the default DNS server and the at least one candidate DNS server comprises:
    根据所述目标域名在所述历史解析记录中确定目标历史解析记录;Determining a target historical resolution record in the historical resolution record according to the target domain name;
    获取所述目标历史解析记录中结果异常次数不超过目标阈值的DNS服务器类型;Acquiring the DNS server type whose number of abnormal results in the target historical analysis record does not exceed the target threshold;
    基于所述DNS服务器类型和预设规则,在所述默认DNS服务器和所述至少一台备选DNS服务器中确定目标DNS服务器。Based on the DNS server type and preset rules, a target DNS server is determined among the default DNS server and the at least one candidate DNS server.
  4. 根据权利要求2所述的方法,其中,基于所述目标源站的响应结果,更新所述目标历史解析记录包括:The method according to claim 2, wherein, based on the response result of the target source station, updating the target historical analysis record comprises:
    判断所述响应结果是否正常,若是,则对所述目标源站对应的结果异常次数进行重置;Determine whether the response result is normal, and if so, reset the number of abnormal results corresponding to the target source station;
    若否,则对所述目标源站对应的结果异常次数进行累计。If not, the number of abnormal results corresponding to the target source station is accumulated.
  5. 根据权利要求3所述的方法,其中,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    设置初始阈值,并根据更新周期内并发流量和预设比例系数计算调整阈值;Set the initial threshold, and calculate and adjust the threshold according to the concurrent traffic in the update period and the preset proportional coefficient;
    根据所述初始阈值和所述调整阈值生成所述目标阈值。The target threshold value is generated according to the initial threshold value and the adjustment threshold value.
  6. 根据权利要求2所述的方法,其中,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    确定所述历史解析记录中结果异常次数大于探测阈值的域名及对应的DNS服务器,以作为待探测域名及待探测DNS服务器;Determining the domain name and the corresponding DNS server with the number of abnormal results in the historical analysis record greater than the detection threshold as the domain name to be detected and the DNS server to be detected;
    基于所述待探测域名构建第一探测报文,并发送至所述对应的待探测DNS服务器,以获取解析结果;Constructing a first detection message based on the domain name to be detected, and sending it to the corresponding DNS server to be detected to obtain a resolution result;
    基于所述解析结果构建第二探测报文,并发送至所述解析结果指向的源站,并根据所述源站的响应结果,更新所述待探测DNS服务器对应的历史解析记录。Construct a second detection message based on the analysis result and send it to the source station pointed to by the analysis result, and update the historical resolution record corresponding to the DNS server to be detected according to the response result of the source station.
  7. 根据权利要求6所述的方法,其中,确定所述历史解析记录中结果异常次数大于探测阈值的域名及对应的DNS服务器,以作为待探测域名及待探测DNS服务器之后,所述方法还包括:The method according to claim 6, wherein after determining the domain name and the corresponding DNS server whose abnormal number of results in the historical analysis record is greater than the detection threshold as the domain name to be detected and DNS server to be detected, the method further comprises:
    为各个待探测域名设置相同的/不同的探测周期,以使得所述代理服务器基于各个待探测域名对应的所述探测周期,构建所述第一探测报文。The same/different detection period is set for each domain name to be detected, so that the proxy server constructs the first detection message based on the detection period corresponding to each domain name to be detected.
  8. 根据权利要求1所述的方法,其中,从所述目标数据访问请求中解析得到携带的目标域名包括:The method according to claim 1, wherein the target domain name that is obtained by parsing the target data access request comprises:
    从所述目标数据访问请求对应的数据报文中解析出UR I,并从所述URI中确定出所述目标域名。The URI is parsed from the data message corresponding to the target data access request, and the target domain name is determined from the URI.
  9. 根据权利要求1所述的方法,其中,获取目标数据访问请求包括:The method according to claim 1, wherein obtaining the target data access request comprises:
    接收由用户网络出口设备发送的目标数据访问请求,其中所述目标数据访问请求被所述网络出口设备重定向至所述代理服务器;Receiving a target data access request sent by a user network exit device, wherein the target data access request is redirected to the proxy server by the network exit device;
    和/或接收由本地代理转发的目标数据访问请求。And/or receive the target data access request forwarded by the local agent.
  10. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    基于所述响应结果对所述目标数据访问请求进行响应。Respond to the target data access request based on the response result.
  11. 一种代理服务器,所述代理服务器包括存储器和处理器,所述存储器用于存储计算机程序,当所述计算机程序被所述处理器执行时,实现如权利要求1至10中任一权利要求所述的方法。A proxy server, the proxy server includes a memory and a processor, the memory is used to store a computer program, when the computer program is executed by the processor, the implementation is as described in any one of claims 1 to 10 The method described.
PCT/CN2020/074972 2020-01-17 2020-02-12 Dns server selection method and proxy server WO2021142867A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010052800.3 2020-01-17
CN202010052800.3A CN111262938B (en) 2020-01-17 2020-01-17 DNS server selection method and proxy server

Publications (1)

Publication Number Publication Date
WO2021142867A1 true WO2021142867A1 (en) 2021-07-22

Family

ID=70948897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/074972 WO2021142867A1 (en) 2020-01-17 2020-02-12 Dns server selection method and proxy server

Country Status (2)

Country Link
CN (1) CN111262938B (en)
WO (1) WO2021142867A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691540A (en) * 2021-08-25 2021-11-23 杭州安恒信息技术股份有限公司 Abnormal domain name detection method, system and related components
CN113835875A (en) * 2021-08-17 2021-12-24 新华三大数据技术有限公司 Load balancing method, apparatus, electronic device and system
CN113900939A (en) * 2021-09-30 2022-01-07 深圳依时货拉拉科技有限公司 Test environment access method, apparatus, readable storage medium and computer device
CN114285700A (en) * 2021-12-28 2022-04-05 江苏通过宝信息技术有限公司 Data processing method in industrial Internet of things gateway and industrial Internet of things gateway
CN114285743A (en) * 2021-12-23 2022-04-05 建信金融科技有限责任公司 Method and device for updating configuration information, electronic equipment and storage medium
CN114629911A (en) * 2022-04-18 2022-06-14 北京字节跳动网络技术有限公司 Method, apparatus, device, medium and program product for processing domain name resolution request
CN114915610A (en) * 2022-04-29 2022-08-16 北京字跳网络技术有限公司 Method, device, electronic equipment and storage medium for sending network request
CN115001757A (en) * 2022-05-12 2022-09-02 中国人民解放军国防科技大学 DNS analysis-based host abnormal behavior analysis method and device
CN116233062A (en) * 2021-12-03 2023-06-06 腾讯科技(深圳)有限公司 Information processing method, device, computer equipment and storage medium
WO2025097998A1 (en) * 2023-11-10 2025-05-15 快上云(上海)网络科技有限公司 Generalized network intelligent optimization method and generalized network intelligent optimization terminal

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901243B (en) * 2020-07-02 2022-08-23 中移(杭州)信息技术有限公司 Service request routing method, scheduler and service platform
CN112165517B (en) * 2020-09-22 2022-09-20 成都知道创宇信息技术有限公司 Return source detection method and device, storage medium and electronic equipment
CN112134957B (en) * 2020-09-23 2022-08-05 北京奇艺世纪科技有限公司 Data request method, device, server and storage medium
CN112291365B (en) * 2020-11-11 2024-02-27 天翼安全科技有限公司 Access balance processing method, device, computer equipment and storage medium
CN112887444A (en) * 2021-01-19 2021-06-01 网宿科技股份有限公司 VPN (virtual private network) request processing method, client device and system
CN113037884A (en) * 2021-02-25 2021-06-25 浙江九州云信息科技有限公司 Method for enhancing DNS (Domain name System) shunt application based on edge management
CN113905091B (en) * 2021-09-15 2023-09-01 盐城天眼察微科技有限公司 Method and device for processing access request
CN114338817B (en) * 2021-12-22 2023-11-10 中国人民银行清算总中心 Multi-plane network access control method and multi-plane network
CN114301872B (en) * 2021-12-27 2023-12-26 奇安信科技集团股份有限公司 Domain name based access method and device, electronic equipment and storage medium
CN115022285B (en) * 2022-06-02 2024-02-09 北京亿安天下科技股份有限公司 Method and device for configuring one-key automatic internet communication equipment
CN115378906B (en) * 2022-08-16 2024-02-13 北京轻网科技股份有限公司 Local DNS proxy method, device, equipment and medium based on VPN framework
CN118200284A (en) * 2024-03-11 2024-06-14 杭州迪普科技股份有限公司 Domain name resolution method, device, computer equipment and storage medium
CN120034581B (en) * 2025-04-23 2025-07-15 四川天邑康和通信股份有限公司 DNS server response method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102572014A (en) * 2012-03-07 2012-07-11 华为终端有限公司 Message processing method and device and system thereof
CN103024098A (en) * 2012-12-27 2013-04-03 北京百度网讯科技有限公司 Domain name resolution method, system and device
CN104301171A (en) * 2014-09-11 2015-01-21 赛尔网络有限公司 Network performance measuring method and system based on DNS authoritative server
CN108173979A (en) * 2017-12-25 2018-06-15 新华三信息安全技术有限公司 A kind of message processing method, device, equipment and storage medium
US20180191672A1 (en) * 2016-12-30 2018-07-05 Hughes Network Systems Llc System and method for improving proxy server performance using local domain name system (dns) cache and connectivity monitoring

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196060A (en) * 2011-06-15 2011-09-21 北京蓝汛通信技术有限责任公司 Method and system for selecting source station by Cache server
US10142282B2 (en) * 2012-11-05 2018-11-27 Pismo Labs Technology Limited Methods and gateways for processing DNS request
CN103002069A (en) * 2012-12-25 2013-03-27 北京小米科技有限责任公司 Domain name resolution method, device and system
CN103780715B (en) * 2014-01-29 2018-02-27 百度在线网络技术(北京)有限公司 Domain name mapping implementation method, client and Cloud Server
CN103973835A (en) * 2014-05-16 2014-08-06 北京金山网络科技有限公司 Domain name system server selection method and device
CN104836732B (en) * 2015-03-31 2018-06-19 清华大学 The automatic selecting method and system of network connection
CN108777709A (en) * 2018-05-31 2018-11-09 康键信息技术(深圳)有限公司 Website access method, device, computer equipment and storage medium
CN109379213A (en) * 2018-09-19 2019-02-22 杭州安恒信息技术股份有限公司 Website Usability alarm method and warning system based on access log response message
CN109660425B (en) * 2018-12-13 2021-05-18 网宿科技股份有限公司 Monitoring method, determining method, monitoring equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102572014A (en) * 2012-03-07 2012-07-11 华为终端有限公司 Message processing method and device and system thereof
CN103024098A (en) * 2012-12-27 2013-04-03 北京百度网讯科技有限公司 Domain name resolution method, system and device
CN104301171A (en) * 2014-09-11 2015-01-21 赛尔网络有限公司 Network performance measuring method and system based on DNS authoritative server
US20180191672A1 (en) * 2016-12-30 2018-07-05 Hughes Network Systems Llc System and method for improving proxy server performance using local domain name system (dns) cache and connectivity monitoring
CN108173979A (en) * 2017-12-25 2018-06-15 新华三信息安全技术有限公司 A kind of message processing method, device, equipment and storage medium

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835875A (en) * 2021-08-17 2021-12-24 新华三大数据技术有限公司 Load balancing method, apparatus, electronic device and system
CN113691540A (en) * 2021-08-25 2021-11-23 杭州安恒信息技术股份有限公司 Abnormal domain name detection method, system and related components
CN113900939A (en) * 2021-09-30 2022-01-07 深圳依时货拉拉科技有限公司 Test environment access method, apparatus, readable storage medium and computer device
CN116233062A (en) * 2021-12-03 2023-06-06 腾讯科技(深圳)有限公司 Information processing method, device, computer equipment and storage medium
CN114285743A (en) * 2021-12-23 2022-04-05 建信金融科技有限责任公司 Method and device for updating configuration information, electronic equipment and storage medium
CN114285743B (en) * 2021-12-23 2023-06-06 建信金融科技有限责任公司 Method, device, electronic equipment and storage medium for updating configuration information
CN114285700A (en) * 2021-12-28 2022-04-05 江苏通过宝信息技术有限公司 Data processing method in industrial Internet of things gateway and industrial Internet of things gateway
CN114629911A (en) * 2022-04-18 2022-06-14 北京字节跳动网络技术有限公司 Method, apparatus, device, medium and program product for processing domain name resolution request
CN114915610A (en) * 2022-04-29 2022-08-16 北京字跳网络技术有限公司 Method, device, electronic equipment and storage medium for sending network request
CN114915610B (en) * 2022-04-29 2024-04-19 北京字跳网络技术有限公司 Method, device, electronic device and storage medium for sending network request
CN115001757A (en) * 2022-05-12 2022-09-02 中国人民解放军国防科技大学 DNS analysis-based host abnormal behavior analysis method and device
CN115001757B (en) * 2022-05-12 2023-08-08 中国人民解放军国防科技大学 A method and device for analyzing host abnormal behavior based on DNS resolution
WO2025097998A1 (en) * 2023-11-10 2025-05-15 快上云(上海)网络科技有限公司 Generalized network intelligent optimization method and generalized network intelligent optimization terminal

Also Published As

Publication number Publication date
CN111262938A (en) 2020-06-09
CN111262938B (en) 2021-06-22

Similar Documents

Publication Publication Date Title
WO2021142867A1 (en) Dns server selection method and proxy server
US11811657B2 (en) Updating routing information based on client location
US9985927B2 (en) Managing content delivery network service providers by a content broker
US9160703B2 (en) Request routing management based on network components
JP4529974B2 (en) Server load balancing system, server load balancing device, content management device, and server load balancing program
US8301778B2 (en) Service provider registration by a content broker
US9800539B2 (en) Request routing management based on network components
AU778459B2 (en) Method for high-performance delivery of web content
EP2266064B1 (en) Request routing
KR101379864B1 (en) Request routing using network computing components
US8732309B1 (en) Request routing utilizing cost information
US7143195B2 (en) HTTP redirector
US7676812B2 (en) Large scale event notification system
US20100042725A1 (en) Contents provider participation type contents delivery system and method, and contents delivery network domain name system server thereof
US20030172163A1 (en) Server load balancing system, server load balancing device, and content management device
CN102301682A (en) Method and system for network caching, domain name system redirection sub-system thereof
CN110336848A (en) An access request scheduling method, scheduling system, and equipment
CN115118700A (en) Communication method and communication system
CN114338809A (en) Access control method, device, electronic equipment and storage medium
US12155548B1 (en) Anomaly detection in content delivery networks
JP2006260592A (en) Content management device, and content management program
CN118413574A (en) Request processing method, device, equipment and medium based on content distribution network
JP2006260591A (en) Content server, and content distribution management program
ZA200206147B (en) Method for high-performance delivery of web content.

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: 20913328

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020913328

Country of ref document: EP

Effective date: 20220329

122 Ep: pct application non-entry in european phase

Ref document number: 20913328

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20913328

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE