A method for implementing DNS support for VPC private domain name resolution
By deploying a DNS proxy and a multi-level DNS cluster in the VPC, and combining the RegionID and domain name configuration files to determine the domain name type, it solves the problem of DNS technology being difficult to support VPC private domain name resolution, achieves cross-regional load balancing and security isolation, and meets the needs of users through domain names. Requirements for accessing services in the cloud.
Patent Information
- Application Number
- CN202211029685.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2042-08-25
AI Technical Summary
Existing DNS technology cannot support private domain name resolution of cloud private network VPCs, cannot meet the needs of users to access cloud services through domain names, and lacks cross-regional load balancing and security isolation capabilities.
By deploying a DNS proxy in the VPC, using OVS to obtain the source IP and VNI, converting it into an IP address, and combining the RegionID and domain name configuration file to determine the requested domain name type, authorized or private domain name resolution can be achieved, using multi-level DNS clustering and load balancing mechanisms. , supports cross-regional resolution and security isolation.
It enables users to access services without memorizing IP addresses, supports cross-regional load balancing, flexibly controls intranet domain names, ensures that private domain names are not queried by the Internet, protects internal business information, and achieves isolation of different tenants.
Smart Images

Figure BDA0003816166170000061
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to a method for implementing DNS support for VPC private domain name resolution. Background Art
[0002] DNS (Domain name resolution) is a service that converts domain names into IP addresses, allowing people to easily access websites through domain names. It is one of the important components of the Internet. At the same time, in the field of public cloud computing, cloud proprietary networks VPC (Virtual Private Cloud) are becoming increasingly popular. Different businesses are deployed in different VPCs, and people are still accustomed to memorizing domain names. Therefore, whether DNS can support VPC private domain name resolution is becoming more and more important. Summary of the invention
[0003] In view of this, the present invention aims to propose a method for implementing DNS support for VPC private domain name resolution, so as to at least solve at least one problem in the background technology.
[0004] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0005] A method for implementing DNS support for VPC private domain name resolution, comprising the following steps:
[0006] S1. The cloud host in the VPC initiates a DNS request to the VIP+53 port of the DNS proxy in the Region.
[0007] S2. Place OVS in front of the DNS proxy. After receiving the DNS request through VIP, OVS obtains the source IP, source port, and VPC VNI, converts the VNI to the IP address of V4, modifies the source address, keeps the source port unchanged, and initiates a request to the RS of a DNS proxy at the back.
[0008] S3. The DNS proxy determines whether the requested domain name is an authorized domain name or a private domain name. If not, it forwards it to the local DNS of the local operator in the Region:
[0009] S4. Deploy multiple DNS clusters in different locations. Each DNS cluster needs to deploy LB. DNS-LB makes a judgment after receiving the request.
[0010] S5, DNS cache makes a judgment after receiving the request;
[0011] S6. After receiving the DNS request, the authoritative DNS converts the ECS into VNI, confirms the tenant based on the RegionID, processes the business based on the tenant's configuration, and responds to the DNS cache;
[0012] S7, after receiving the response, the DNS cache caches it and responds to the DNS proxy, and the DNS proxy also caches the response and responds;
[0013] S8. After the DNS proxy responds, it is forwarded to the client according to the source IP previously recorded by OVS.
[0014] Furthermore, in step S3:
[0015] The method to determine the authorized domain name is to distinguish it directly based on the domainname through the entire zone;
[0016] The method for determining the private domain name is RegionID+VNI+domainname. The configuration file is sent from the management system, and the DNS proxy reads the configuration file for matching and determination.
[0017] If the result is yes, the source IP and RegionID of the request are converted into an IPV6 IP address and put into the ECS field of EDNS. The DNS proxy initiates a recursive query to the DNS cluster.
[0018] Furthermore, in step S4:
[0019] Determine whether there is an ECS field in the request. If yes, pass it through. If no, set it to the request source IP.
[0020] If the requested domain name is an authorized domain name and the source IP address is a public network address, it will be directly forwarded to the authoritative DNS;
[0021] If the source IP is a private IPv6 address, it is forwarded to the DNS cache.
[0022] Further, in step S5:
[0023] Determine whether it is a private domain name. If not, deny service or recurse to the public DNS.
[0024] If yes, continue to request the authoritative DNS.
[0025] Furthermore, an electronic device is disclosed, including a processor and a memory that is communicatively connected to the processor and is used to store executable instructions of the processor, wherein the processor is used to execute a method for implementing DNS support for VPC private domain name resolution.
[0026] Furthermore, a server is disclosed, comprising at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes a method for implementing DNS support for VPC private domain name resolution.
[0027] Furthermore, a computer-readable storage medium is disclosed, storing a computer program, and when the computer program is executed by a processor, a method for implementing DNS support for VPC private domain name resolution is implemented.
[0028] Compared with the prior art, the method for implementing DNS support for VPC private domain name resolution described in the present invention has the following beneficial effects:
[0029] (1) The method for implementing DNS support for VPC private domain name resolution described in the present invention is in line with custom, and users no longer need to remember IP addresses to access services;
[0030] (2) The method for implementing DNS support for VPC private domain name resolution described in the present invention is highly available, facilitates business scheduling through domain names, and can support cross-regional load balancing;
[0031] (3) The method for implementing DNS support for VPC private domain name resolution described in the present invention is flexible and can add or customize intranet domain names without restriction, including domain names that have been registered by others; by using the same domain name in the production system and the non-production system and configuring different resolutions, it is convenient for publishing and managing user services;
[0032] (4) The method for implementing DNS support for VPC private domain name resolution described in the present invention is securely isolated, and the private domain name configuration will not be queried on the Internet, thereby protecting internal business information and internal system architecture. Domain name resolutions of different VPCs communicate through different tunnels, thereby achieving complete isolation between different tenants. DETAILED DESCRIPTION
[0033] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0034] The present invention will be described in detail below with reference to embodiments.
[0035] Currently, there are three common modes of DNS domain name resolution: local DNS, authorized DNS, and global load balancing GSLB:
[0036] 1. Local DNS mode refers to the DNS service closest to the client device, which is automatically assigned or manually configured by the user, including the DNS of each province and operator (Jiangsu Telecom: 218.2.135.1, Tianjin Unicom: 202.99.96.68) or public DNS (114.114.114.114, 8.8.8.8). The local DNS receives the user's DNS query request and recursively forwards the request to the corresponding authorized DNS.
[0037] 2. The authorized DNS mode is for specific domain names. Generally, people will ask what the authoritative DNS of a certain domain name is. Each domain name will specify the corresponding NS record when it is registered, that is, the authorized DNS of the domain name. There are two situations. One is that the domain name merchant is in charge of the management and is responsible for the authoritative resolution of the domain name purchased from him; the other is to build a self-built authorized DNS, in which the domain name owner manages and resolves the domain name and sub-domains at all levels.
[0038] 3. Global load balancing GSLB mode is a special authorized DNS running on the Internet. It is the key to CDN (content distribution network) technology. On the basis of resolving specific IP addresses, it will perform intelligent scheduling according to the IP address of the DNS request source, including distinguishing the customer's geographical location to achieve nearby access and distinguishing ISP operator lines to achieve intra-network access. In addition, it can also ensure the high availability of the resolved service through an additional health check mechanism;
[0039] The present invention is based on the local DNS and authorized DNS modes, draws on the function of GSLB to distinguish the request source IP address, adds the characteristics of transmitting and identifying the VPC identifier, deploys local DNS in the AZ (availability zone) where different VPCs are located, and collects and transmits the Region number and VPC number while converging, forwarding and caching DNS requests. Deploys remote authorized DNS clusters across the country. The DNS cluster can identify the VPC identifier and distinguish the resolution on the basis of realizing ordinary DNS requests, that is, realizes that the resolution results of a domain name in different VPC identifier domains are different, that is, private domain name resolution.
[0040] In order to implement a method in which DNS supports VPC private domain name resolution, the present invention implements functions including source IP identification, tenant identification, cache forwarding, custom lines, load balancing, etc. through software.
[0041] DNS is deployed in cluster mode and is divided into DNS proxy, DNS load, DNS cache and authoritative DNS. Among them, because the tenant identity needs to be transmitted, and the tenant identity is transmitted in the Layer 2 network as VXLAN ID, the DNS proxy needs to be deployed in the AZ availability zone. Since DNS is an application layer protocol, it is necessary to pre-place the openvswitch service to implement the parsing, identification and processing of the Layer 2 message, extract the tenant identity from the Layer 2 message and put it into the ECS (Extended ClientSubnet, the network segment where the customer source IP is located) field of the DNS protocol; DNS load, DNS cache and authoritative DNS are deployed in a three-layer cluster mode, and the remote cluster provides services to the DNS proxy and the public network with multiple NS records such as NS1 and NS2; the client directly requests the DNS proxy, and the DNS proxy forwards the request to the authorized DNS cluster. The authoritative DNS determines the VPC identity based on the content of the ECS and distinguishes the resolution.
[0042] In addition, DNS needs to support caching and load balancing to improve the performance and availability of the cluster. The DNS proxy also has the DNS caching function. The DNS cache needs to be differentiated and cached according to the different ECSs, while ensuring data security and protecting user privacy. The ECS will not accurately identify the client address, but will blur it into a network segment (IPV4 is a 24-bit mask, IPV6 is a 56-bit mask), and design a switch control to configure whether to enable it based on the scenario.
[0043] The business implementation process of this solution is described as follows:
[0044] 1. The cloud host (VM) in the VPC initiates a DNS request (UDP or TCP) to the VIP+53 port of the DNS proxy in the Region;
[0045] 2. Place OVS (openvswitch) in front of the DNS proxy. After receiving the DNS request through VIP, OVS obtains the source IP, source port, and VPC VNI, converts the VNI to the V4 IP address (xx.xx.xx.xx / 24), modifies the source address, keeps the source port unchanged, and initiates a request to the RS of a DNS proxy behind.
[0046] 3. The DNS proxy determines whether the requested domain name is an authorized domain name or a private domain name. If not, it forwards it to the local DNS of the local operator in the Region:
[0047] a) How to determine the authorized domain name: the entire zone is directly distinguished by domainname;
[0048] b) How to determine the private domain name: RegionID+VNI+domainname, the configuration file is issued from the management system, and the DNS proxy reads the configuration file for matching and judgment;
[0049] c) If yes, the source IP and RegionID of the request are converted into an IPV6 IP address and placed in the ECS field of EDNS. The DNS proxy initiates a recursive query to the DNS cluster (which can be accessed through the public network). The IPV6 local address segment FC00:: / 8 uses the first 56 bits for identification, which complies with the privacy specifications of ECS.
[0050]
[0051] 4. Deploy multiple DNS clusters in different locations. Each DNS cluster needs to deploy LB (multiple ns records will be randomly used by local dns). After DNS-LB receives the request
[0052] a) Determine whether there is an ECS field in the request. If yes, pass it through. If no, set it to the request source IP.
[0053] b) If the requested domain name is an authorized domain name and the source IP address is a public network address, it will be directly forwarded to the authoritative DNS;
[0054] c) If the source IP is a private IPv6 address, forward it to the DNS cache
[0055] 5. After the DNS cache receives the request
[0056] a) Determine whether it is a private domain name. If not, deny service or recurse to the public DNS
[0057] b) If yes, continue to request the authoritative DNS
[0058] 6. After receiving the DNS request, the authoritative DNS converts the ECS into a VNI, confirms the tenant based on the RegionID, processes the business based on the tenant's configuration, and responds to the DNS cache.
[0059] 7. After receiving the response, the DNS cache caches it and responds to the DNS proxy. The DNS proxy also caches the response and responds.
[0060] 8. After the DNS proxy responds, it forwards it to the client based on the source IP previously recorded by OVS
[0061] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0062] In the several embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of the units described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above-mentioned units may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
[0064] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for implementing DNS support for VPC private domain name resolution, characterized in that: The following steps are involved: S1. The cloud host in the VPC initiates a DNS request to the VIP+53 port of the DNS proxy in the region. S2: Place OVS in front of the DNS proxy. After receiving the DNS request via VIP, OVS obtains the source IP, source port, and VPC VNI, converts the VNI to a V4 IP address, modifies the source address, keeps the source port unchanged, and initiates a request to the RS of a DNS proxy in the back. S3. The DNS proxy determines whether the requested domain name is an authorized domain name or a private domain name. If not, it forwards the request to the local DNS of the region's local operator: S4. Deploy multiple DNS clusters remotely. Each DNS cluster needs to deploy a LB. DNS-LB makes a judgment after receiving the request. S5. DNS cache makes a judgment after receiving the request; S6. After receiving the DNS request, the authoritative DNS converts the ECS into a VNI, identifies the tenant based on the RegionID, processes the service based on the tenant's configuration, and responds to the DNS cache. S7: After receiving the response, the DNS cache caches it and sends a response to the DNS proxy. The DNS proxy also caches the response and sends a response. S8: After the DNS proxy responds, it forwards the response to the client based on the source IP address previously recorded by OVS. In step S3: The method for determining the authorized domain name is to distinguish directly based on the domain name through the entire zone; The method for determining private domain names is RegionID+VNI+domainname. The configuration file is issued from the management system, and the DNS proxy reads the configuration file for matching and judgment. If the result is yes, the source IP address and RegionID of the request are converted to an IPV6 IP address and placed in the ECS field of EDNS. The DNS proxy then initiates a recursive query to the DNS cluster. In step S4: Determine whether the ECS field is in the request. If so, pass it through. If not, set it as the request source IP. If the requested domain name is an authorized domain name and the source IP address is a public network address, it will be forwarded directly to the authoritative DNS; If the source IP address is a private IPv6 address, it is forwarded to the DNS cache; In step S5: Determine whether it is a private domain name. If not, deny service or recurse to the public DNS. If yes, continue to request the authoritative DNS.
2. An electronic device comprising a processor and a memory in communication with the processor and configured to store instructions executable by the processor, wherein: The processor is used to execute the method of implementing DNS support for VPC private domain name resolution as described in claim 1 above.
3. A server, characterized in that: The system includes at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to enable the at least one processor to perform a method for implementing DNS support for VPC private domain name resolution as described in claim 1.
4. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for implementing DNS support for VPC private domain name resolution as described in claim 1 is implemented.
