CN115834535A - Domain name resolution method and device - Google Patents

Domain name resolution method and device Download PDF

Info

Publication number
CN115834535A
CN115834535A CN202211266022.3A CN202211266022A CN115834535A CN 115834535 A CN115834535 A CN 115834535A CN 202211266022 A CN202211266022 A CN 202211266022A CN 115834535 A CN115834535 A CN 115834535A
Authority
CN
China
Prior art keywords
domain name
address
information
client
name resolution
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
CN202211266022.3A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202211266022.3A priority Critical patent/CN115834535A/en
Publication of CN115834535A publication Critical patent/CN115834535A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a domain name resolution method and a domain name resolution device, which are applied to the technical field of Internet, wherein the method comprises the following steps: the method comprises the steps that a plurality of pieces of domain name information are stored in a server, each piece of domain name information records a domain name to be resolved, the domain name to be resolved recorded in each piece of domain name information corresponds to the IP address of different servers for operating a target website, and each piece of domain name information stored locally is read in response to a domain name resolution request sent by a client; analyzing the domain name to be analyzed in each read domain name information, and determining an IP address corresponding to each domain name to be analyzed as a domain name analysis result; and sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result. The domain name to be resolved can be resolved by applying the embodiment of the invention.

Description

Domain name resolution method and device
Technical Field
The invention relates to the technical field of internet, in particular to a domain name resolution method and a domain name resolution device.
Background
At present, when network access is carried out based on the Internet, domain name resolution is an important step. However, the IP address of the server is not easy to be memorized by the user, and the domain name corresponding to the IP address of the server is convenient for the user to memorize.
In a real scene, a user accesses a certain website running on a server of a cloud manufacturer through a client, the client can first access the server of the cloud manufacturer based on an IP address of the server of the cloud manufacturer, and then access information provided by the website through the server of the cloud manufacturer. As can be seen, if the client can access the information provided by the website, the client should first determine the IP address of the server of the cloud vendor.
Therefore, it is necessary to provide a domain name resolution scheme, which can resolve a domain name provided by a cloud manufacturer for the website, so that a client can determine an IP address of a server of the cloud manufacturer, and can access information provided by the website.
Disclosure of Invention
The embodiment of the invention aims to provide a domain name resolution method and a domain name resolution device, which can be used for resolving a domain name to be resolved. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a domain name resolution method, which is applied to a server, where the server stores a plurality of pieces of domain name information, each piece of domain name information records a domain name to be resolved, and the domain name to be resolved recorded in each piece of domain name information corresponds to an IP address of a different server for operating a target website, and the method includes:
responding to a domain name resolution request sent by a client, and reading each piece of locally stored domain name information;
analyzing the domain name to be analyzed in each read domain name information, and determining an IP address corresponding to each domain name to be analyzed as a domain name analysis result;
and sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
In a second aspect, an embodiment of the present invention provides a domain name resolution apparatus, where the apparatus includes:
the domain name information reading module is used for responding to a domain name resolution request sent by a client and reading each piece of locally stored domain name information;
the domain name resolution module is used for resolving the domain names to be resolved in each piece of read domain name information, and determining the IP addresses corresponding to the domain names to be resolved as a domain name resolution result;
and the resolution result sending module is used for sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
In a third aspect, an electronic device includes a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface communicate with each other via the communication bus;
a memory for storing a computer program;
a processor for implementing any of the method steps of the first aspect described above when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium has stored therein a computer program which, when executed by a processor, performs any of the method steps of the first aspect.
The embodiment of the invention provides a domain name resolution method which is applied to a server, wherein the server stores a plurality of pieces of domain name information, each piece of domain name information records a domain name to be resolved, the domain name to be resolved recorded in each piece of domain name information respectively corresponds to the IP address of different servers for operating a target website, and each piece of domain name information which is locally stored is read in response to a domain name resolution request sent by a client; analyzing the domain name to be analyzed in each read domain name information, and determining an IP address corresponding to each domain name to be analyzed as a domain name analysis result; and sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
As can be seen from the above, after receiving a domain name resolution request sent by a client, a server first reads each piece of domain name information stored locally, where each piece of domain name information records a domain name to be resolved, the domain name to be resolved corresponds to an IP address of a server for operating a target website, and different domain names to be resolved correspond to different IP addresses, and because the server can resolve the domain name to be resolved recorded in each piece of domain name information, it is possible to determine each IP address corresponding to the domain name to be resolved, and then the IP address can be used as a domain name resolution result. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention allows storing of multiple pieces of domain name information, and resolves the domain name to be resolved in each piece of domain name information that is read, and there is no coverage of the domain name resolution result.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a first domain name resolution method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second domain name resolution method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a third domain name resolution method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a fourth domain name resolution method according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a domain name resolution system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a first domain name resolution device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second domain name resolution apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to resolve a domain name to be resolved, an embodiment of the present invention provides a domain name resolution method, where a server stores a plurality of pieces of domain name information, each piece of domain name information records a domain name to be resolved, and the domain name to be resolved recorded in each piece of domain name information corresponds to an IP address of a different server for operating a target website, where the method includes:
responding to a domain name resolution request sent by a client, and reading each piece of locally stored domain name information;
analyzing the domain name to be analyzed in each read domain name information, and determining an IP address corresponding to each domain name to be analyzed as a domain name analysis result;
and sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
As can be seen from the above, after receiving a domain name resolution request sent by a client, a server first reads each piece of domain name information stored locally, where each piece of domain name information records a domain name to be resolved, where the domain name to be resolved corresponds to an IP address of a server for operating a target website and different domain names to be resolved correspond to different IP addresses, and because the server can resolve the domain name to be resolved recorded in each piece of domain name information that is read, it can determine each IP address corresponding to the domain name to be resolved, and for each determined IP address, because the IP address is the IP address of the server for operating the target website, the server can take the IP address as a domain name resolution result and send the domain name resolution result to the client. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention is to allow storage of multiple pieces of domain name information, and each piece of domain name information stored locally can be read, and a domain name to be resolved in each piece of domain name information that is read is resolved, and coverage of a domain name resolution result does not occur.
Fig. 1 is a schematic flow chart of a first domain name resolution method provided in an embodiment of the present invention, in which a server stores a plurality of pieces of domain name information, each piece of domain name information records a domain name to be resolved, and the domain name to be resolved recorded in each piece of domain name information corresponds to IP addresses of different servers for operating a target website, as shown in fig. 1, the method may include the following steps: S101-S103.
Step S101: and responding to a domain name resolution request sent by the client, and reading each piece of locally stored domain name information.
Specifically, the server may store a plurality of pieces of domain name information, each piece of domain name information records a domain name to be resolved, each domain name to be resolved is a domain name of the target website, that is, for each domain name to be resolved, an IP address corresponding to the domain name to be resolved may be determined, and the client may access the target website based on the IP address. However, the domain names to be resolved recorded in different domain name information are different, such as: two pieces of domain name information are stored in the server, so that the domain name to be resolved recorded in the first piece of domain name information may be the domain name of a server provided by an M manufacturer, and the domain name to be resolved recorded in the second piece of domain name information may be the domain name of a server provided by an N manufacturer; or the domain name to be resolved recorded in the first piece of domain name information may be a domain name of a server provided by an O manufacturer, and the domain name to be resolved recorded in the second piece of domain name information may be a domain name of a server provided by a P manufacturer, in short, the domain name to be resolved recorded in the first piece of domain name information is different from the domain name to be resolved recorded in the second piece of domain name information.
Next, each domain name to be resolved corresponds to at least one IP address, such as: for each domain name to be resolved, the domain name to be resolved may correspond to only one IP address, or may correspond to a plurality of IP addresses such as two IP addresses and three IP addresses.
In addition, different domain names to be resolved correspond to the IP addresses of different servers for operating the target website respectively. Such as: if the target website that the client wants to access is a website a, and then two domain names are locally stored, one domain name to be resolved may be aaa.mmm.com, that is, the domain name of the server provided by M vendor, and the other domain name to be resolved may be aaa.nnn.com, that is, the domain name of the server provided by N vendor, and the IP address corresponding to the domain name aaa.mmm.com is: the IP address of the server provided by the M manufacturer of the website running A; the IP address corresponding to the domain name aaa.nnn.com is: the IP address of the server provided by N vendor of the website running A.
In an embodiment of the present invention, when a client needs to access the target website, the client may send a domain name resolution request to a server through a User Datagram Protocol (UDP) Protocol, and the server reads each piece of domain name information stored locally after receiving the domain name resolution request, where sending the domain name resolution request to the server through the UDP Protocol is prior art, and a specific implementation manner is not described herein again.
In another embodiment of the present invention, each domain name information records a domain name to be resolved of a CNAME (alias) type, and for each domain name to be resolved of a CNAME type, the domain name to be resolved corresponds to an address (a) record, the address (a) record corresponds to an IP address, and the IP address is the IP address corresponding to the domain name to be resolved.
And S102, resolving the domain name to be resolved in each read domain name information, and determining an IP address corresponding to each domain name to be resolved as a domain name resolution result.
Specifically, because the domain name to be resolved in each domain name information corresponds to at least one IP address, and different IP addresses correspond to different domain names to be resolved, the domain name to be resolved in each domain name information can be resolved, and the IP address corresponding to each domain name to be resolved is determined as a domain name resolution result.
In an embodiment of the present invention, for each piece of Domain Name information that is read, a Domain Name to be resolved recorded in each piece of Domain Name information is simultaneously acquired, and then the acquired Domain Name to be resolved may be resolved based on a conventional DNS (Domain Name System) resolution method.
In another embodiment of the present invention, the step S102 can be implemented by the following step S102A in fig. 3, which will not be described in detail here.
Step S103: and sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
Specifically, for each domain name resolution result, the domain name resolution result is an IP address of a server corresponding to an operating destination website, and thus, each domain name resolution result may be sent to the client, so that the client may select an IP address of a server operating a destination website based on each domain name resolution result, and then access the destination website based on the selected IP address. The client may select the IP address based on the prior art, which is not limited in the embodiment of the present invention.
In an embodiment of the present invention, the server may send each domain name resolution result to the client based on a UDP protocol, where sending a domain name resolution request to the server by the client through the UDP protocol is prior art, and a specific implementation manner is not described herein again.
In another embodiment of the present invention, the above steps can be implemented by step S103A in fig. 2, and can also be implemented by step S103B-step S103C in fig. 4, which will not be described in detail here.
As can be seen from the above, after receiving a domain name resolution request sent by a client, a server first reads each piece of domain name information stored locally, where each piece of domain name information records a domain name to be resolved, where the domain name to be resolved corresponds to an IP address of a server for operating a target website and different domain names to be resolved correspond to different IP addresses, and because the server can resolve the domain name to be resolved recorded in each piece of domain name information that is read, it can determine each IP address corresponding to the domain name to be resolved, and for each determined IP address, because the IP address is the IP address of the server for operating the target website, the server can take the IP address as a domain name resolution result and send the domain name resolution result to the client. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention is to allow storage of multiple pieces of domain name information, and can read each piece of locally stored domain name information, resolve a domain name to be resolved in each piece of read domain name information, and no coverage of a domain name resolution result occurs.
Fig. 2 is a schematic flow chart of a second domain name resolution method according to an embodiment of the present invention, as shown in fig. 2, compared with the embodiment shown in fig. 1, after the step S102, the method further includes the following steps: s104, the step S103 may include the following steps: S103A.
Step S104: and aiming at each determined IP address, acquiring flow indication information based on preset flow distribution information, and acquiring a domain name resolution result containing the IP address and the flow indication information corresponding to the IP address.
Wherein the traffic allocation information is used to: and allocating the data volume of the flow which can be processed by the server to the server corresponding to each IP address.
Specifically, the traffic allocation information is used to allocate the data volume of the processable traffic to the server corresponding to each IP address, so that the data volume of the processable traffic to the server corresponding to the IP address can be allocated for each IP address based on the preset traffic allocation information, and the data volume of the processable traffic allocated to the server corresponding to each IP address can be used as the traffic indication information.
In an embodiment of the present invention, the traffic distribution information may be preset according to an access speed of the client when accessing information in the target website based on servers corresponding to different IP addresses.
For example: the preset traffic distribution information may be a value, the value range of the value is 0-1, and the sum of the values of the traffic distribution information corresponding to each IP address is equal to 1. If two IP addresses, namely a first IP address and a second IP address, are determined in total, if according to the previous usage of the servers corresponding to the two IP addresses, the access speed when the server corresponding to the first IP address accesses information in the destination website is fast, and the access speed when the server corresponding to the second IP address accesses information in the destination website is slow, the value of the traffic distribution information corresponding to the first IP address may be 0.8, and the value of the traffic distribution information corresponding to the second IP address may be 0.2, that is, the data volume of the traffic that can be processed by the server corresponding to the first IP address accounts for eight tenths of the total data volume that can be processed, and the data volume of the traffic that can be processed by the server corresponding to the second IP address accounts for two tenths of the total data volume that can be processed.
Or, if the server corresponding to the first IP address has a slow access speed when accessing information in the destination website and the server corresponding to the second IP address has a fast access speed when accessing information in the destination website according to the previous usage of the servers corresponding to the two IP addresses, the value of the traffic allocation information corresponding to the first IP address may be 0.4 and the value of the traffic allocation information corresponding to the second IP address may be 0.6, that is, the data amount of the traffic that can be processed by the server corresponding to the first IP address accounts for four tenths of the total data amount that can be processed, and the data amount of the traffic that can be processed by the server corresponding to the second IP address accounts for six tenths of the total data amount that can be processed. That is, a server with a higher access speed can process a larger amount of traffic data, and a server with a lower access speed can process a smaller amount of traffic data.
In another embodiment of the present invention, the data amount may be allocated to the server corresponding to each IP address based on the historical traffic load information of the server corresponding to each IP address. Such as: when a total of two IP addresses, that is, a third IP address and a fourth IP address, are determined, and it is determined from the historical traffic load information of the servers corresponding to the two IP addresses that the traffic load before the server corresponding to the third IP address is high, and the traffic load before the server corresponding to the fourth IP address is low, that is, the data amount of the traffic that can be processed by the server corresponding to the third IP address is small, and the data amount of the traffic that can be processed by the server corresponding to the fourth IP address is large, the preset traffic allocation information may allocate a small data amount to the third IP address and allocate a large data amount to the fourth IP address.
Step S103A: and sending each domain name resolution result to the client so that the client selects an IP address based on the flow indication information contained in the domain name resolution result and accesses the target website based on the selected IP address.
Specifically, each domain name resolution result includes one IP address and traffic indication information corresponding to the IP address, and the traffic indication information corresponding to each IP address indicates the data amount of traffic that can be processed by the server corresponding to the IP address, so that the client can determine the data amount of traffic that can be processed by the server corresponding to each IP address based on the traffic indication information included in the domain name resolution result, and can select an IP address and access the target website based on the selected IP address.
As can be seen from the above, after the client receives each domain name resolution result, the client may obtain a plurality of IP addresses, and the client needs to select an IP address from the plurality of IP addresses to access the target website, according to the solution provided by the embodiment of the present invention, the server may allocate data volume of a traffic that can be processed to the server corresponding to each IP based on preset traffic allocation information, and then obtain a domain name resolution result including the IP address and traffic indication information corresponding to the IP address, and further may send each domain name resolution result to the client, so that the client may select an IP address based on the traffic indication information included in the domain name resolution result, and further may access the target website based on the selected IP address, so that the server may control the total amount of the traffic that can be processed by different IP addresses of the target website.
Fig. 3 is a schematic flow chart of a third domain name resolution method according to an embodiment of the present invention, and as shown in fig. 3, compared with the embodiment shown in fig. 1, the step S102 may include the steps of: S102A.
Step S102A: and sequentially reading each piece of domain name information, inquiring an IP address corresponding to a domain name to be resolved in the domain name information after each piece of domain name information is read, and taking the IP address as a domain name resolution result.
Specifically, the server may determine a plurality of pieces of domain name information, and therefore may sequentially read each piece of domain name information, determine a domain name to be resolved in the domain name information, query an IP address corresponding to the domain name to be resolved in the domain name information, and use the IP address as a domain name resolution result.
In an embodiment of the present invention, each piece of domain name information is sequentially read, then a domain name to be resolved in the domain name information is determined, and an IP address corresponding to the domain name to be resolved in the domain name information is queried based on a recursive query method, where the recursive query method is the prior art, and a specific implementation manner is not described herein again.
As can be seen from the above, since the server can determine a plurality of pieces of domain name information, it can sequentially read each piece of domain name information, then determine the domain name to be resolved in the domain name information, query the IP address corresponding to the domain name to be resolved in the domain name information, and use the IP address as a domain name resolution result. Therefore, the scheme provided by the embodiment of the invention can be used for analyzing the domain name to be analyzed in the determined domain name information.
Fig. 4 is a schematic flow chart of a fourth domain name resolution method according to an embodiment of the present invention, and as shown in fig. 4, compared with the embodiment shown in fig. 1, the step S103 may include the steps of: S103B-S103C.
Step S103B: and when determining that the client has a result combination requirement, combining the domain name resolution results, and sending a combination result to the client.
Specifically, the server may determine a plurality of domain name resolution results, so before sending the plurality of domain name resolution results to the client, it may determine whether the client has a result combination requirement, and if the client has the result combination requirement, the domain name resolution results may be combined to obtain a combined result, and then the combined result is sent to the client.
In an embodiment of the present invention, a list-form merged result may be created in advance, each domain name resolution result is then sequentially added to the merged result, and after all domain name resolution results are added to the merged result, the merged result is sent to the client.
Step S103C: and when determining that the client does not have a result combination requirement, respectively sending each domain name resolution result to the client.
Specifically, the server may determine a plurality of domain name resolution results, so before sending the plurality of domain name resolution results to the client, it may be determined whether the client has a result combination requirement, and if the client does not have the result combination requirement, the server may send the domain name resolution results to the client in sequence.
As can be seen from the above, since the server can determine a plurality of domain name resolution results, before sending a plurality of domain name resolution results to the client, it can be determined whether the client has a result combination requirement, if it is determined that the client has the result combination requirement, the domain name resolution results can be combined to obtain a combination result, and then the combination result is sent to the client, and if it is determined that the client does not have the result combination requirement, the domain name resolution results can be sequentially sent to the client.
In addition, an embodiment of the present invention may further provide a domain name resolution system, where the domain name resolution system includes a client, a server, and a domain name resolution device.
The server may be configured with a domain name management unit and a domain name resolution unit in advance, where the domain name management unit is configured to store a plurality of pieces of domain name information and the traffic allocation information, and the domain name resolution unit is configured to resolve a domain name to be resolved in each piece of domain name information based on an http (HyperText Transfer Protocol) Protocol.
The client may be an electronic device such as a mobile phone, a TV (Television), a computer, a tablet computer, and the like, where the client may be configured with an SDK (Software Development Kit) in advance, the client may send a domain name resolution request to the server based on the SDK, and the domain name resolution request sent based on the SDK may be received by the domain name resolution unit.
Fig. 5 is a schematic flowchart of a domain name resolution system provided in the implementation of the present invention, and as shown in fig. 5, the method may include the following steps: S501-S507.
Step S501: and the client sends a domain name resolution request to the server under the condition that the client needs to access the target website.
Step S502: the server side responds to a domain name resolution request sent by the client side and reads each piece of locally stored domain name information.
Step S503: and the server side reads each piece of domain name information in sequence, and inquires the IP address corresponding to the domain name to be analyzed in the domain name information to the domain name analyzing equipment based on a recursive inquiry method after each piece of domain name information is read.
Step S504: and the domain name resolution equipment sends the IP address corresponding to the domain name to be resolved in the domain name information to the server.
Step S505: and the server takes the IP address corresponding to the domain name to be resolved in the domain name information as a domain name resolution result.
Step S506: and the server side sends each domain name resolution result to the client side.
Step S507: and the client accesses the target website based on each domain name resolution result.
Specifically, the specific implementation method in steps S501 to S507 has been described in detail above, and is not described herein again.
Fig. 6 is a schematic structural diagram of a first domain name resolution device according to an embodiment of the present invention, where a server stores multiple pieces of domain name information, each piece of domain name information records a domain name to be resolved, and the domain name to be resolved recorded in each piece of domain name information corresponds to an IP address of a different server for operating a target website, as shown in fig. 6, the device includes the following modules: 601-603.
The domain name information reading module 601: responding to a domain name resolution request sent by a client, and reading each piece of locally stored domain name information;
domain name resolution module 602: the domain name analysis device is used for analyzing the domain names to be analyzed in each piece of read domain name information, and determining an IP address corresponding to each domain name to be analyzed as a domain name analysis result;
analysis result sending module 603: and the server is used for sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
As can be seen from the above, after receiving a domain name resolution request sent by a client, a server first reads each piece of domain name information stored locally, where each piece of domain name information records a domain name to be resolved, where the domain name to be resolved corresponds to an IP address of a server for operating a target website and different domain names to be resolved correspond to different IP addresses, and because the server can resolve the domain name to be resolved recorded in each piece of domain name information that is read, it can determine each IP address corresponding to the domain name to be resolved, and for each determined IP address, because the IP address is the IP address of the server for operating the target website, the server can take the IP address as a domain name resolution result and send the domain name resolution result to the client. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention is to allow storage of multiple pieces of domain name information, and each piece of domain name information stored locally can be read, and a domain name to be resolved in each piece of domain name information that is read is resolved, and coverage of a domain name resolution result does not occur.
In an embodiment of the present invention, the domain name resolution module 602 is specifically configured to:
and after each piece of domain name information is read, inquiring an IP address corresponding to the domain name to be analyzed in the domain name information, and taking the IP address as a domain name analysis result.
As can be seen from the above, since the server can determine a plurality of pieces of domain name information, it can sequentially read each piece of domain name information, then determine the domain name to be resolved in the domain name information, query the IP address corresponding to the domain name to be resolved in the domain name information, and use the IP address as a domain name resolution result. Therefore, the scheme provided by the embodiment of the invention can be used for analyzing the domain name to be analyzed in the determined domain name information.
In another embodiment of the present invention, the analysis result sending module 603 is specifically configured to:
when determining that the client has a result combination requirement, combining the domain name resolution results, and sending a combination result to the client;
and when determining that the client does not have a result combination requirement, respectively sending each domain name resolution result to the client.
As can be seen from the above, since the server can determine a plurality of domain name resolution results, before sending a plurality of domain name resolution results to the client, it can be determined whether the client has a result combination requirement, if it is determined that the client has the result combination requirement, the domain name resolution results can be combined to obtain a combination result, and then the combination result is sent to the client, and if it is determined that the client does not have the result combination requirement, the domain name resolution results can be sequentially sent to the client.
Fig. 7 is a schematic structural diagram of a second domain name resolution apparatus according to an embodiment of the present invention, as shown in fig. 7, compared with the embodiment shown in fig. 6, the apparatus includes the following modules: 604.
the selection information obtaining module 604: the domain name resolution method is used for obtaining flow indication information based on preset flow allocation information aiming at each determined and obtained IP address, and obtaining a domain name resolution result containing the IP address and the flow indication information corresponding to the IP address, wherein the flow allocation information is used for: distributing the data volume of the flow which can be processed by the server corresponding to each IP address;
the analysis result sending module 603 is specifically configured to:
and sending each domain name resolution result to the client so that the client selects an IP address based on the flow indication information contained in the domain name resolution result and accesses the target website based on the selected IP address.
As can be seen from the above, after the client receives each domain name resolution result, the client may obtain a plurality of IP addresses, and the client needs to select an IP address from the plurality of IP addresses to access the target website, according to the solution provided by the embodiment of the present invention, the server may allocate data volume of a traffic that can be processed to the server corresponding to each IP based on preset traffic allocation information, and then obtain a domain name resolution result including the IP address and traffic indication information corresponding to the IP address, and further may send each domain name resolution result to the client, so that the client may select an IP address based on the traffic indication information included in the domain name resolution result, and further may access the target website based on the selected IP address, so that the server may control the total amount of the traffic that can be processed by different IP addresses of the target website.
In one embodiment of the present invention, each domain name information records a domain name to be resolved of an alias name CNAME type.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 communicate with each other through communication
A memory 803 for storing a computer program;
the processor 801 is configured to implement the steps of any domain name resolution method in the foregoing method embodiments when executing the program stored in the memory 803.
When the electronic device provided by the embodiment of the invention is applied to domain name resolution, after a domain name resolution request sent by a client is received, a server first reads each piece of locally stored domain name information, each piece of domain name information records a domain name to be resolved, the domain name to be resolved corresponds to an IP address of a server for operating a target website, and different domain names to be resolved correspond to different IP addresses. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention is to allow storage of multiple pieces of domain name information, and can read each piece of locally stored domain name information, resolve a domain name to be resolved in each piece of read domain name information, and no coverage of a domain name resolution result occurs.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the domain name resolution method in any one of the above embodiments.
When the computer-readable storage medium provided by the embodiment of the invention is applied to domain name resolution, after a domain name resolution request sent by a client is received, a server first reads each piece of locally stored domain name information, each piece of domain name information records a domain name to be resolved, the domain name to be resolved corresponds to an IP address of a server for operating a target website, and different domain names to be resolved correspond to different IP addresses. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention is to allow storage of multiple pieces of domain name information, and each piece of domain name information stored locally can be read, and a domain name to be resolved in each piece of domain name information that is read is resolved, and coverage of a domain name resolution result does not occur.
In yet another embodiment, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the domain name resolution method of any of the above embodiments.
When the computer program product provided by the embodiment of the invention is applied to domain name resolution, after a domain name resolution request sent by a client is received, a server first reads each piece of locally stored domain name information, each piece of domain name information records a domain name to be resolved, the domain name to be resolved corresponds to an IP address of a server for operating a target website, and different domain names to be resolved correspond to different IP addresses. Therefore, through the scheme of the embodiment of the invention, the domain name can be analyzed, so that the client accesses the target website based on the domain name analysis result, and further can access the information provided by the target website.
In addition, according to the domain name resolution protocol provided in the prior art, only one piece of domain name information is generally stored in the server for domain name resolution, and even if a plurality of pieces of domain name information are stored in the server, in the process of performing domain name resolution on a domain name to be resolved in each piece of domain name information, a domain name resolution result obtained by the subsequent resolution covers a domain name resolution result obtained by the previous resolution, so that only one domain name resolution result can be finally obtained. In the solution provided by the embodiment of the present invention, the execution main body of the present invention is to allow storage of multiple pieces of domain name information, and each piece of domain name information stored locally can be read, and a domain name to be resolved in each piece of domain name information that is read is resolved, and coverage of a domain name resolution result does not occur.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in the relevant places, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A domain name resolution method is characterized in that the domain name resolution method is applied to a server, a plurality of pieces of domain name information are stored in the server, each piece of domain name information records a domain name to be resolved, and the domain name to be resolved recorded in each piece of domain name information corresponds to IP addresses of different servers for operating a target website respectively, and the method comprises the following steps:
responding to a domain name resolution request sent by a client, and reading each piece of locally stored domain name information;
analyzing the domain name to be analyzed in each read domain name information, and determining an IP address corresponding to each domain name to be analyzed as a domain name analysis result;
and sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
2. The method according to claim 1, wherein after the analyzing the domain name to be analyzed in each piece of domain name information read, and determining the IP address corresponding to each domain name to be analyzed as a result of domain name analysis, the method further comprises:
for each determined IP address, obtaining traffic indication information based on preset traffic allocation information, and obtaining a domain name resolution result including the IP address and the traffic indication information corresponding to the IP address, where the traffic allocation information is used to: distributing the data volume of the flow which can be processed by the server to the server corresponding to each IP address;
the sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result includes:
and sending each domain name resolution result to the client so that the client selects an IP address based on the flow indication information contained in the domain name resolution result and accesses the target website based on the selected IP address.
3. The method according to claim 1, wherein the analyzing the domain name to be analyzed in each read domain name information, and determining the IP address corresponding to each domain name to be analyzed, as a result of domain name analysis, includes:
and sequentially reading each piece of domain name information, inquiring an IP address corresponding to a domain name to be resolved in the domain name information after each piece of domain name information is read, and taking the IP address as a domain name resolution result.
4. The method according to claim 1, wherein the sending the respective domain name resolution result to the client comprises:
when determining that the client has a result combination requirement, combining the domain name resolution results, and sending a combination result to the client;
and when determining that the client does not have a result combination requirement, respectively sending each domain name resolution result to the client.
5. The method according to any of claims 1-4, characterized in that recorded in each domain name information is a domain name to be resolved of alias CNAME type.
6. A domain name resolution apparatus, comprising:
the domain name information reading module is used for responding to a domain name resolution request sent by a client and reading each piece of locally stored domain name information;
the domain name resolution module is used for resolving the domain names to be resolved in each piece of read domain name information, and determining the IP addresses corresponding to the domain names to be resolved as a domain name resolution result;
and the resolution result sending module is used for sending each domain name resolution result to the client so that the client accesses the target website based on the domain name resolution result.
7. The apparatus of claim 6, further comprising:
a selection information obtaining module, configured to obtain, for each determined IP address, traffic indication information based on preset traffic allocation information, and obtain a domain name resolution result including the IP address and the traffic indication information corresponding to the IP address, where the traffic allocation information is used to: distributing the data volume of the flow which can be processed by the server to the server corresponding to each IP address;
the analysis result sending module is specifically configured to:
and sending each domain name resolution result to the client so that the client selects an IP address based on the flow indication information contained in the domain name resolution result and accesses the target website based on the selected IP address.
8. The apparatus of claim 6, wherein the domain name resolution module is specifically configured to:
and after each piece of domain name information is read, inquiring an IP address corresponding to the domain name to be analyzed in the domain name information, and taking the IP address as a domain name analysis result.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202211266022.3A 2022-10-17 2022-10-17 Domain name resolution method and device Pending CN115834535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211266022.3A CN115834535A (en) 2022-10-17 2022-10-17 Domain name resolution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211266022.3A CN115834535A (en) 2022-10-17 2022-10-17 Domain name resolution method and device

Publications (1)

Publication Number Publication Date
CN115834535A true CN115834535A (en) 2023-03-21

Family

ID=85524832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211266022.3A Pending CN115834535A (en) 2022-10-17 2022-10-17 Domain name resolution method and device

Country Status (1)

Country Link
CN (1) CN115834535A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457440A (en) * 2012-01-13 2012-05-16 华为软件技术有限公司 Method for realizing load balancing, DNS server, and Client
CN103634227A (en) * 2012-08-20 2014-03-12 百度在线网络技术(北京)有限公司 A service traffic precision scheduling method based on a user quantity and an apparatus thereof
CN104954401A (en) * 2014-03-27 2015-09-30 阿里巴巴集团控股有限公司 Flow scheduling method and apparatus
CN108494860A (en) * 2018-03-28 2018-09-04 百度在线网络技术(北京)有限公司 WEB accesses system, WEB access methods and device for client
CN108600412A (en) * 2018-05-03 2018-09-28 深圳市茁壮网络股份有限公司 A kind of domain name analytic method and system
CN108881509A (en) * 2018-05-31 2018-11-23 网宿科技股份有限公司 A kind of DNS query method and device based on HTTPDNS
CN110099131A (en) * 2019-05-17 2019-08-06 网宿科技股份有限公司 A kind of domain name analytic method and device
CN110769080A (en) * 2019-10-30 2020-02-07 腾讯科技(深圳)有限公司 Domain name resolution method, related product and computer readable storage medium
CN114205330A (en) * 2021-11-09 2022-03-18 北京快乐茄信息技术有限公司 Domain name resolution method, domain name resolution device, server, and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457440A (en) * 2012-01-13 2012-05-16 华为软件技术有限公司 Method for realizing load balancing, DNS server, and Client
CN103634227A (en) * 2012-08-20 2014-03-12 百度在线网络技术(北京)有限公司 A service traffic precision scheduling method based on a user quantity and an apparatus thereof
CN104954401A (en) * 2014-03-27 2015-09-30 阿里巴巴集团控股有限公司 Flow scheduling method and apparatus
CN108494860A (en) * 2018-03-28 2018-09-04 百度在线网络技术(北京)有限公司 WEB accesses system, WEB access methods and device for client
CN108600412A (en) * 2018-05-03 2018-09-28 深圳市茁壮网络股份有限公司 A kind of domain name analytic method and system
CN108881509A (en) * 2018-05-31 2018-11-23 网宿科技股份有限公司 A kind of DNS query method and device based on HTTPDNS
CN110099131A (en) * 2019-05-17 2019-08-06 网宿科技股份有限公司 A kind of domain name analytic method and device
CN110769080A (en) * 2019-10-30 2020-02-07 腾讯科技(深圳)有限公司 Domain name resolution method, related product and computer readable storage medium
CN114205330A (en) * 2021-11-09 2022-03-18 北京快乐茄信息技术有限公司 Domain name resolution method, domain name resolution device, server, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
秦臻;肖春静;李乐民;: "基于云的域名解析服务模型", 通信学报, no. 02, 25 February 2013 (2013-02-25) *

Similar Documents

Publication Publication Date Title
CN110677405B (en) Data processing method and device, electronic equipment and storage medium
US20150271031A1 (en) Systems and methods for improving domain name system traffic routing
CN111460460A (en) Task access method, device, proxy server and machine-readable storage medium
CN110740191B (en) Resource access method, device, electronic equipment and storage medium
JP2019503537A (en) Method and apparatus for processing short link and short link server
US8799518B2 (en) Process for selecting an authoritative name server
CN109327559B (en) Domain name resolution method and device based on hybrid cloud platform
CN110572390A (en) Method, device, computer equipment and storage medium for detecting domain name hijacking
CN111432045A (en) Method, device and equipment for testing server scheduling algorithm of domain name system
CN111064804B (en) Network access method and device
US20170289243A1 (en) Domain name resolution method and electronic device
CN105610993A (en) Method, device and system for domain name resolution
CN111556135A (en) Request scheduling method, system and device and electronic equipment
WO2022206549A1 (en) Domain name acquisition method and system, electronic device, equipment, and medium
CN113992626A (en) Method, device and storage medium for realizing DNS
CN109379426B (en) X-CDN scheduling method, device and system based on X-DNS
CN108183926B (en) Data packet processing method and device
CN115834535A (en) Domain name resolution method and device
CN108737493B (en) Address allocation method and device and electronic equipment
CN109905486B (en) Application program identification display method and device
CN114448849B (en) Method for detecting supporting mode of IPv6 network of website and electronic equipment
CN114500456B (en) DNS (Domain name System) scheduling optimization method and device based on whole network sniffing and computing equipment
CN114356456A (en) Service processing method, device, storage medium and electronic equipment
CN114285856B (en) IPV4 external link access method and device
CN110798540B (en) Data interaction method and device

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