Domain name resolution method and apparatus for content distribution network, electronic device, and storage medium
By sending a second DNS request to the public DNS server in an authoritative DNS server to obtain the resolution results and ensuring that the results are of the same category as the client IP address, the inefficiency of domain name resolution and access delay caused by multi-level CNAME in CDN is solved. Problems, enabling fast website access.
Patent Information
- Application Number
- PCT/CN2024/089765
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-09
- Filing Date
- 2024-04-25
- Publication Date
- 2024-11-14
AI Technical Summary
In scenarios such as content distribution network (CDN), multi-level CNAME settings lead to low domain name resolution efficiency, increased response delay, and access lag or delay problems caused by different resolution results from the home line of the client IP address are difficult to solve.
In an authoritative DNS server, if there is no resolution result in the local cache when receiving the DNS request, send a second DNS request to the public DNS server to obtain the resolution result and return it to the sender to ensure that the resolution result is and the client IP address Homework lines with the same category avoid multiple iterative queries and improve query efficiency.
By reducing the number of DNS requests, the query efficiency of domain name resolution is improved, and the access delay problem caused by the difference between the resolution result and the client IP address home line is reduced, so as to achieve fast website access.
Smart Images

Figure CN2024089765_14112024_PF_FP_ABST
Abstract
Description
Domain name resolution method, device, electronic device and storage medium for content distribution network
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on and claims priority to an application filed in China with application number 202310518192.4 and filing date May 9, 2023. The disclosure of the application in China is hereby incorporated as a whole into this application. Technical Field
[0003] The present disclosure relates to the field of computer technology, and in particular to a domain name resolution method, device, electronic device, and storage medium for a content distribution network. Background Art
[0004] Domain name resolution is a technology that converts domain names to the IP (Internet Protocol) addresses of website hosting spaces, allowing users to easily access websites using registered domain names. For ease of use, domain names are often used instead of IP addresses to identify website addresses. Domain name resolution is the process of converting domain names to IP addresses, and is performed by DNS (Domain Name System) servers.
[0005] Summary of the Invention
[0006] The present disclosure provides a domain name resolution method, device, electronic device, and storage medium for a content distribution network.
[0007] According to one aspect of the present disclosure, a domain name resolution method is provided, which is applied to an authoritative domain name system (DNS) server. The method includes:
[0008] Receive a first DNS request sent by a sender, where the first DNS request carries a target domain name to be resolved and an IP address of a client;
[0009] If the resolution result of the target domain name does not exist in the local cache, obtaining an alias CNAME record of the target domain name;
[0010] Sending a second DNS request including the CNAME record and the IP address of the client to the public DNS server;
[0011] Receive the A record corresponding to the CNAME record sent by the public DNS server, use the A record as the resolution result of the target domain name, and send the resolution result to the sender; the resolution result and the IP address of the client have the same category of home line.
[0012] According to another aspect of the present disclosure, a domain name resolution device for a content distribution network is provided, the device comprising:
[0013] A DNS request receiving module is configured to receive a first DNS request sent by a sender, where the first DNS request carries a target domain name to be resolved and an IP address of a client;
[0014] an alias record acquisition module, configured to acquire an alias CNAME record of the target domain name if the resolution result of the target domain name does not exist in the local cache;
[0015] A DNS request sending module, configured to send a second DNS request including the CNAME record and the IP address of the client to a public DNS server;
[0016] A resolution result acquisition module, configured to receive the A record corresponding to the CNAME record sent by the public DNS server, and use the A record as the resolution result of the target domain name;
[0017] The first analysis result sending module is used to send the analysis result to the sender; the analysis result and the IP address of the client have the same type of home line.
[0018] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the program.
[0019] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0021] FIG1 is a schematic diagram of a DNS resolution process in related art;
[0022] FIG2 is a schematic diagram of a DNS resolution process in an exemplary embodiment of the present disclosure;
[0023] FIG3 is a flowchart of domain name resolution provided by an exemplary embodiment of the present disclosure;
[0024] FIG4 is a schematic block diagram of functional modules of a domain name resolution device provided by an exemplary embodiment of the present disclosure;
[0025] FIG5 is a structural block diagram of an electronic device provided by an exemplary embodiment of the present disclosure;
[0026] FIG6 is a structural block diagram of a computer system provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] Since IP addresses are numbers that identify sites on the Internet, they are not easy to remember. Therefore, domain names are usually used instead of IP addresses to identify site addresses. Domain name resolution is the process of converting domain names to IP addresses, allowing users to easily access websites directly through domain names. For example, when a user needs to visit a website, they enter the corresponding domain name in the browser, such as www.duoyin.com. The domain name is resolved by the DNS server, and the IP address corresponding to the domain name is finally obtained. The website can be accessed through this IP address. Among them, the IP address corresponding to the host name or domain name is called an A record.
[0033] In service areas such as CDN (Content Delivery Network), DNS CNAME (alias) record resolution is usually required to perform local access scheduling. In the case of multi-level CNAMEs, multiple DNS requests are usually required to obtain the final domain name resolution result, which is inefficient.
[0034] When a DNS server is performing domain name resolution, alias resolution usually occurs, which is a mapping from host name to host name. When you need to point a domain name to another domain name, and then have another domain name provide an IP address, you need to add a CNAME (alias) record. The most commonly used CNAME scenarios include CDN, corporate email, global traffic management, etc. Unlike the A record, the value set in the CNAME record is not a fixed IP, but an alias address of the host. Alias resolution can provide greater flexibility and facilitate unified management. For example, when the host needs to change its IP due to some factors, if a CNAME record is made for the domain name, the resolution direction of the alias can be updated at the same time, and there is no need to perform a new resolution operation.
[0035] In systems such as CDN, DNS CNAME resolution is often used to perform local access scheduling for businesses. For example, the business domain name www.douyin.com was originally resolved to the A record 1.1.1.1 (source site). Now to use CDN services, the CDN system will change the resolution of the domain name to CNAME scheduling. That is, www.douyin.com is no longer directly resolved to the source site, for example, it is resolved to the CNAME record www.douyin.com.gslb.com. In this business scenario, as shown in Figure 1, recursive DNS requires two DNS requests to obtain the final A record. Especially when multi-level CNAME is set up, a DNS query will go through multiple repeated iterative queries, which will greatly reduce the efficiency of the query and increase the response delay.
[0036] As shown in Figure 1, in the related art, after receiving the NDS request sent by the client, the recursive DNS server will forward the DNS request to the corresponding authoritative DNS server. For example, the recursive NDS server sends a DNS request containing www.douyin.cm. The authoritative DNS server responds to the request and points www.douyin.cm to another domain name www.douyin.com.gslb.com by performing alias resolution, and sends a CNAME record containing www.douyin.com.gslb.com to the recursive DNS server; when the recursive NDS server receives the CNAME record, it will send a DNS request containing www.douyin.com.gslb.com to another (possibly the same) authoritative DNS server. After receiving the DNS request, the authoritative DNS server will perform resource scheduling analysis, and will eventually return the IP address of the nearest server, i.e., the A record. In this way, the recursive DNS needs to obtain the final A record twice. If the CNAME is set with more levels, more interactions will be required to obtain the A record, which makes the domain name resolution efficiency low.
[0037] The domain name resolution method, device, electronic device, and storage medium provided by the embodiments of the present disclosure are such that, upon receiving the first DNS request sent by the sender, if the authoritative DNS server does not have a resolution result in the local cache, it will send a second DNS request to the public DNS to receive the resolution result returned by the public DNS server, and return the resolution result to the sender. Since the sender only needs to send a DNS request to the authoritative DNS server once to obtain the resolution result, the query efficiency of the sender's domain name resolution can be greatly improved, and since the resolution result and the client's IP address have the same category of attribution line, it can be well applied in scenarios such as CDN, and can well avoid the problem of lag or excessive delay when the user accesses the website due to the different attribution lines of the resolution result and the client's IP address.
[0038] In the embodiments provided herein, for example, when a user wants to watch a video or access resources on a website through a client, the client sends a DNS request containing the target domain name and the client's IP address to a local DNS server. The local DNS server may be a recursive DNS server or a public DNS server, and the recursive / public DNS server may also be a DNS resolver. In the embodiments, the local DNS server is described as a recursive DNS server. After receiving the DNS request, the recursive DNS server forwards the DNS request to an authoritative DNS server, which may be represented by authoritative DNS server A in the embodiments.
[0039] The authoritative DNS server A will check whether there is a resolution result for the target domain name in the local cache. If there is no resolution result for the target domain name, by resolving the target domain name, if the target domain name has a CNAME record, the authoritative server will send a DNS request containing the client IP and the CNAME record to the public DNS server. After receiving the DNS request, the public DNS server will forward the DNS request to the corresponding authoritative DNS server B. If the CNMAE is multi-level, recursive iterative requests can be implemented to perform multi-level CNMAE queries until the A record is obtained. The public DNS server will return the A record to the authoritative DNS server A. The authoritative DNS server A will locally cache the A record according to the category of the affiliated line, such as Netcom line or Telecom line. The authoritative DNS server A will return the A record to the recursive DNS server, and the recursive DNS server will return the A record to the client so that the client can obtain the resources on the corresponding website.
[0040] Exemplarily, as shown in Figure 2, the client sends a DNS request to the recursive DNS server. The DNS request contains the target domain name www.douyin.com and carries the client IP address. After receiving the DNS request, the recursive DNS server will forward the DNS request to the authoritative DNS server A. The authoritative DNS server A resolves the target domain name. If the resolution result corresponding to the target domain name does not exist in the local cache, and it is found that the target domain name corresponds to the CNME record www.douyin.gslb.com, it will send a DNS request containing www.douyin.gslb.com and the client IP to the public DNS server. After receiving the DNS request, the public DNS server will forward the DNS request to the corresponding authoritative DNS server B. If there are multiple levels of CNAME records, it will send a recursive iterative request to obtain the final CNAME record and the corresponding A record. After obtaining the A record, the public DNS will hide the intermediate CNAME record and return the A record to the authoritative DNS server A. The authoritative DNS server A returns the A record to the recursive DNS server and caches it locally. The recursive DNS server also returns the A record to the client.
[0041] The public DNS server performs a recursive iterative request, forwarding the DNS request to authoritative DNS server B by carrying the client's IP address. Authoritative DNS server B performs intelligent resolution based on the client's IP address. If the matching line is Anhui Telecom, for example, it will return the A record corresponding to the Anhui Telecom line and optionally hide the intermediate CNAME record. It should be noted that for simplicity, the recursive iterative requests are not split in this embodiment, but are merged together.
[0042] In an embodiment, when the authoritative DNS server performs local caching, it will cache according to the category of the attribution line. For example, the resolution result of the target domain name can be divided into Anhui Telecom, Shanghai Mobile or Beijing Telecom, etc. In this way, by caching the resolution result of the domain name locally on the authoritative DNS server A and caching according to the attribution line described in the IP address, when receiving a DNS request containing the target domain name and the client IP, the authoritative DNS server A can quickly obtain the resolution result by searching the local cache for the resolution result of the target domain name that is consistent with the attribution line category of the client IP. And by obtaining the resolution result of the target domain name that is consistent with the attribution line category of the client IP, for example, the client IP belongs to Beijing Mobile, and the resolution result of the target domain name also belongs to Beijing Mobile, the client can quickly access the corresponding website under the same operator, avoiding the problem of freeze or large delay when the user accesses the resources of the relevant website through the client due to inconsistent attribution line categories.
[0043] In the embodiment provided by the present disclosure, the resolution result of the authoritative server B obtained by the authoritative DNS server A may not be cached according to the TTL (Time To Live, survival time value), and it is ensured that the cached data can be stored for a long time and will not be deleted due to expiration. Otherwise, according to the traditional method, if the TTL expires, it will cause the DNS resolution time to be too long and the CNAME acceleration effect to be unobvious. Therefore, in the embodiment, the locally cached resolution result may not be deleted immediately after the TTL expires, but will continue to be retained in the cache. If a DNS request that needs to respond to the resolution result with expired TTL is received, the expired resolution result can be used to respond to the DNS request. In addition, a DNS request will be sent asynchronously to an external public DNS server so as to be forwarded to the corresponding other authoritative DNS servers to obtain the latest resolution result, and the expired resolution result will be replaced by the latest resolution result to update the local cached data. In this way, when the same DNS request is received subsequently, the DNS request can be responded to by the updated local cache.
[0044] In the embodiment, although the resolution result will still be used as a response to the DNS request after the TTL of the resolution result expires, it is considered that the resolution result with expired TTL may still be used normally with a high probability and can quickly respond to the DNS request. Otherwise, it will cause the DNS resolution to be too long and the CNAME acceleration effect will not be obvious. In addition, considering that in scenarios such as edge scheduling such as CND, the amount of domain name resolution is large enough through intelligent resolution, when the TTL expires, there will basically be a traffic request immediately, and the cached results can be refreshed asynchronously. For example, on a short video website, many videos will be viewed tens of thousands of times. After the TTL of the local cache expires, the local cache can be quickly updated in a short time.
[0045] Based on the above embodiment, in another embodiment provided by the present disclosure, as shown in FIG3 , a domain name resolution method for a content distribution network is provided. The method can be applied to the authoritative DNS server A in the above embodiment. The method may include the following steps:
[0046] In step S310, a first DNS request sent by a sender is received.
[0047] The first DNS request carries the target domain name to be resolved and the IP address of the client.
[0048] As shown in FIG. 2 , the sender may be a DNS recursive server.
[0049] In step S320, a search is performed in the local cache to determine whether there is a resolution result for the target domain name.
[0050] When the resolution result of the target domain name does not exist in the local cache, in step S330 , the CNAME record of the target domain name is obtained.
[0051] In this embodiment, when an authoritative DNS server receives a DNS request from a recursive DNS server, it may first check its local cache for a resolution result for the target domain name. If so, it will directly return the resolution result. Otherwise, it will determine whether the target domain name has a CNAME record through resolution. If not, it will send a DNS request containing the target domain name and the client's IP address to a public DNS server.
[0052] If the target domain name has a CNAME record, a DNS request containing the CNAME and the client's IP address will be sent to the public DNS server. In the embodiment, the target domain name having a CNAME record is used as an example for description. Therefore, if the resolution result of the target domain name does not exist in the local cache, the CNAME record of the target domain name is obtained.
[0053] In step S340 , a second DNS request including the CNAME record and the IP address of the client is sent to the public DNS server.
[0054] In step S350, the A record corresponding to the CNAME record sent by the public DNS server is received, the A record is used as the resolution result of the target domain name, and the resolution result is sent to the sender. The resolution result has the same type of home line as the client's IP address.
[0055] As shown in Figure 2, CNAMEs are typically configured at multiple levels. Upon receiving the secondary DNS request, the public DNS server initiates a recursive request to authoritative DNS server B, forwarding the DNS request to authoritative DNS server B by carrying the client's IP address. Authoritative DNS server B also performs intelligent resolution based on the client's IP address, obtaining an A record that matches the client's IP line type, for example, a Shanghai Mobile line.
[0056] In the domain name resolution method for a content distribution network provided by the embodiment of the present disclosure, when the authoritative DNS server receives the first DNS request sent by the sender, if there is no resolution result in the local cache, it will send a second DNS request to the public DNS to receive the resolution result returned by the public DNS server, and return the resolution result to the sender. Since the sender only needs to send a DNS request to the authoritative DNS server once to obtain the resolution result, the query efficiency of the sender's domain name resolution can be greatly improved. Moreover, since the resolution result and the client's IP address have the same category of home line, it can be well applied in scenarios such as CDN, and can avoid the problem of lag or excessive delay when users access the website due to the different home lines of the resolution result and the client's IP address.
[0057] When caching the parsing results locally, the category of the home line needs to be taken into consideration to avoid returning parsing results of home lines of different categories to the sender. Therefore, based on the above embodiment, in another embodiment provided by the present disclosure, the method may further include the following steps:
[0058] S361, obtaining the target category of the line to which the client IP address belongs.
[0059] S362: Based on the target category, save the resolution result of the target domain name into the local cache.
[0060] In the embodiment of the present disclosure, the sender can store the obtained resolution result of the target domain name in the local cache by sending a DNS request only once, so that when the DNS request of the target domain name is received again, it can be searched in the local cache.
[0061] In this embodiment, when performing local caching, the authoritative DNS server caches the domain name based on the category of the home line. For example, the resolution result of the target domain name can be divided into Anhui Telecom, Shanghai Mobile, Beijing Telecom, etc. according to the category of the home line. For example, if the target domain name is www.douyin.com and the CNAME record is www.douyin.gslb.com, the corresponding locally cached resolution results include: Anhui Telecom, A1.1.1.1; Shanghai Mobile A2.2.2.2, etc.
[0062] In order to avoid returning the parsing results of different types of home lines to the sender, based on the above embodiment, in another embodiment provided by the present disclosure, the method may further include the following steps:
[0063] S363, if the resolution result of the target domain name exists in the local cache, determining whether the resolution result of the target domain name has the same type of home line as the client's IP address;
[0064] S364: If a target resolution result exists, send the target resolution result to the sender.
[0065] In the disclosed embodiment, upon receiving a DNS request from a sender, the authoritative DNS server may first search its local cache for a corresponding resolution result. If so, it may also determine whether the resolution result and the client's IP address have the same category of home line. If so, the corresponding target resolution result will be sent to the sender, enabling the client to quickly access corresponding websites under the same operator, avoiding issues such as lag or significant delays when users access resources on related websites through the client due to inconsistent home line categories.
[0066] Based on the above embodiment, in another embodiment provided by the present disclosure, the method may further include the following steps:
[0067] S365: If the resolution result of the target domain name exists in the local cache, determine whether the TTL value of the resolution result of the target domain name has expired.
[0068] S366: When the TTL of the resolution result of the target domain name expires, the resolution result of the target domain name is sent to the sender, and the resolution result with expired TTL in the local cache is updated.
[0069] In an embodiment, the locally cached resolution result may not be deleted immediately after the TTL expires, but will continue to be retained in the cache. If a DNS request is received that requires a response to the resolution result with expired TTL, the expired resolution result can be used to respond to the DNS request. In addition, the DNS request will be sent asynchronously to an external public DNS server so that it can be forwarded to the corresponding other authoritative DNS servers to obtain the latest resolution result, and the expired resolution result will be replaced by the latest resolution result to update the local cache data. In this way, when the same DNS request is received subsequently, the DNS request can be responded to by the updated local cache.
[0070] In the embodiment, although the resolution result will still be used as a response to the DNS request after the TTL of the resolution result expires, it is considered that the resolution result with expired TTL may still be used normally with a high probability and can quickly respond to the DNS request. Otherwise, it will cause the DNS resolution to be too long and the CNAME acceleration effect will not be obvious. In addition, considering that in scenarios such as edge scheduling such as CND, the amount of domain name resolution is large enough through intelligent resolution, when the TTL expires, there will basically be a traffic request immediately, and the cached results can be refreshed asynchronously. For example, on a short video website, many videos will be viewed tens of thousands of times. After the TTL of the local cache expires, the local cache can be quickly updated in a short time.
[0071] Specifically, in this embodiment, the authoritative DNS server may send a third DNS request to the public DNS server, the third DNS request including the CNAME record of the target domain name and the IP address of the client. The authoritative DNS server receives the A record of the CNAME record sent by the DNS server and replaces the resolution result of the target domain name with the expired TTL in the local cache with the A record of the CNAME record, thereby updating the local cache.
[0072] In the embodiment, when the TTL of the resolution result of the target domain name has not expired, the resolution result of the target domain name can also be sent to the sender, and in this case, there is no need to update the resolution result in the local cache.
[0073] S371, based on the above embodiment, in another embodiment provided by the present disclosure, the method may further include the following steps:
[0074] S372: Detect whether the remaining storage space of the local cache is less than a threshold.
[0075] S373: When the remaining storage space of the local cache is less than the storage threshold, obtain the domain name resolution result with expired TTL stored in the local cache.
[0076] S374: Delete the target expired domain name results in the domain name resolution results with expired TTL from the local cache. The target expired domain name results include domain name resolution results whose call counts within a preset historical time period are less than a threshold.
[0077] In this embodiment, the TTL expiration time can be set for the storage in the local cache without setting it, or the TTL can be set to a larger value. However, if the remaining storage space of the local cache is limited, as the local cache stores more and more data, the remaining storage space will become insufficient. In this case, the corresponding cached data in the local cache needs to be deleted to make room for subsequent caches.
[0078] Therefore, the embodiment can set a TTL for the local cache data. When the remaining storage space of the local cache is less than the storage threshold, the domain name resolution results with expired TTL stored in the local cache are obtained. These resolution results obtained with TTL indicate that they have been cached for a long time and have not been updated. By detecting the domain name resolution results with a call count less than the threshold within a preset historical time period, it is possible to determine the resolution results that have not been used too many times in the past period of time. Relatively speaking, these resolution results are not very important and can be deleted to increase the remaining space in the local cache and provide space for new cache. The preset historical time period can be the past 24 hours, etc., and can be set as needed.
[0079] In the case of dividing each functional module into corresponding functional modules, an embodiment of the present disclosure provides a domain name resolution device for a content distribution network. The domain name resolution device for a content distribution network can be a server or a chip applied to a server. Figure 4 is a schematic block diagram of the functional modules of the domain name resolution device for a content distribution network provided by an exemplary embodiment of the present disclosure. As shown in Figure 4, the domain name resolution device for a content distribution network includes:
[0080] A DNS request receiving module 10 is configured to receive a first DNS request sent by a sender, wherein the first DNS request carries a target domain name to be resolved and an IP address of a client;
[0081] The alias record acquisition module 20 is used to acquire the alias CNAME record of the target domain name when the resolution result of the target domain name does not exist in the local cache;
[0082] A DNS request sending module 30 is configured to send a second DNS request including the CNAME record and the IP address of the client to a public DNS server;
[0083] A resolution result acquisition module 40 is configured to receive an A record corresponding to the CNAME record sent by the public DNS server, and use the A record as a resolution result of the target domain name;
[0084] The first analysis result sending module 50 is configured to send the analysis result to the sender; the analysis result and the IP address of the client have the same type of home line.
[0085] In another embodiment provided by the present disclosure, the apparatus further includes:
[0086] A category acquisition module, configured to acquire a target category of the line to which the client IP address belongs;
[0087] The resolution result saving module is used to save the resolution result of the target domain name into the local cache based on the target category.
[0088] In another embodiment provided by the present disclosure, the apparatus further includes:
[0089] A resolution result judgment module, configured to, if a resolution result of the target domain name exists in a local cache, judge whether there is a target resolution result in the resolution result, and the resolution result of the target domain name has a home line of the same category as the IP address of the client;
[0090] The second parsing result sending module is used to send the target parsing result to the sender when the target parsing result exists.
[0091] In another embodiment provided by the present disclosure, the apparatus further includes:
[0092] A TTL expiration judgment module is used to judge whether the TTL value of the resolution result of the target domain name has expired when the resolution result of the target domain name exists in the local cache;
[0093] a third resolution result sending module, configured to send the resolution result of the target domain name to the sender when the TTL of the resolution result of the target domain name expires;
[0094] The updating module is used to update the parsing results whose TTL has expired in the local cache.
[0095] In another embodiment provided by the present disclosure, it is specifically used for:
[0096] Sending a third DNS request to the public DNS server, where the third DNS request includes a CNAME record of the target domain name and the IP address of the client;
[0097] Receive the A record of the CNAME record sent by the DNS server, and replace the resolution result of the target domain name with expired TTL in the local cache with the A record of the CNAME record.
[0098] In another embodiment provided by the present disclosure, the apparatus further includes:
[0099] A storage space detection module, configured to detect whether the remaining storage space of the local cache is less than a threshold;
[0100] An expired resolution result acquisition module, configured to acquire a domain name resolution result with an expired TTL stored in the local cache when the remaining storage space of the local cache is less than a storage threshold;
[0101] The deleting module is used to delete the target expired domain name results in the domain name resolution results with expired TTL from the local cache, wherein the target expired domain name results include domain name resolution results whose call times within a preset historical time period are less than a time threshold.
[0102] Since the device corresponds to the above method embodiment, it will not be described in detail here. Please refer to the description of the method and the above embodiment for details.
[0103] In the domain name resolution device for a content distribution network provided by the embodiment of the present disclosure, when the authoritative DNS server receives the first DNS request sent by the sender, if there is no resolution result in the local cache, it will send a second DNS request to the public DNS to receive the resolution result returned by the public DNS server, and return the resolution result to the sender. Since the sender only needs to send a DNS request to the authoritative DNS server once to obtain the resolution result, the query efficiency of the sender's domain name resolution can be greatly improved. Moreover, since the resolution result and the client's IP address have the same category of home line, it can be well applied in scenarios such as CDN, and can well avoid the problem of lag or excessive delay when the user accesses the website due to the different home lines of the resolution result and the client's IP address.
[0104] An embodiment of the present disclosure further provides an electronic device, comprising: at least one processor; a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the above method disclosed in the embodiment of the present disclosure.
[0105] Figure 5 is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure. As shown in Figure 5, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801. The processor 1801 can execute the corresponding steps of the above-mentioned method disclosed in the embodiment of the present disclosure.
[0106] The processor 1801 can also be referred to as a central processing unit (CPU), which can be an integrated circuit chip with signal processing capabilities. Each step in the method disclosed in the embodiments of the present disclosure can be completed by hardware integrated logic circuits in the processor 1801 or by software instructions. The processor 1801 can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present disclosure can be directly implemented as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in the memory 1802, such as a storage medium mature in the art, such as a random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The processor 1801 reads the information in the memory 1802 and, in conjunction with its hardware, completes the steps of the method.
[0107] In addition, when various operations / processes according to the present disclosure are implemented via software and / or firmware, the programs constituting the software can be installed from a storage medium or a network to a computer system having a dedicated hardware structure, such as computer system 1900 shown in FIG6 . When the various programs are installed, the computer system can perform various functions, including those described above. FIG6 is a block diagram of the structure of a computer system provided by an exemplary embodiment of the present disclosure.
[0108] Computer system 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are intended to be examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0109] As shown in FIG6 , computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 into a random access memory (RAM) 1903. Various programs and data required for the operation of computer system 1900 may also be stored in RAM 1903. Computing unit 1901, ROM 1902, and RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to bus 1904.
[0110] Several components within computer system 1900 are connected to I / O interface 1905, including an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. Input unit 1906 can be any type of device capable of inputting information into computer system 1900. Input unit 1906 can receive input numeric or character information and generate key input signals related to user settings and / or function control of an electronic device. Output unit 1907 can be any type of device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 1908 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 1909 allows computer system 1900 to exchange information / data with other devices over a network, such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0111] The computing unit 1901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the above-mentioned methods disclosed in the embodiments of the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1900 via the ROM 1902 and / or the communication unit 1909. In some embodiments, the computing unit 1901 may be configured to perform the above-mentioned methods disclosed in the embodiments of the present disclosure by any other appropriate means (e.g., by means of firmware).
[0112] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the embodiment of the present disclosure.
[0113] The computer-readable storage medium in the embodiments of the present disclosure can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. The above-mentioned computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specifically, the above-mentioned computer-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0114] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0115] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the method disclosed in the embodiments of the present disclosure is implemented.
[0116] In embodiments of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0118] The modules, components, or units described in the embodiments of the present disclosure may be implemented in software or hardware. The names of the modules, components, or units do not necessarily limit the modules, components, or units themselves.
[0119] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, and without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0120] The above descriptions are merely some embodiments of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the present disclosure.
[0121] Although some specific embodiments of the present disclosure have been described in detail by way of examples, those skilled in the art will appreciate that the above examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Those skilled in the art will appreciate that modifications may be made to the above embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A domain name resolution method for a content distribution network, applied to an authoritative domain name system DNS server, the method comprising: Receive a first DNS request sent by a sender, where the first DNS request carries a target domain name to be resolved and an IP address of a client; If the resolution result of the target domain name does not exist in the local cache, obtain an alias CNAME record of the target domain name; Sending a second DNS request including the CNAME record and the IP address of the client to a public DNS server; Receive the A record corresponding to the CNAME record sent by the public DNS server, use the A record as the resolution result of the target domain name, and send the resolution result to the sender; the resolution result and the IP address of the client have the same category of belonging lines.
2. The method according to claim 1, wherein the method further comprises: Obtain the target category of the line to which the client IP address belongs; Based on the target category, the resolution result of the target domain name is saved in the local cache.
3. The method according to claim 1 or 2, wherein the method further comprises: In the case where the resolution result of the target domain name exists in the local cache, determining whether there is a target resolution result in the resolution result, and the resolution result of the target domain name has a home line of the same category as the IP address of the client; When there is a target resolution result, the target resolution result is sent to the sender.
4. The method according to any one of claims 1 to 3, wherein the method further comprises: If the resolution result of the target domain name exists in the local cache, determine whether the TTL value of the resolution result of the target domain name has expired; When the TTL of the resolution result of the target domain name expires, the resolution result of the target domain name is sent to the sender, and the resolution result with expired TTL in the local cache is updated.
5. The method according to claim 4, wherein updating the parsing result with expired TTL in the local cache comprises: Sending a third DNS request to the public DNS server, wherein the third DNS request includes a CNAME record of the target domain name and an IP address of the client; Receive the A record of the CNAME record sent by the DNS server, and replace the resolution result of the target domain name with expired TTL in the local cache with the A record of the CNAME record.
6. The method according to any one of claims 1 to 5, wherein the method further comprises: Detecting whether the remaining storage space of the local cache is less than a threshold; When the remaining storage space of the local cache is less than the storage threshold, obtaining the domain name resolution result whose TTL is expired stored in the local cache; The target expired domain name result in the domain name resolution result with expired TTL is deleted from the local cache, and the target expired domain name result includes the domain name resolution result whose call times within a preset historical time period are less than the time threshold.
7. A domain name resolution device for a content distribution network, wherein the device comprises: A DNS request receiving module, configured to receive a first DNS request sent by a sender, wherein the first DNS request carries a target domain name to be resolved and an IP address of a client; An alias record acquisition module, used for acquiring an alias CNAME record of the target domain name when the resolution result of the target domain name does not exist in the local cache; A DNS request sending module, used for sending a second DNS request including the CNAME record and the IP address of the client to a public DNS server; A resolution result acquisition module, used for receiving the A record corresponding to the CNAME record sent by the public DNS server, and using the A record as the resolution result of the target domain name; The first analysis result sending module is used to send the analysis result to the sender; the analysis result and the IP address of the client have the same category of home line.
8. The device according to claim 7, wherein the device further comprises: A category acquisition module, used to acquire a target category of the line to which the client IP address belongs; The resolution result saving module is used to save the resolution result of the target domain name into the local cache based on the target category.
9. An electronic device, comprising: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 6.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
12. A computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Domain name analysis synchronization method and device
CN106210158A
A method and apparatus for domain name resolution
CN109067936A
A CNAME acceleration method applied to a DNS authoritative server
CN109936632A
DNS request processing method and device, electronic equipment and storage medium
CN115801729A
Domain name resolution method and device for content distribution network, electronic equipment and storage medium
CN116405460A
