CN111432045B - Method, device and equipment for testing server scheduling algorithm of domain name system - Google Patents

Method, device and equipment for testing server scheduling algorithm of domain name system Download PDF

Info

Publication number
CN111432045B
CN111432045B CN202010196475.8A CN202010196475A CN111432045B CN 111432045 B CN111432045 B CN 111432045B CN 202010196475 A CN202010196475 A CN 202010196475A CN 111432045 B CN111432045 B CN 111432045B
Authority
CN
China
Prior art keywords
dns
dns request
address
domain name
operator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010196475.8A
Other languages
Chinese (zh)
Other versions
CN111432045A (en
Inventor
李佳雯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202010196475.8A priority Critical patent/CN111432045B/en
Publication of CN111432045A publication Critical patent/CN111432045A/en
Application granted granted Critical
Publication of CN111432045B publication Critical patent/CN111432045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • 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
    • 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/5046Resolving address allocation conflicts; Testing of addresses

Landscapes

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

Abstract

The application discloses a method, a device and equipment for testing a server scheduling algorithm of a domain name system, which are applied to any computer, wherein a plurality of virtual sub-network cards are virtually simulated on a physical network card of the computer, and each virtual sub-network card and an IP address of an operator respectively have a binding relationship, and the method comprises the following steps: sending a DNS request with a source IP address as an operator IP address corresponding to the virtual subnet card from the virtual subnet card; receiving a DNS response obtained after a DNS request is analyzed by a domain name system DNS server scheduling algorithm; the DNS response carries the resolution result of the DNS request; comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request; and if the comparison results of the tests of the DNS requests sent by the virtual sub-network cards are successful, determining that the DNS server scheduling algorithm passes the test. The method and the device can automatically test the DNS server scheduling algorithm, and ensure the accuracy of the DNS server scheduling algorithm which is put into use.

Description

Method, device and equipment for testing server scheduling algorithm of domain name system
Technical Field
The application relates to the field of data processing, in particular to a method, a device and equipment for testing a scheduling algorithm of a domain name system server.
Background
A Domain Name System (DNS) server, a server for Domain Name (Domain Name) and IP address translation corresponding thereto. A domain name is the name of a computer or group of computers on the internet that is used to identify the electronic position (sometimes also referred to as the geographic location) of the computer at the time of data transmission, and is composed of a string of dotted names, usually containing the name of an organization, and always including a suffix of two to three letters to indicate the type of organization or country or region in which the domain is located.
The DNS server maintains a table of domain names and IP addresses corresponding thereto to resolve the domain name of the message. Specifically, a domain name is resolved to a certain server, and a web page file is placed on the server, so that a user computer knows which server to obtain the web page information of the domain name, which is realized through a DNS server.
In fact, each domain name has at least two DNS servers with the same DNS record, and if one of the DNS servers fails, the other can also return data about the domain name. In practical application, when a browser inputs a certain domain name in a browser address box, or clicks a link from another website to take a domain name, the browser sends a DNS request carrying the domain name to an internet access provider (also called a network operator) of the user, a server of the network operator queries a domain name database to obtain a DNS server corresponding to the domain name, and if there is more than one DNS server, one DNS server needs to be determined, and then a DNS record is captured from the determined DNS server to obtain an IP address corresponding to the domain name. After the IP address is obtained, the server of the network operator accesses the application server corresponding to the IP address to capture the web page content, and finally transmits the web page content to the browser sending the DNS request, thereby completing the web page access process of the user.
The DNS server scheduling algorithm is an algorithm for selecting an optimal DNS server from a plurality of DNS servers matched to perform scheduling, and the accuracy of the algorithm needs to be tested before the algorithm is put into use. Therefore, how to verify the DNS server scheduling algorithm is an urgent problem to be solved at present.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, and a device for testing a domain name system server scheduling algorithm, which can automatically implement a test on a DNS server scheduling algorithm to ensure accuracy of the algorithm after being put into use.
In a first aspect, to achieve the above object, the present application provides a method for testing a server scheduling algorithm of a domain name system, where the method is applied to any one computer, and multiple virtual sub-network cards are virtually simulated on an entity network card of the computer, where each virtual sub-network card and an operator IP address respectively have a binding relationship, and the method includes:
sending a DNS request with a source IP address being an operator IP address corresponding to the virtual subnet card from the virtual subnet card; wherein the DNS request carries a domain name;
receiving a DNS response obtained after the DNS request is analyzed by the domain name system DNS server scheduling algorithm; wherein the DNS response carries a resolution result of the DNS request;
comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request;
and if the comparison results of the tests of the DNS requests sent by the virtual sub-network cards are successful, determining that the DNS server scheduling algorithm passes the test.
In an optional implementation manner, before sending, from the virtual sub-network card, a DNS request whose source IP address is an operator IP address corresponding to the virtual sub-network card, the method further includes:
storing the IP addresses of the operators in the operator tables respectively;
and binding each virtual sub-network card with each operator table to obtain the binding relationship between each virtual sub-network card and the operator IP address in the corresponding operator table.
In an optional implementation manner, before the comparing the resolution result with the expected response result corresponding to the DNS request to obtain the test comparison result of the DNS request, the method further includes:
and determining an expected response result corresponding to the DNS request based on the source IP address, the domain name and the domain name type of the DNS request.
In an optional embodiment, the determining an expected response result corresponding to the DNS request based on the source IP address, the domain name, and the request type of the DNS request includes:
acquiring a domain name and domain name type DNS analysis record which accords with the DNS request;
determining a DNS resolution record belonging to the range of an operator to which the source IP address belongs in the DNS resolution records based on the source IP address of the DNS request;
and determining the DNS resolution record with the highest priority in the DNS resolution records belonging to the range of the operator to which the source IP address belongs as an expected response result corresponding to the DNS request.
In an optional embodiment, the method further comprises:
and if the number of the DNS resolution records with the highest priority in the DNS resolution records belonging to the range of the operator to which the source IP address belongs is greater than 1, determining the DNS resolution record with the highest weight in the DNS resolution records with the highest priority as an expected response result corresponding to the DNS request.
In a second aspect, the present application further provides a device for testing a server scheduling algorithm of a domain name system, where the device is applied to any computer, and multiple virtual sub-network cards are virtualized on an entity network card of the computer, where each virtual sub-network card and an operator IP address respectively have a binding relationship, and the device includes:
the sending module is used for sending a DNS request with a source IP address being an operator IP address corresponding to the virtual subnet card from the virtual subnet card; wherein the DNS request carries a domain name;
the receiving module is used for receiving a DNS response obtained by analyzing the DNS request through the domain name system DNS server scheduling algorithm; wherein the DNS response carries a resolution result of the DNS request;
a comparison module, configured to compare the analysis result with an expected response result corresponding to the DNS request, to obtain a test comparison result of the DNS request;
and the first determining module is used for determining that the DNS server scheduling algorithm passes the test when the test comparison results of the DNS requests sent by the virtual sub-network cards are successfully compared.
In an alternative embodiment, the apparatus further comprises:
the storage module is used for respectively storing the IP addresses of the operators in the tables of the operators;
and the binding module is used for binding each virtual sub-network card with each operator table respectively to obtain the binding relationship between each virtual sub-network card and the operator IP address in the corresponding operator table.
In an alternative embodiment, the apparatus further comprises:
and the second determining module is used for determining an expected response result corresponding to the DNS request based on the source IP address, the domain name and the domain name type of the DNS request.
In a third aspect, the present application also provides a computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to perform the method according to any one of the above.
In a fourth aspect, the present application further provides an apparatus, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method as in any one of the above.
In the method for testing the DNS server scheduling algorithm provided in the embodiment of the present application, a DNS request is sent from a virtual subnet card, where a source IP address is an IP address of an operator corresponding to the virtual subnet card, and the DNS request carries a domain. And after the domain name carried by the DNS request is analyzed through a DNS server scheduling algorithm, a DNS response carrying an analysis result is obtained. And then, comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request, and if the test comparison results of the DNS requests sent by the virtual sub-network cards are all compared successfully, determining that the DNS server scheduling algorithm passes the test. Therefore, the DNS server scheduling algorithm can be automatically tested, and the accuracy of the DNS server scheduling algorithm which is put into use is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is an application architecture diagram of a method for testing a server scheduling algorithm of a domain name system according to an embodiment of the present application;
fig. 2 is a flowchart of a method for testing a server scheduling algorithm of a domain name system according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a testing apparatus for a domain name system server scheduling algorithm according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a testing device of a domain name system server scheduling algorithm according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
And the domain name system server scheduling algorithm is used for matching one DNS server from a plurality of DNS servers and providing domain name resolution service for the user. At present, a static proximity weighted polling algorithm based on global load verification is a commonly used DNS server scheduling algorithm, and in order to ensure the accuracy of a DNS server scheduling algorithm put into use, the algorithm needs to be tested before being put into use.
Therefore, the DNS server scheduling algorithm testing method can automatically test the DNS server scheduling algorithm and ensure the accuracy of the DNS server scheduling algorithm which is put into use.
Specifically, the method for testing the DNS server scheduling algorithm provided by the present application is applied to any computer, the physical network card of the computer is virtualized into a plurality of virtual sub-network cards, and each virtual sub-network card is bound to an operator IP address. In the test method, firstly, a DNS request with a source IP address as an operator IP address bound by a virtual subnet card is sent from each virtual subnet card, wherein the DNS request carries a domain name. And analyzing the DNS request carrying the domain name through a DNS server scheduling algorithm to obtain a DNS response carrying an analysis result. And then, comparing the analysis result in the DNS response with an expected response result of the DNS request obtained in advance to obtain a test comparison result, and if the test comparison results corresponding to the DNS requests sent by the virtual sub-network cards are successfully compared, determining that the DNS server scheduling algorithm passes the test. Therefore, the DNS server scheduling algorithm can be automatically tested.
Before describing the embodiments of the present application, a simple description is first made of a DNS server scheduling algorithm, which is a test object of the present application, where the DNS server scheduling algorithm is implemented based on a global load verification static proximity weighted polling algorithm, and includes the following features:
first, global load (GSLB)
Specifically, GSLB is a DNS-based scheduling technique, a flexible and stable scheduling algorithm, and a neighbor site information synchronization mechanism, and can effectively solve a number of problems such as uneven resource utilization among data centers, interruption of core services due to a failure of a certain site, and poor experience of a user due to access to a non-optimal site. Meanwhile, GSLB determines which server provides a service by comprehensively judging a server and a link, thereby ensuring the quality of service of a remote server group. In particular, the method is generally applied to a CDN distributed system as a core traffic scheduling system.
Second, static proximity Algorithm
Specifically, according to the operator to which the source IP address in the DNS request belongs, the resolution policy of the operator segment in the global resolution policy in which the source IP address belongs is screened, and the scheduling algorithm of the DNS request is replied. The basic processing logic is that firstly, the analysis strategy of an operator network segment at the same position as the source IP address of the DNS request is matched, and secondly, weighted polling scheduling is carried out in the matched analysis strategy set according to the priority, the weight attribute and the like.
Third, weighted round robin scheduling
Specifically, according to different processing capacities of the DNS servers, different weights are assigned to each DNS server, so that the DNS server can receive service requests of corresponding weight numbers.
Based on the characteristics of the DNS server scheduling algorithm, a better DNS server can be provided for the user, so that a better domain name resolution service can be provided for the user.
In order to ensure that a user can enjoy an optimal domain name resolution server, the method and the system firstly carry out automatic testing on the DNS server scheduling algorithm before the DNS server scheduling algorithm is put into use, and put the tested DNS server scheduling algorithm into use so as to ensure the subsequent domain name resolution service quality of the DNS server provided for the user based on the DNS server scheduling algorithm.
In addition, before embodiments of the present application are specifically described, an application architecture diagram of a method for testing a server scheduling algorithm of a domain name system is also provided, and refer to fig. 1. The application architecture includes a computer 101, a load balancing device 102, and DNS servers 103 of various operators, such as a DNS server for telecommunications.
Specifically, a domain name system server scheduling algorithm is run on the load balancing device 102, any virtual sub-network card in the computer 101 sends a DNS request with a source IP address as an operator IP address bound by the virtual sub-network card to the load balancing server 102, and after receiving the DNS request, the load balancing server 102 resolves a domain name carried in the DNS request by using the DNS server scheduling algorithm run on the load balancing server 102, so as to schedule the appropriate DNS server 103 for the load balancing server. Specifically, the operation process of the DNS server scheduling algorithm is not introduced, the DNS server scheduling algorithm is only tested integrally, and the intermediate operation process and the result of the DNS server scheduling algorithm do not need to be concerned.
Based on the above, the application provides a method for testing a server scheduling algorithm of a domain name system, the method is applied to any computer, a plurality of virtual sub-network cards are virtually simulated on an entity network card of the computer, and each virtual sub-network card and an operator IP address respectively have a binding relationship. Referring to fig. 2, a flowchart of a method for testing a server scheduling algorithm of a domain name system according to an embodiment of the present application is provided, where the method includes:
s201: sending a DNS request with a source IP address as an operator IP address corresponding to the virtual subnet card from any virtual subnet card; wherein the DNS request carries a domain name.
In the method for testing the scheduling algorithm of the DNS server provided in the embodiment of the present application, the virtual subnet cards virtualized by the physical network card are respectively bound to the IP addresses of the operators, so that an effect of requesting the scheduling of the DNS server from each operator server by one computer is achieved.
In the embodiment of the application, before a DNS server scheduling algorithm is tested, each virtual subnet card in a computer is bound with each operator IP address in advance, so that a source IP address of a DNS request sent by each virtual subnet card is an operator IP address bound by each virtual subnet card.
In an optional implementation manner, first, each operator IP address is stored in each operator table, and then each virtual sub-network card is bound to each operator table, so as to obtain a binding relationship between each virtual sub-network card and the operator IP address in the corresponding operator table. Specifically, the list function of Python may be utilized to store each virtual sub-network card of the computer in 1 Linux system in the adapter _ name list, and in addition, different operator IP addresses are stored in different sheet tables respectively. And then, obtaining the adapter _ name [ i ] in the adapter _ name list, and binding the adapter _ name [ i ] with the operator IP address in the sheet table of any operator, and finally finishing the effect of binding all the operator IP addresses with the virtual sub-network cards respectively.
In practical application, a DNS request with a source IP address as an operator IP address corresponding to the virtual subnet card may be sent from each virtual subnet card to indicate a need to allocate a DNS server of the operator for the virtual subnet card. Taking the virtual sub-network card 1 as an example, assuming that the virtual sub-network card 1 and the IP address of the telecom operator have a binding relationship, the source IP address of the DNS request sent from the virtual sub-network card is the IP address of the telecom, and after the subsequent load balancing server resolves the domain name carried by the DNS request, the DNS server of the telecom operator needs to be allocated to the subsequent load balancing server. In addition, the DNS request carries a domain name that can be used to identify the electronic location of the computer.
Through the manner, the DNS request with the source IP address as the IP address of the operator corresponding to the virtual subnet card can be sent from all the virtual subnet cards, so that the DNS server scheduling algorithm can be tested more comprehensively.
S202: receiving a DNS response obtained after the DNS request is analyzed by the domain name system DNS server scheduling algorithm; wherein the DNS response carries a resolution result of the DNS request.
In the embodiment of the application, after the DNS request carrying the domain name is sent to the load balancing setting running with the DNS server scheduling algorithm, the load balancing device takes the DNS request carrying the domain name as the input of the DNS server scheduling algorithm to perform domain name resolution, and obtains the DNS response of the DNS request. Wherein, the DNS response carries the resolution result of the DNS request.
S203: and comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request.
In the embodiment of the application, after the resolution result of the DNS request is obtained, the resolution result is compared with the expected response result corresponding to the DNS request by the character string to obtain the comparison result between the resolution result of the DNS request and the expected response result, which is used as the test comparison result of the DNS request. The expected response result of the DNS request refers to an accurate result of the DNS request processed by the tested DNS server scheduling algorithm, and may specifically be a standard result approved by a professional.
Specifically, if the comparison of the resolution result of the DNS request and the character string of the expected response result is consistent, it is determined that the comparison of the test comparison result of the DNS request is successful; otherwise, determining that the comparison of the test comparison result of the DNS request fails.
In an alternative embodiment, after receiving a resolution result of a DNS request each time, the DNS request may be compared with a corresponding expected response result to obtain a test comparison result of the DNS request.
In another optional implementation, after the resolution results of all DNS requests are obtained, the expected response result corresponding to each DNS request is determined, and the comparison between the resolution result of each DNS request and the corresponding expected response result is completed.
In practical application, before comparing the resolution result of the DNS request with the expected response result, the expected response result corresponding to the DNS request is obtained first. In an alternative embodiment, the expected response result corresponding to the DNS request may be determined based on the source IP address, the domain name, and the domain name type of the DNS request. The source IP address of the DNS request is the IP address of an operator bound by the virtual sub-network card sending the DNS request.
In an alternative embodiment, expected response results corresponding to all DNS requests may be obtained in advance, specifically, the expected response results may be DNS resolution records processed by a DNS server scheduling algorithm, in addition, in order to ensure the accuracy of the expected response results, each DNS resolution record needs to be verified by a professional, and in short, the accuracy of the DNS resolution record serving as the expected response result needs to be ensured.
In practical application, when an expected response result corresponding to any DNS request is determined, a DNS resolution record conforming to a domain name and a domain name type of the DNS request is first obtained, and then, based on a source IP address of the DNS request, a DNS resolution record belonging to an operator range to which the source IP address belongs in the obtained DNS resolution record is determined. Then, the DNS resolution record with the highest priority among the obtained DNS resolution records is determined as an expected response result corresponding to the DNS request.
In an optional implementation manner, the number of the obtained DNS resolution records with the highest priority may be greater than 1, so that in the embodiment of the present application, the DNS resolution record with the highest weight may also be obtained from the DNS resolution records with the highest priority, and finally, an expected response result corresponding to the DNS request is obtained.
It can be understood that the above process of obtaining the expected response result corresponding to the DNS request follows the logic of the DNS server scheduling algorithm, and therefore, the obtained expected response result can be used as a standard response of the DNS server scheduling algorithm.
In addition, the embodiment of the present application is not limited to other manners of obtaining an expected response result of the DNS request.
S204: and if the comparison results of the tests of the DNS requests sent by the virtual sub-network cards are successful, determining that the DNS server scheduling algorithm passes the test.
In the embodiment of the application, when the comparison results of the tests of the DNS requests sent by the virtual sub-network cards are all compared successfully, it can be determined that the DNS server scheduling algorithm passes the test, otherwise, it indicates that the DNS server scheduling algorithm fails the test.
In the method for testing the DNS server scheduling algorithm provided in the embodiment of the present application, a DNS request is sent from a virtual subnet card, where a source IP address is an IP address of an operator corresponding to the virtual subnet card, and the DNS request carries a domain. And after the domain name carried by the DNS request is analyzed through a DNS server scheduling algorithm, a DNS response carrying an analysis result is obtained. And then, comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request, and if the test comparison results of the DNS requests sent by the virtual sub-network cards are all compared successfully, determining that the DNS server scheduling algorithm passes the test. Therefore, the method and the device can automatically realize the test of the DNS server scheduling algorithm and ensure the accuracy of the DNS server scheduling algorithm which is put into use.
Based on the above method embodiment, the present application further provides a testing apparatus for a domain name system server scheduling algorithm, referring to fig. 3, where fig. 3 is a schematic structural diagram of a testing apparatus for a domain name system server scheduling algorithm provided in an embodiment of the present application, the apparatus is applied to any computer, a plurality of virtual sub-network cards are virtualized on an entity network card of the computer, where each virtual sub-network card and an operator IP address respectively have a binding relationship, and the apparatus includes:
an issuing module 301, configured to issue, from the virtual subnet card, a DNS request with a source IP address being an operator IP address corresponding to the virtual subnet card; wherein the DNS request carries a domain name;
a receiving module 302, configured to receive a DNS response obtained by analyzing the DNS request through the domain name system DNS server scheduling algorithm; wherein the DNS response carries a resolution result of the DNS request;
a comparison module 303, configured to compare the resolution result with an expected response result corresponding to the DNS request, to obtain a test comparison result of the DNS request;
a first determining module 304, configured to determine that the DNS server scheduling algorithm passes the test when the test comparison result of each DNS request sent by each virtual sub-network card is a comparison success.
In an alternative embodiment, the apparatus further comprises:
the storage module is used for respectively storing the IP addresses of the operators in the tables of the operators;
and the binding module is used for binding each virtual sub-network card with each operator table respectively to obtain the binding relationship between each virtual sub-network card and the operator IP address in the corresponding operator table.
In addition, the apparatus further comprises:
and the second determining module is used for determining an expected response result corresponding to the DNS request based on the source IP address, the domain name and the domain name type of the DNS request.
In the device for testing a DNS server scheduling algorithm provided in the embodiment of the present application, a DNS request is sent from a virtual subnet card, where a source IP address is an IP address of an operator corresponding to the virtual subnet card, and the DNS request carries a domain. And after the domain name carried by the DNS request is analyzed through a DNS server scheduling algorithm, a DNS response carrying an analysis result is obtained. And then, comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request, and if the test comparison results of the DNS requests sent by the virtual sub-network cards are all compared successfully, determining that the DNS server scheduling algorithm passes the test. Therefore, the method and the device can automatically realize the test of the DNS server scheduling algorithm and ensure the accuracy of the DNS server scheduling algorithm which is put into use.
In addition, an embodiment of the present application further provides a testing device for a server scheduling algorithm of a domain name system, as shown in fig. 4, where the testing device may include:
a processor 401, a memory 402, an input device 403, and an output device 404. The number of processors 401 in the test equipment of the domain name system server scheduling algorithm may be one or more, and one processor is taken as an example in fig. 4. In some embodiments of the present invention, the processor 401, the memory 402, the input device 403, and the output device 404 may be connected by a bus or other means, wherein the connection by the bus is illustrated in fig. 4.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications of the test device of the domain name system server scheduling algorithm and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 403 may be used to receive input numeric or character information and generate signal inputs related to user settings and functional control of the test equipment for the domain name system server scheduling algorithm.
Specifically, in this embodiment, the processor 401 loads an executable file corresponding to one or more processes of an application program into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions in the above-mentioned method for testing a domain name system server scheduling algorithm.
In addition, the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a terminal device, the terminal device is caused to execute the above method for testing the domain name system server scheduling algorithm.
It is understood that for the apparatus embodiments, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, the device and the equipment for testing the server scheduling algorithm of the domain name system provided by the embodiment of the application are introduced in detail, a specific example is applied in the text to explain the principle and the implementation mode of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for testing a server scheduling algorithm of a domain name system is characterized in that the method is applied to any computer, a plurality of virtual sub-network cards are virtually simulated on an entity network card of the computer, wherein each virtual sub-network card and an IP address of an operator respectively have a binding relationship, and the method comprises the following steps:
sending a DNS request with a source IP address being an operator IP address corresponding to the virtual subnet card from the virtual subnet card; wherein the DNS request carries a domain name;
receiving a DNS response obtained after the DNS request is analyzed by the domain name system DNS server scheduling algorithm; wherein the DNS response carries a resolution result of the DNS request;
comparing the analysis result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request;
and if the comparison results of the tests of the DNS requests sent by the virtual sub-network cards are successful, determining that the DNS server scheduling algorithm passes the test.
2. The method according to claim 1, wherein before sending the DNS request with the source IP address being the operator IP address corresponding to the virtual subnet card from the virtual subnet card, the method further comprises:
storing the IP addresses of the operators in the operator tables respectively;
and binding each virtual sub-network card with each operator table to obtain the binding relationship between each virtual sub-network card and the operator IP address in the corresponding operator table.
3. The method according to claim 1, wherein before comparing the resolution result with an expected response result corresponding to the DNS request to obtain a test comparison result of the DNS request, the method further comprises:
and determining an expected response result corresponding to the DNS request based on the source IP address, the domain name and the domain name type of the DNS request.
4. The method of claim 3, wherein determining the expected response result corresponding to the DNS request based on the source IP address, the domain name, and the request type of the DNS request comprises:
acquiring a domain name and domain name type DNS analysis record which accords with the DNS request;
determining a DNS resolution record belonging to the range of an operator to which the source IP address belongs in the DNS resolution records based on the source IP address of the DNS request;
and determining the DNS resolution record with the highest priority in the DNS resolution records belonging to the range of the operator to which the source IP address belongs as an expected response result corresponding to the DNS request.
5. The method of claim 4, further comprising:
and if the number of the DNS resolution records with the highest priority in the DNS resolution records belonging to the range of the operator to which the source IP address belongs is greater than 1, determining the DNS resolution record with the highest weight in the DNS resolution records with the highest priority as an expected response result corresponding to the DNS request.
6. A testing device for server scheduling algorithm of domain name system is characterized in that the device is applied to any computer, a plurality of virtual sub-network cards are simulated on an entity network card of the computer, wherein each virtual sub-network card and an IP address of an operator respectively have a binding relationship, and the device comprises:
the sending module is used for sending a DNS request with a source IP address as an operator IP address corresponding to the virtual subnet card from the virtual subnet card; wherein the DNS request carries a domain name;
the receiving module is used for receiving a DNS response obtained by analyzing the DNS request through the domain name system DNS server scheduling algorithm; wherein the DNS response carries a resolution result of the DNS request;
a comparison module, configured to compare the analysis result with an expected response result corresponding to the DNS request, to obtain a test comparison result of the DNS request;
and the first determining module is used for determining that the DNS server scheduling algorithm passes the test when the test comparison results of the DNS requests sent by the virtual sub-network cards are successfully compared.
7. The apparatus of claim 6, further comprising:
the storage module is used for respectively storing the IP addresses of the operators in the tables of the operators;
and the binding module is used for binding each virtual sub-network card with each operator table respectively to obtain the binding relationship between each virtual sub-network card and the operator IP address in the corresponding operator table.
8. The apparatus of claim 6, further comprising:
and the second determining module is used for determining an expected response result corresponding to the DNS request based on the source IP address, the domain name and the domain name type of the DNS request.
9. A computer-readable storage medium having stored therein instructions that, when executed on a terminal device, cause the terminal device to perform the method of any one of claims 1-5.
10. An apparatus, comprising: memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method of any of claims 1-5.
CN202010196475.8A 2020-03-19 2020-03-19 Method, device and equipment for testing server scheduling algorithm of domain name system Active CN111432045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010196475.8A CN111432045B (en) 2020-03-19 2020-03-19 Method, device and equipment for testing server scheduling algorithm of domain name system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010196475.8A CN111432045B (en) 2020-03-19 2020-03-19 Method, device and equipment for testing server scheduling algorithm of domain name system

Publications (2)

Publication Number Publication Date
CN111432045A CN111432045A (en) 2020-07-17
CN111432045B true CN111432045B (en) 2022-05-31

Family

ID=71547558

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010196475.8A Active CN111432045B (en) 2020-03-19 2020-03-19 Method, device and equipment for testing server scheduling algorithm of domain name system

Country Status (1)

Country Link
CN (1) CN111432045B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037808B (en) * 2021-02-18 2022-09-27 北京网聚云联科技有限公司 CDN node single machine scheduling method and system based on eBPF technology
CN113242327B (en) * 2021-04-23 2023-06-02 北京汇钧科技有限公司 Scheduling analysis method, scheduling analysis device, computer equipment and storage medium
CN113079070B (en) * 2021-06-07 2021-08-27 中国电子信息产业集团有限公司第六研究所 Method and device for monitoring response performance of domain name system
CN114650271B (en) * 2022-03-23 2023-12-05 杭州迪普科技股份有限公司 Global load DNS neighbor site learning method and device
CN114650295B (en) * 2022-03-29 2023-12-05 北京有竹居网络技术有限公司 CDN quality scheduling method and device, medium and electronic equipment
CN114844858A (en) * 2022-04-13 2022-08-02 山东浪潮超高清视频产业有限公司 Method for obtaining domain name address by multiple networks

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016177282A1 (en) * 2015-05-06 2016-11-10 阿里巴巴集团控股有限公司 Method for detecting effective domain name resolution, browser, server and system
WO2017181591A1 (en) * 2016-04-20 2017-10-26 乐视控股(北京)有限公司 Testing method and system
CN109067938A (en) * 2018-10-15 2018-12-21 网宿科技股份有限公司 A kind of method and device for testing dns server
CN110661677A (en) * 2018-06-29 2020-01-07 贵州白山云科技股份有限公司 DNS (Domain name System) testing method, device and system
CN110769076A (en) * 2018-07-26 2020-02-07 贵州白山云科技股份有限公司 DNS (Domain name System) testing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10212123B2 (en) * 2015-11-24 2019-02-19 International Business Machines Corporation Trustworthiness-verifying DNS server for name resolution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016177282A1 (en) * 2015-05-06 2016-11-10 阿里巴巴集团控股有限公司 Method for detecting effective domain name resolution, browser, server and system
WO2017181591A1 (en) * 2016-04-20 2017-10-26 乐视控股(北京)有限公司 Testing method and system
CN110661677A (en) * 2018-06-29 2020-01-07 贵州白山云科技股份有限公司 DNS (Domain name System) testing method, device and system
CN110769076A (en) * 2018-07-26 2020-02-07 贵州白山云科技股份有限公司 DNS (Domain name System) testing method and system
CN109067938A (en) * 2018-10-15 2018-12-21 网宿科技股份有限公司 A kind of method and device for testing dns server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于DNS的应用服务器负载均衡策略的研究和实现;平立;《中国优秀硕士学位论文全文数据库•信息科技辑》;20070115;全文 *

Also Published As

Publication number Publication date
CN111432045A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
CN111432045B (en) Method, device and equipment for testing server scheduling algorithm of domain name system
CN109714449B (en) Dynamic configuration method, device, equipment and storage medium for service domain name
CN111314472B (en) Domain name resolution method, domain name resolution server and terminal equipment
CN107302604B (en) Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment
CN110677405B (en) Data processing method and device, electronic equipment and storage medium
CN111327647B (en) Method and device for providing service to outside by container and electronic equipment
CN110647469A (en) Method and device for testing microservice, computer equipment and storage medium
CN105100152A (en) Application server selection method and system, and application client
CN114095567B (en) Data access request processing method and device, computer equipment and medium
CN111752770A (en) Service request processing method, system, computer device and storage medium
CN110120971A (en) A kind of gray scale dissemination method, device and electronic equipment
CN109618003B (en) Server planning method, server and storage medium
CN103237089A (en) Method and device for repairing domain name system (DNS) polling mode-based webpages and server
CN113254165B (en) Load flow distribution method and device for virtual machine and container, and computer equipment
CN111447299A (en) DNS analysis method and system based on test environment standing book
US20170264666A1 (en) Method and associated server for providing user-friendly operation
CN111787129A (en) Method and system for configuring local DNS server for client
CN108494870A (en) Dynamic data loading method based on CDN and device
CN107239475B (en) File calling method and device
US20200313981A1 (en) Method and device for processing a network service instantiation request
CN111988298B (en) Data processing method, device and equipment
CN111935329B (en) Domain name resolution method and device
CN112231566B (en) Information pushing method, device, system and readable storage medium
CN114500456B (en) DNS (Domain name System) scheduling optimization method and device based on whole network sniffing and computing equipment
CN115396398A (en) Derived domain name access method, system, device, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant