CN111049941A - DNS scheduling method, domain name server and computer readable storage medium - Google Patents

DNS scheduling method, domain name server and computer readable storage medium Download PDF

Info

Publication number
CN111049941A
CN111049941A CN201911185411.1A CN201911185411A CN111049941A CN 111049941 A CN111049941 A CN 111049941A CN 201911185411 A CN201911185411 A CN 201911185411A CN 111049941 A CN111049941 A CN 111049941A
Authority
CN
China
Prior art keywords
domain name
domain
configuration
view
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911185411.1A
Other languages
Chinese (zh)
Inventor
张安兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Dnion Network Technology Co ltd
Original Assignee
Shanghai Dnion Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Dnion Network Technology Co ltd filed Critical Shanghai Dnion Network Technology Co ltd
Priority to CN201911185411.1A priority Critical patent/CN111049941A/en
Publication of CN111049941A publication Critical patent/CN111049941A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

A DNS scheduling method, a domain name server and a computer readable storage medium are provided, the DNS scheduling method comprises the following steps: when a domain name resolution request is received, acquiring a domain name to be resolved from the domain name resolution request; judging whether the domain of the domain name to be analyzed belongs to an analyzable domain range or not; when the domain of the domain name to be analyzed belongs to an analyzable domain range, judging whether the configuration corresponding to the domain name to be analyzed exists in a domain configuration file corresponding to the domain; when the domain configuration file has the configuration corresponding to the domain name to be resolved, determining the target configuration corresponding to the domain name to be resolved, wherein the target configuration corresponding to the domain name to be resolved comprises the IP address of a target CDN server; and outputting the target configuration corresponding to the domain name to be analyzed. The scheme can improve the domain name resolution efficiency.

Description

DNS scheduling method, domain name server and computer readable storage medium
Technical Field
The embodiment of the invention relates to the field of DNS scheduling, in particular to a DNS scheduling method, a domain name server and a computer readable storage medium
Background
The Domain Name System (DNS) is a core service of the internet, and the DNS can map Domain names and IP addresses to each other in a distributed database, so that people can more conveniently access the internet through Domain names without remembering the IP addresses that can be directly read by machines, wherein the Domain names must have a corresponding IP address. The DNS consists of a resolver and a domain name server. The domain name server is a server that stores domain names and corresponding IP addresses of all hosts in the internet and has a function of converting domain names into IP addresses.
A Content Delivery Network (CDN) adds a new Network architecture to the existing internet to deliver internet Content to the "edge" of the Network closest to the user, so that the user can obtain desired Content nearby, and the response speed of the user to access a website is increased. For domain names accelerated by the CDN, the open source software BIND is generally used to perform DNS scheduling, which is mainly implemented by a view (view) function of BIND. In the BIND service, each view has a static configuration (hosts) file, and in the CDN application scenario, in order to make all domain names correctly resolved in all views, all views and domain names must be configured in the BIND service accordingly.
However, the existing DNS scheduling method using BIND has low domain name resolution efficiency.
Disclosure of Invention
The technical problem solved by the embodiment of the invention is that the domain name resolution efficiency is lower.
To solve the foregoing technical problem, an embodiment of the present invention provides a DNS scheduling method, including: when a domain name resolution request is received, acquiring a domain name to be resolved from the domain name resolution request; judging whether the domain of the domain name to be analyzed belongs to an analyzable domain range or not; when the domain of the domain name to be analyzed belongs to an analyzable domain range, judging whether the configuration corresponding to the domain name to be analyzed exists in a domain configuration file corresponding to the domain; when the domain configuration file has the configuration corresponding to the domain name to be resolved, determining the target configuration corresponding to the domain name to be resolved, wherein the target configuration corresponding to the domain name to be resolved comprises the IP address of a target CDN server; and outputting the target configuration corresponding to the domain name to be analyzed.
Optionally, when the domain configuration file has a configuration corresponding to the domain name to be resolved, determining a target configuration corresponding to the domain name to be resolved includes: inquiring whether the domain name to be analyzed has a corresponding view configuration, wherein the domain name to be analyzed is uniquely corresponding to the view configuration, and the view configuration comprises the following steps: the domain name to be analyzed corresponds to a plurality of views, and the IP address of a CDN server corresponding to each view; and when the domain name to be analyzed does not have the corresponding view configuration, taking the configuration corresponding to the domain name to be analyzed in the domain configuration file as the target configuration corresponding to the domain name to be analyzed, wherein the domain configuration file comprises the IP address of the target CDN server.
Optionally, when the domain configuration file has a configuration corresponding to the domain name to be resolved, determining a target configuration corresponding to the domain name to be resolved includes: when the domain name to be analyzed has the corresponding view configuration, acquiring a source IP address from the domain name analysis request; determining a target view corresponding to the domain name to be analyzed according to the source IP address; and inquiring the IP address of the CDN server corresponding to the target view in the view configuration, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the target view.
Optionally, when the domain configuration file has a configuration corresponding to the domain name to be resolved, determining a target configuration corresponding to the domain name to be resolved includes: if the IP address of the CDN server corresponding to the target view is not queried in the view configuration, sequentially acquiring a higher-level view of the target view according to view topology information of the target view until the acquired higher-level view has the IP address of the corresponding CDN server, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the higher-level view.
Optionally, when the domain configuration file has a configuration corresponding to the domain name to be resolved, determining a target configuration corresponding to the domain name to be resolved includes: when the IP addresses of a plurality of CDN servers exist in the superior view, the IP address of at least one CDN server is selected from the IP addresses of the CDN servers, and the target configuration corresponding to the domain name to be analyzed is determined based on the selected IP address of the CDN server.
Optionally, the number of the domain configuration files is one.
An embodiment of the present invention further provides a domain name server, including: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is suitable for acquiring a domain name to be analyzed from a domain name analysis request when the domain name analysis request is received; the first judging unit is suitable for judging whether the domain of the domain name to be analyzed belongs to an analyzable domain range or not; the second judging unit is suitable for judging whether the configuration corresponding to the domain name to be analyzed exists in a domain configuration file corresponding to the domain when the domain of the domain name to be analyzed belongs to an analyzable domain range; a determining unit, adapted to determine, when the domain configuration file has a configuration corresponding to the domain name to be resolved, a target configuration corresponding to the domain name to be resolved, where the target configuration corresponding to the domain name to be resolved includes an IP address of a target CDN server; and the output unit is suitable for outputting the target configuration corresponding to the domain name to be analyzed.
Optionally, the determining unit is adapted to query whether the domain name to be resolved has a corresponding view configuration, where the domain name to be resolved uniquely corresponds to the view configuration, and the view configuration includes: the domain name to be analyzed corresponds to a plurality of views, and the IP address of a CDN server corresponding to each view; and when the domain name to be analyzed does not have the corresponding view configuration, taking the configuration corresponding to the domain name to be analyzed in the domain configuration file as the target configuration corresponding to the domain name to be analyzed, wherein the domain configuration file comprises the IP address of the target CDN server.
Optionally, the determining unit is adapted to obtain a source IP address from the domain name resolution request when the domain name to be resolved has a corresponding view configuration; determining a target view corresponding to the domain name to be analyzed according to the source IP address; and inquiring the IP address of the CDN server corresponding to the target view in the view configuration, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the target view.
Optionally, the determining unit is adapted to, if the IP address of the CDN server corresponding to the target view is not queried in the view configuration, sequentially obtain, according to the view topology information of the target view, a higher-level view of the target view until the obtained higher-level view has an IP address of the CDN server corresponding to the target view, and determine, based on the IP address of the CDN server corresponding to the higher-level view, the target configuration corresponding to the domain name to be resolved.
Optionally, the determining unit is adapted to select an IP address of at least one CDN server from the IP addresses of the CDN servers when the IP addresses of the CDN servers exist in the superior view, and determine the target configuration corresponding to the domain name to be resolved based on the selected IP address of the CDN server.
Optionally, the number of the domain configuration files is one.
The embodiment of the present invention further provides another domain name server, which includes a memory and a processor, where the memory stores computer instructions capable of being executed on the processor, and the processor executes any of the above steps of the DNS scheduling method when executing the computer instructions.
The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium is a non-volatile storage medium or a non-transitory storage medium, and has computer instructions stored thereon, and when the computer instructions are executed, the computer instructions perform any of the steps of the DNS scheduling method.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
when a domain name resolution request is received, judging whether a domain of a domain name to be resolved belongs to a resolvable domain range, and when the domain of the domain name to be resolved belongs to the resolvable domain range, judging whether a configuration corresponding to the domain name to be resolved exists in a domain configuration file corresponding to the domain, and further obtaining a target configuration of the domain name to be resolved based on the domain configuration file corresponding to the domain, wherein the target configuration of the domain name to be resolved comprises an IP address of a CDN server. In the prior art, the view needs to be traversed according to the IP address in the domain name resolution request to determine the target view, and then whether the domain of the domain name to be resolved belongs to the resolvable domain range is determined according to the target view, and even if the domain of the domain name to be resolved does not belong to the resolvable domain range, all views need to be traversed according to the IP address.
Furthermore, by adopting a mode of combining the domain configuration file with the view configuration, the redundancy of the configuration data of the domain name to be analyzed can be reduced, and meanwhile, the individualized configuration requirement of the configuration of the domain name to be analyzed can be met.
Furthermore, a domain configuration file is set, so that the redundancy of the configuration data of the domain name to be analyzed can be further reduced, the maintenance of the configuration data of the domain name to be analyzed is facilitated, and the reduction of the consumed memory can be expected when a program is loaded.
Further, when the configuration corresponding to the target view is not queried in the view configuration, the configuration of the superior view is searched based on the view topology information of the target view, and the configuration corresponding to the superior view is used as the target configuration corresponding to the domain name to be resolved, so that the probability that the domain name to be resolved cannot be resolved can be further reduced.
Drawings
Fig. 1 is a flowchart of a DNS scheduling method in an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a domain name server in the embodiment of the present invention.
Detailed Description
In the prior art, for domain names subjected to CDN acceleration, the DNS scheduling is usually performed by using open source software BIND, which is mainly implemented by using a view (view) function of BIND. When a domain name resolution request is received, first determining which view the source IP of the domain name resolution request belongs to, for example, the IP of the telecommunications in zhejiang is 115.233.237.1, 115.233.237.1 is in the address field of 115.233.237.0/24, and then entering the configuration of cn _ ct _ zhejiang for view. If the source IP of the domain name resolution request does not match the view, then null is returned. After the view is found, a matching domain (zone) is removed according to the domain name to be analyzed, for example, the domain name x.y.com.cdn1.com to be analyzed, and the configuration of zone "cdn 1.com" is matched, so that the configuration of the domain name to be analyzed is found in a hosts file "/var/named/cdn 1_ cn _ ct _ zhejiang. And returning to the null if the zone matched with the domain name to be resolved is not found. After finding the hosts file corresponding to the domain name to be resolved, if the hosts file has the configuration corresponding to the domain name to be resolved, such as x.y.com.cdn1.com IN A1.1.1.1, 1.1.1 is returned. If the hosts file does not have the configuration corresponding to the domain name to be resolved, the returned result is null, namely the domain name to be resolved is not resolved.
However, in the prior art, when a domain name resolution request is received, views need to be traversed first, which view is hit is determined according to a source IP of the domain name resolution request, and then it is determined whether the zone belongs to the DNS resolution, for example, the requested domain name to be resolved is x.cdn3.com, even if the domain name to be resolved does not belong to the DNS resolution, the IP determination must be performed once, which results in low resolution efficiency.
In the embodiment of the invention, when a domain name resolution request is received, whether a domain of a domain name to be resolved belongs to a resolvable domain range is judged firstly, and only when the domain of the domain name to be resolved belongs to the resolvable domain range, whether the configuration corresponding to the domain name to be resolved exists in a domain configuration file corresponding to the domain is judged, so that the target configuration of the domain name to be resolved is obtained based on the domain configuration file corresponding to the domain, wherein the target configuration of the domain name to be resolved comprises the IP address of the CDN server. Compared with the prior art, the DNS scheduling provided by the embodiment of the invention can effectively avoid the processing of domain name resolution requests which do not belong to the resolvable domain range, thereby improving the domain name resolution efficiency.
In order to make the aforementioned objects, features and advantages of the embodiments of the present invention more comprehensible, specific embodiments accompanied with figures are described in detail below.
Referring to fig. 1, a flowchart of a DNS scheduling method in the embodiment of the present invention is shown, which specifically includes the following steps.
Step 11, when receiving a domain name resolution request, obtaining a domain name to be resolved from the domain name resolution request.
In a specific implementation, when a client needs to resolve a domain name, a domain name resolution request may be made and sent to a local domain name server (LocalDNS). After receiving the domain name resolution request, the localDNS queries a local cache first, and detects whether the local cache has a record of configuration corresponding to the domain name to be resolved in the domain name resolution request. And if the local cache has the configuration record corresponding to the domain name to be resolved, the LocalDNS returns the configuration corresponding to the queried domain name to be resolved to the client. If the local cache does not have the configuration record corresponding to the domain name to be resolved, the LocalDNS sends the domain name resolution request to a ROOT domain name server (ROOT DNS). The ROOT DNS returns to the LocalDNS the address of the domain name server of a domain being queried (the ROOT subdomain).
And the LocalDNS sends a domain name resolution request to the domain name server according to the address of the domain name server returned by the ROOT DNS. And when the domain name server receives the domain name resolution request, acquiring the domain name to be resolved from the domain name resolution request.
And step 12, judging whether the domain of the domain name to be resolved belongs to the resolvable domain range.
In specific implementation, the domain name server may analyze a domain (zone) within a preset resolvable domain range, and determine whether the zone of the domain name to be analyzed belongs to the resolvable domain range of the domain name server.
Step 13, when the domain of the domain name to be resolved belongs to the resolvable domain range, judging whether the configuration corresponding to the domain name to be resolved exists in the domain configuration file corresponding to the domain.
In specific implementation, when a zone of a domain name to be resolved belongs to a resolvable domain range, whether a zone configuration file corresponding to the domain name to be resolved exists in a zone configuration file corresponding to the zone may be a hosts file is determined. The zone configuration file may include a configuration corresponding to the domain name to be resolved. And when the zone of the domain name to be resolved does not belong to the resolvable domain range, returning to null to indicate that the domain name to be resolved does not have the corresponding configuration.
For example, the domain name to be resolved is x.y.com.cdn1.com, the domain range to be resolved of the domain name server includes a.com, and if the x.y.com.cdn1.com belongs to a.com, it is determined whether the configuration corresponding to the x.y.com.cdn1.com exists in the zone configuration file corresponding to the a.com.
Step 14, when the domain configuration file has the configuration corresponding to the domain name to be resolved, determining the target configuration corresponding to the domain name to be resolved.
In specific implementation, when the domain configuration file has a configuration corresponding to the domain name to be resolved, the configuration corresponding to the domain name to be resolved may be determined based on the domain configuration file. The domain configuration file may include the IP address of the target CDN server. The target CDN server may provide the corresponding service for the client.
For example, IN the domain configuration file x.y.com.cdn1.com IN a1.1.1.1, the configuration corresponding to the domain name x.y.com.cdn1.com to be resolved is 1.1.1.1.
And step 15, outputting the target configuration corresponding to the domain name to be analyzed.
After the target configuration corresponding to the domain name to be resolved is obtained, the target configuration corresponding to the domain name to be resolved can be output. In the embodiment of the present invention, the domain name server may output the target configuration corresponding to the domain name to be resolved to the LocalDNS, and the LocalDNS caches the target configuration corresponding to the domain name to be resolved and outputs the target configuration corresponding to the domain name to be resolved to the client.
It can be seen from the above that, when a domain name resolution request is received, it is determined whether a domain of a domain name to be resolved belongs to a resolvable domain range, and when the domain of the domain name to be resolved belongs to the resolvable domain range, it is determined whether a configuration corresponding to the domain name to be resolved exists in a domain configuration file corresponding to the domain, so as to obtain a target configuration of the domain name to be resolved based on the domain configuration file corresponding to the domain, where the target configuration of the domain name to be resolved includes an IP address of the CDN server. In the prior art, the view needs to be traversed according to the IP address in the domain name resolution request to determine the target view, and then whether the domain of the domain name to be resolved belongs to the resolvable domain range is determined according to the target view, and even if the domain of the domain name to be resolved does not belong to the resolvable domain range, all views need to be traversed according to the IP address.
In the prior art, in a CDN application scenario, in order to ensure that all domain names can be correctly resolved in all views, all views and domain names must be configured in BIND service, and if a view is not configured, the view is not resolved. The same zone in each view corresponds to a hosts file, the same domain name needs to have corresponding configuration in the hosts files, and the configuration corresponding to a plurality of domain names may be the same, which causes data redundancy, and when a program is loaded, a large amount of memory needs to be consumed.
For example, the x.y.com.cdn1.com domain names are equally configured nationwide. Zhejiang telecommunication, zone is cnd1.com, and x.y.com. cdn1.com IN A1.1.1.1 is found IN cdn1_ cn _ ct _ zhejiang.hosts corresponding to cnd1. com. Jiangsu telecom, zone is cnd1.com, and x.y.com. cdn1.com IN A1.1.1.1 is found IN cdn1_ cn _ ct _ jiangsu. hosts corresponding to cnd1. com. This results in redundancy of configuration data, but there cannot be no configuration, for example, cdn1_ cn _ ct _ jiangsu. hosts have no configuration of x.y.com.cdn1.com, and thus, when all users in Jiangsu telecom access, it cannot resolve.
In order to solve the problem of configuration data redundancy, in the embodiment of the present invention, when a domain configuration file has a configuration corresponding to the domain name to be resolved, whether a view configuration (view) corresponding to the domain name to be resolved exists is queried. The view configuration uniquely corresponds to the domain name to be resolved, which is the basis of scheduling resolution, and the view configuration may include: the domain name to be analyzed comprises a plurality of views corresponding to the domain name to be analyzed and an IP address of a CDN server corresponding to each view. The view configuration is used for determining the configuration corresponding to each view. The view configuration may be a two-dimensional scheduling table (schedulable), as shown in table 1, each row is a view name of a view and a corresponding configuration (IP address of CDN server) to adapt to a domain name with a special configuration, where the IPs field is the IP address of the CDN server corresponding to the view.
TABLE 1
view IPS
china-zhejiang-jinhua-dianxin 1.1.1.1,2.2.2.2
zhejiang-dianxin 2.2.2.2,3.3.3.3
china-dianxin 4.4.4.4
In Table 1, the view is the configuration of china-zhejiang-jinhua-dianxin corresponding to 1.1.1.1, 2.2.2.2. The view is the arrangement corresponding to zhejiang-dianxin is 2.2.2, 3.3.3.3. The view is the configuration corresponding to china-dianxin is 4.4.4.4.
And when the domain name to be analyzed does not have the corresponding view configuration, taking the configuration corresponding to the domain name to be analyzed in the domain configuration file as the target configuration corresponding to the domain name to be analyzed. Therefore, for the same configuration under different views in the same zone, the same domain configuration file can be adopted, and the domain configuration file does not need to be respectively set for the same domain name of each view in the same zone, so that the data redundancy can be reduced, and the memory consumed during program loading can be saved.
By adopting the mode of combining the domain configuration file with the view configuration, the redundancy of configuration data can be reduced, and the individualized configuration requirements of partial domain names can be met, so that different resolution strategies can be flexibly customized for any domain name.
To further reduce the redundancy of the configuration data, in the embodiment of the present invention, the number of the domain configuration files is one. In the prior art, in BIND, each view has a hosts file, and the configuration inside is the same. For example, x.y.com.cdn1.com is provided with a host file x.y.com.cdn1.com IN a1.1.1.1 IN each view, if the host file is modified, all the host files need to be modified, but the embodiment of the invention sets a domain configuration file, when the domain configuration file needs to be modified, only one host file needs to be modified, so that the maintenance difficulty can be reduced, the configuration data has no redundancy, and when a program is loaded, the reduction of the consumed memory can be expected. In addition, setting a domain configuration file is also beneficial to configuring backup, synchronization and the like.
In the embodiment of the invention, when the domain name to be analyzed has the corresponding view configuration, a source IP address is obtained from a domain name analysis request; and determining a target view corresponding to the domain name to be analyzed according to the source IP address. Specifically, a target view corresponding to the domain name to be resolved can be determined by matching the source IP address with the IP address in the address base; and inquiring the configuration corresponding to the target view in the view configuration. When the IP address of the corresponding CDN server exists in the target view, determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the target view, namely taking the IP address of the CDN server corresponding to the target view as the IP address of the CDN server in the target configuration corresponding to the domain name to be resolved.
In practical application, there is no corresponding configuration in the hit hosts file, and since only the hit hosts file is queried during resolution, even if there is a configuration in other hosts files, the configuration corresponding to the domain name to be resolved cannot be obtained, so that the domain name to be resolved has no resolution. Or the target view does not have the corresponding configuration, so that the domain name to be resolved is not resolved. In order to solve the above problem, in the embodiment of the present invention, if the IP address of the CDN server corresponding to the target view is not queried in the view configuration, according to view topology information of the target view, sequentially acquiring a higher-level view of the target view until the acquired higher-level view has an IP address of the CDN server corresponding to the acquired higher-level view, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the higher-level view, specifically, taking the IP address of the CDN server corresponding to the higher-level view as the IP address of the CDN server in the target configuration corresponding to the domain name to be resolved.
For example, if the target view is the chip-zhejiang-jinhua-dianxin, and the chip-zhejiang-jinhua-dianxin does not have the IP address of the corresponding CDN server in the schedule, according to the view topology information (ViewTopology) of the target view, the upper view of the chip-zhejiang-jinhua-dianxi, that is, the chip-zhejiang-dianxin is searched upward, then the IP address of the CDN server is searched in the schedule by using the chip-zhejiangdianxin, and if the chip-zhejiang-dianxin finds the IP address of the corresponding CDN server in the schedule, the IP address of the chip-zhejiangdianxin is used as the target IP address of the chip-zhenghua-dianxin. If the chip-zhejiang-dianxin does not find the corresponding IP address of the CDN server in the schedulable, the chip-zhejiang-dianxin continues to search for the upper level, the final default value (default) is the sum of the IP addresses of the CDN servers configured by all the views, and as long as one view has the IP address of the CDN server, the resolution of the domain name to be resolved can be realized, namely the target configuration of the domain name to be resolved is obtained.
By combining the view topology information of the target view, when the target view does not have the corresponding IP address of the CDN server, the IP address of the CDN server of the higher-level view can be searched through the topology information, so that logical preparation can be realized, the target configuration of the domain name to be resolved can be determined through the IP address of the CDN server of the higher-level view, and the possibility that the domain name to be resolved cannot be resolved can be further reduced.
In a specific implementation, when the top view of the target view does not have the IP address of the corresponding CDN server, the IP address of the corresponding CDN server may be obtained from other types of views. For example, when the top-level viewchina-dianxin of the china-zhejiang-jinhua-dianxin does not have the IP address of the corresponding CDN server, the IP address of the CDN server may be obtained from the view of the link.
In specific implementation, when a view configuration of a higher-level view has a plurality of corresponding IP addresses of the CDN servers, an IP address of at least one CDN server is selected from the plurality of corresponding IP addresses of the CDN servers, and a target configuration corresponding to the domain name to be resolved is determined based on the selected IP address of the CDN server.
In a specific implementation, the configuration corresponding to the domain name to be resolved may be selected randomly from a plurality of configurations, or may be selected based on the weight of each configuration, or may be selected from a plurality of configurations in a polling manner, or it may be understood that the configuration corresponding to the domain name to be resolved may be selected from a plurality of configurations in other manners, which is not described herein again.
In the embodiment of the present invention, if one view in the view configuration corresponds to IP addresses of multiple CDN servers, a weight corresponding to the IP address of each CDN server may be included, so that a final IP address of the CDN server may be determined from IP addresses of the multiple CDN servers as an IP address of the CDN server in the target configuration of the domain name to be resolved based on the weight of the IP address of each CDN server.
In addition, the view configuration may also include a Time To Live (TTL) value.
In order to facilitate better understanding and implementation of the embodiments of the present invention for those skilled in the art, an embodiment of the present invention further provides a domain name server, referring to fig. 2, a schematic structural diagram of a domain name server in the embodiment of the present invention is provided, and the structure of the domain name server is described below with reference to fig. 2.
In a specific implementation, domain name server 20 may include: an obtaining unit 21, a first judging unit 22, a second judging unit 23, a determining unit 24 and an output unit 25, wherein:
the acquiring unit 21 is adapted to acquire a domain name to be resolved from a domain name resolution request when the domain name resolution request is received;
a first judging unit 22, adapted to judge whether the domain of the domain name to be resolved belongs to a resolvable domain range;
a second determining unit 23, configured to determine whether a configuration corresponding to the domain name to be resolved exists in a domain configuration file corresponding to the domain when the domain of the domain name to be resolved belongs to a resolvable domain range;
a determining unit 24, configured to determine, when the domain configuration file has a configuration corresponding to the domain name to be resolved, a target configuration corresponding to the domain name to be resolved, where the target configuration corresponding to the domain name to be resolved includes an IP address of a target CDN server;
and the output unit 25 is adapted to output the target configuration corresponding to the domain name to be resolved.
In a specific implementation, the determining unit 24 may be adapted to query whether a corresponding view configuration exists for the domain name to be resolved, where the domain name to be resolved uniquely corresponds to the view configuration, and the view configuration includes: the domain name to be analyzed corresponds to a plurality of views, and the IP address of a CDN server corresponding to each view; and when the domain name to be analyzed does not have the corresponding view configuration, taking the configuration corresponding to the domain name to be analyzed in the domain configuration file as the target configuration corresponding to the domain name to be analyzed, wherein the domain configuration file comprises the IP address of the target CDN server.
In a specific implementation, the determining unit 24 may be adapted to obtain a source IP address from the domain name resolution request when the domain name to be resolved has a corresponding view configuration; determining a target view corresponding to the domain name to be analyzed according to the source IP address; and inquiring the IP address of the CDN server corresponding to the target view in the view configuration, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the target view.
In a specific implementation, the determining unit 24 may be adapted to, if the IP address of the CDN server corresponding to the target view is not queried in the view configuration, sequentially obtain, according to the view topology information of the target view, a higher-level view of the target view until the obtained higher-level view has an IP address of the CDN server corresponding to the target view, and determine, based on the IP address of the CDN server corresponding to the higher-level view, the target configuration corresponding to the domain name to be resolved.
In a specific implementation, the determining unit 24 may be adapted to select an IP address of at least one CDN server from the IP addresses of the plurality of CDN servers when the IP addresses of the plurality of CDN servers exist in the upper view, and determine the target configuration corresponding to the domain name to be resolved based on the selected IP address of the CDN server.
In a specific implementation, the number of domain profiles is one.
The embodiment of the present invention further provides another domain name server, which includes a memory and a processor, where the memory stores a computer instruction that can be executed on the processor, and when the processor executes the computer instruction, the processor executes the steps of the DNS scheduling method provided in any of the above embodiments of the present invention.
The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium is a non-volatile storage medium or a non-transitory storage medium, and has computer instructions stored thereon, and when the computer instructions are executed, the steps of the DNS scheduling method provided in any of the above embodiments of the present invention are executed.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in any computer readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (14)

1. A DNS scheduling method is characterized by comprising the following steps:
when a domain name resolution request is received, acquiring a domain name to be resolved from the domain name resolution request;
judging whether the domain of the domain name to be analyzed belongs to an analyzable domain range or not;
when the domain of the domain name to be analyzed belongs to an analyzable domain range, judging whether the configuration corresponding to the domain name to be analyzed exists in a domain configuration file corresponding to the domain;
when the domain configuration file has the configuration corresponding to the domain name to be resolved, determining the target configuration corresponding to the domain name to be resolved, wherein the target configuration corresponding to the domain name to be resolved comprises the IP address of a target CDN server;
and outputting the target configuration corresponding to the domain name to be analyzed.
2. The DNS scheduling method according to claim 1, wherein the determining, when the configuration corresponding to the domain name to be resolved exists in the domain configuration file, the target configuration corresponding to the domain name to be resolved includes:
inquiring whether the domain name to be analyzed has a corresponding view configuration, wherein the domain name to be analyzed is uniquely corresponding to the view configuration, and the view configuration comprises the following steps: the domain name to be analyzed corresponds to a plurality of views, and the IP address of a CDN server corresponding to each view;
and when the domain name to be analyzed does not have the corresponding view configuration, taking the configuration corresponding to the domain name to be analyzed in the domain configuration file as the target configuration corresponding to the domain name to be analyzed, wherein the domain configuration file comprises the IP address of the target CDN server.
3. The DNS scheduling method according to claim 2, wherein the determining, when the configuration corresponding to the domain name to be resolved exists in the domain configuration file, the target configuration corresponding to the domain name to be resolved includes:
when the domain name to be analyzed has the corresponding view configuration, acquiring a source IP address from the domain name analysis request;
determining a target view corresponding to the domain name to be analyzed according to the source IP address;
and inquiring the IP address of the CDN server corresponding to the target view in the view configuration, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the target view.
4. The DNS scheduling method according to claim 3, wherein the determining, when the configuration corresponding to the domain name to be resolved exists in the domain configuration file, the target configuration corresponding to the domain name to be resolved includes:
if the IP address of the CDN server corresponding to the target view is not queried in the view configuration, sequentially acquiring a higher-level view of the target view according to view topology information of the target view until the acquired higher-level view has the IP address of the corresponding CDN server, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the higher-level view.
5. The DNS scheduling method according to claim 4, wherein the determining, when the configuration corresponding to the domain name to be resolved exists in the domain configuration file, the target configuration corresponding to the domain name to be resolved includes:
when the IP addresses of a plurality of CDN servers exist in the superior view, the IP address of at least one CDN server is selected from the IP addresses of the CDN servers, and the target configuration corresponding to the domain name to be analyzed is determined based on the selected IP address of the CDN server.
6. The DNS scheduling method of any one of claims 1 to 5, wherein the number of domain profiles is one.
7. A domain name server, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is suitable for acquiring a domain name to be analyzed from a domain name analysis request when the domain name analysis request is received;
the first judging unit is suitable for judging whether the domain of the domain name to be analyzed belongs to an analyzable domain range or not;
the second judging unit is suitable for judging whether the configuration corresponding to the domain name to be analyzed exists in a domain configuration file corresponding to the domain when the domain of the domain name to be analyzed belongs to an analyzable domain range;
a determining unit, adapted to determine, when the domain configuration file has a configuration corresponding to the domain name to be resolved, a target configuration corresponding to the domain name to be resolved, where the target configuration corresponding to the domain name to be resolved includes an IP address of a target CDN server;
and the output unit is suitable for outputting the target configuration corresponding to the domain name to be analyzed.
8. The domain name server according to claim 7, wherein the determining unit is adapted to query whether there is a corresponding view configuration for the domain name to be resolved, the domain name to be resolved uniquely corresponds to the view configuration, and the view configuration includes: the domain name to be analyzed corresponds to a plurality of views, and the IP address of a CDN server corresponding to each view; and when the domain name to be analyzed does not have the corresponding view configuration, taking the configuration corresponding to the domain name to be analyzed in the domain configuration file as the target configuration corresponding to the domain name to be analyzed, wherein the domain configuration file comprises the IP address of the target CDN server.
9. The domain name server according to claim 8, wherein the determining unit is adapted to obtain a source IP address from the domain name resolution request when the domain name to be resolved has a corresponding view configuration; determining a target view corresponding to the domain name to be analyzed according to the source IP address; and inquiring the IP address of the CDN server corresponding to the target view in the view configuration, and determining the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the target view.
10. The domain name server according to claim 9, wherein the determining unit is adapted to, if the IP address of the CDN server corresponding to the target view is not queried in the view configuration, sequentially obtain a higher level view of the target view according to the view topology information of the target view until the obtained higher level view has the IP address of the CDN server corresponding to the higher level view, and determine the target configuration corresponding to the domain name to be resolved based on the IP address of the CDN server corresponding to the higher level view.
11. The domain name server according to claim 10, wherein the determining unit is adapted to select an IP address of at least one CDN server from the IP addresses of the CDN servers when there are IP addresses of a plurality of CDN servers in the upper view, and determine the target configuration corresponding to the domain name to be resolved based on the selected IP address of the CDN server.
12. The domain name server according to any of claims 7 to 11, wherein the number of domain profiles is one.
13. A domain name server comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the DNS scheduling method of any of claims 1 to 6.
14. A computer readable storage medium, being a non-volatile storage medium or a non-transitory storage medium, having stored thereon computer instructions, characterized in that the computer instructions, when executed, perform the steps of the DNS scheduling method according to any one of claims 1 to 6.
CN201911185411.1A 2019-11-27 2019-11-27 DNS scheduling method, domain name server and computer readable storage medium Pending CN111049941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911185411.1A CN111049941A (en) 2019-11-27 2019-11-27 DNS scheduling method, domain name server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911185411.1A CN111049941A (en) 2019-11-27 2019-11-27 DNS scheduling method, domain name server and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111049941A true CN111049941A (en) 2020-04-21

Family

ID=70233937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911185411.1A Pending CN111049941A (en) 2019-11-27 2019-11-27 DNS scheduling method, domain name server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111049941A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935329A (en) * 2020-07-16 2020-11-13 郑州悉知信息科技股份有限公司 Domain name resolution method and device
CN113037885A (en) * 2021-03-02 2021-06-25 上海牙木通讯技术有限公司 View matching method, DNS server and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7086061B1 (en) * 2002-08-01 2006-08-01 Foundry Networks, Inc. Statistical tracking of global server load balancing for selecting the best network address from ordered list of network addresses based on a set of performance metrics
CN103701817A (en) * 2013-12-27 2014-04-02 乐视网信息技术(北京)股份有限公司 Method and device for generating configuration file
CN105897942A (en) * 2015-09-17 2016-08-24 乐视云计算有限公司 Domain name resolution system and domain name resolution method
CN106953941A (en) * 2017-04-17 2017-07-14 甘肃省科学技术情报研究所 A kind of multi-line intelligent DNS resolver and method
CN109905496A (en) * 2019-02-26 2019-06-18 上海浪潮云计算服务有限公司 A kind of DNS intelligent dispatching method based on subscriber policy

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7086061B1 (en) * 2002-08-01 2006-08-01 Foundry Networks, Inc. Statistical tracking of global server load balancing for selecting the best network address from ordered list of network addresses based on a set of performance metrics
CN103701817A (en) * 2013-12-27 2014-04-02 乐视网信息技术(北京)股份有限公司 Method and device for generating configuration file
CN105897942A (en) * 2015-09-17 2016-08-24 乐视云计算有限公司 Domain name resolution system and domain name resolution method
CN106953941A (en) * 2017-04-17 2017-07-14 甘肃省科学技术情报研究所 A kind of multi-line intelligent DNS resolver and method
CN109905496A (en) * 2019-02-26 2019-06-18 上海浪潮云计算服务有限公司 A kind of DNS intelligent dispatching method based on subscriber policy

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935329A (en) * 2020-07-16 2020-11-13 郑州悉知信息科技股份有限公司 Domain name resolution method and device
CN111935329B (en) * 2020-07-16 2023-03-31 郑州悉知信息科技股份有限公司 Domain name resolution method and device
CN113037885A (en) * 2021-03-02 2021-06-25 上海牙木通讯技术有限公司 View matching method, DNS server and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11044262B2 (en) Method, apparatus and system for anti-attacking in domain name system (DNS)
CN103685590B (en) Obtain the method and system of IP address
CN114205330B (en) Domain name resolution method, domain name resolution device, server, and storage medium
CN104468860A (en) Method and device for recognizing risk of domain name resolution server
CN111049941A (en) DNS scheduling method, domain name server and computer readable storage medium
CN102055815B (en) System for acquiring local domain name analyses server of caller
WO2017166524A1 (en) Domain name parsing method and apparatus
CN112434053B (en) Method, device, equipment and storage medium for calculating live broadcast heat
CN113014687A (en) DNS iterative query method, DNS server, system and computer readable storage medium
US10171415B2 (en) Characterization of domain names based on changes of authoritative name servers
CN111432041A (en) Domain name acquisition method, system, terminal and computer readable storage medium
CN108494870A (en) Dynamic data loading method based on CDN and device
CN110943876A (en) URL state detection method, device, equipment and system
CN115150469B (en) Domain name resolution result storage method and device, electronic equipment and storage medium
CN112671943B (en) Real domain name detection device
CN112532765B (en) Network access method and system thereof
CN103078968A (en) Domain name querying method, IP (Internet Protocol) grouping method, device and equipment
JP4851566B2 (en) DNS test apparatus, DNS test method, and DNS test program
CN113487345A (en) Method and apparatus for determining promoter, and storage medium
CN116055449B (en) DNS packet forwarding method and device
CN111885220A (en) Active acquisition and verification method for target unit IP assets
CN111447291A (en) DNS (Domain name System) -based scheduling method and system and electronic equipment
CN113542326A (en) Data caching method and device for distributed system, server and storage medium
CN110995888A (en) Intelligent resolution method of domain name system
CN114760270B (en) Method and device for generating user equipment fingerprint

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200421

WD01 Invention patent application deemed withdrawn after publication