Domain name resolution method and device and electronic equipment

By binding the LAN and WAN interfaces, combined with process instances, the target domain name server is directly determined for domain name resolution, solving the problem of the long time-consuming multi-WAN interface gateway, and achieving fast and secure domain name resolution services.

CN120475012APending Publication Date: 2025-08-12TP-LINK INT CHENGDU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510882680.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The gateway of the multi-will area network interface traverses different domain name servers in turn during the domain name resolution process, resulting in a long time, and is unable to effectively support differentiated domain name resolution and improve security.

Method used

By binding the LAN interface and the WAN interface, the target WAN interface is determined, and the domain name resolution is performed through the domain name server corresponding to the interface, and the binding relationship of the process instance is combined to achieve rapid domain name resolution.

Benefits of technology

It shortens the domain name resolution time, improves the security and differentiated service capabilities of domain name resolution, and meets the access needs of different terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120475012A_ABST
    Figure CN120475012A_ABST
Patent Text Reader

Abstract

The invention discloses a domain name resolution method and device and electronic equipment. The method comprises the steps that a website access request of a target terminal is received, and the website access request comprises a target domain name of a target website; determining a target wide area network interface based on a target local area network interface receiving the website access request and a binding relationship between the local area network interface and the wide area network interface; and analyzing the target domain name through a target domain name server corresponding to the target wide area network interface to obtain a domain name analysis result. According to the method and the device, the technical problem that in the prior art, a gateway of multiple wide area network interfaces sequentially traverses different domain name servers according to domain names until corresponding website IP addresses are obtained, and time consumption is long is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of the Internet, and in particular to a domain name resolution method, device and electronic device. Background Art

[0002] The Domain Name System (DNS) is a network service of the Internet that provides a distributed database that maps domain names and Internet Protocol addresses (IP addresses) to each other. Terminals can access websites through domain names. When accessing, the terminal enters the domain name of the website to be visited. The gateway obtains the corresponding website IP address from the local cache or domain name server based on the domain name and sends the IP address to the user terminal. When the gateway has multiple wide area network interfaces (WAN ports), each WAN port can correspond to a different domain name server. However, when the terminal enters the domain name of the website to be visited, the gateway with multiple WAN ports will traverse different domain name servers in turn according to the domain name until the corresponding website IP address is obtained, which takes a long time.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0004] The embodiments of the present invention provide a domain name resolution method, device and electronic device to at least solve the technical problem in the related art that a gateway with multiple wide area network interfaces sequentially traverses different domain name servers according to the domain name until the corresponding website IP address is obtained, which takes a long time.

[0005] According to one aspect of an embodiment of the present invention, a domain name resolution method is provided, comprising: receiving a website access request from a target terminal, wherein the website access request includes a target domain name of a target website; determining a target wide area network interface based on a target local area network interface receiving the website access request and a binding relationship between a local area network interface and a wide area network interface; and resolving the target domain name through a target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result.

[0006] Optionally, the binding relationship includes: binding between the local area network interface, the wide area network interface, and a process instance for processing the website access request.

[0007] Optionally, the target domain name is resolved through the target domain name server corresponding to the target WAN interface to obtain a domain name resolution result, including: forwarding the website access request to the target domain name server based on the target LAN interface and the target process instance corresponding to the target WAN interface; receiving a website access response returned by the target domain name server, wherein the website access response includes the domain name resolution result; and forwarding the website access response to the target terminal based on the target process instance.

[0008] Optionally, the target process instance corresponding to the target LAN interface and the target WAN interface forwards the website access request to the target domain name server, including: based on the target process instance, replacing the destination Internet Protocol IP address of the website access request from the IP address of the target LAN interface to the IP address of the target domain name server, and replacing the source IP address of the website access request from the IP address of the target terminal to the IP address of the target WAN interface to obtain a replaced website access request; and forwarding the replaced website access request to the target domain name server.

[0009] Optionally, forwarding the website access response to the target terminal based on the target process instance includes: based on the target process instance, replacing the destination IP address of the website access response from the IP address of the target wide area network interface to the IP address of the target terminal, and replacing the source IP address of the website access response from the IP address of the target domain name server to the IP address of the target local area network interface to obtain a replaced website access response; and forwarding the replaced website access response to the target terminal.

[0010] Optionally, the method further includes: allocating a domain name cache to each of the process instances, wherein the domain name cache is used to store the domain name of the resolved website of the corresponding process instance and the corresponding domain name resolution result.

[0011] Optionally, the target LAN interface and the target WAN interface belong to a target gateway, the target gateway includes multiple WAN interfaces, and the multiple WAN interfaces respectively correspond to one or more domain name servers.

[0012] According to another aspect of the present invention, a domain name resolution device is provided, comprising: a receiving module for receiving a website access request from a target terminal, wherein the website access request includes a target domain name of a target website; a determining module for determining a target wide area network interface based on a target local area network interface for receiving the website access request and a binding relationship between a local area network interface and a wide area network interface; and a resolving module for resolving the target domain name through a target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result.

[0013] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the domain name resolution methods described above.

[0014] According to another aspect of the present invention, an electronic device is provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes any one of the above-mentioned domain name resolution methods when running.

[0015] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of any one of the domain name resolution methods.

[0016] In an embodiment of the present invention, a method of binding a LAN interface and a WAN interface is adopted to receive a website access request from a target terminal, wherein the website access request includes a target domain name of a target website; based on the target LAN interface for receiving the website access request and the binding relationship between the LAN interface and the WAN interface, the target WAN interface is determined; the target domain name is resolved by a target domain name server corresponding to the target WAN interface to obtain a domain name resolution result. Since the LAN interface and the WAN interface are bound, the website access request from a certain LAN interface will be processed by the domain name server of the corresponding WAN interface, thereby achieving the purpose of using the corresponding specific domain name server to perform domain name resolution for the website access request received by a specific LAN interface, thereby avoiding traversing all domain name servers and achieving the technical effect of shortening the domain name resolution time, thereby solving the technical problem in the related art that a gateway with multiple WAN interfaces traverses different domain name servers in sequence according to the domain name until the corresponding website IP address is obtained, which takes a long time. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0018] Figure 1 This is a schematic diagram of a basic network for enterprise intranet users to access the extranet based on relevant technologies;

[0019] Figure 2 is a flow chart of a domain name resolution method according to an embodiment of the present invention;

[0020] Figure 3 This is a schematic diagram of the basic networking of a method for implementing multiple DNS instances in a VPP high-performance network according to an optional embodiment of the present invention;

[0021] Figure 4 It is a structural block diagram of a domain name resolution device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0023] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0025] An Internet Protocol Address (IP address) is a unique numerical identifier assigned to every network device connected to the Internet or a local area network. The IP address enables network devices to communicate within an Internet Protocol-based network. It is responsible for routing and addressing data packets within the network, ensuring that data is correctly sent from the source device to the destination device.

[0026] A domain name is a hierarchical string of characters used to identify a specific computer or network system on the Internet. This allows users to access network resources through an easy-to-remember string of characters, rather than having to remember complex numeric IP addresses. A domain name typically consists of multiple parts, separated by dots. For example, in the domain name www.example.com, com is the top-level domain (TLD), example is the second-level domain, and www is often referred to as a subdomain.

[0027] The Domain Name System (DNS) is an Internet service that provides a distributed database that maps domain names to IP addresses, translating human-readable domain names (such as www.example.com) into computer-readable IP addresses (such as 192.0.2.1). DNS allows users to access websites and other Internet resources using easy-to-remember domain names, eliminating the need to memorize complex IP addresses. DNS is a distributed database system based on a client-server model, consisting of a global network of DNS servers responsible for maintaining domain name-to-IP address mappings and responding to client queries.

[0028] Domain Name Server (DNS server) is a key component of the domain name system. It stores the mapping information of website domain names to IP addresses, and can respond to query requests from user terminals and provide domain name resolution services.

[0029] A Wide Area Network Port (WAN port) is a physical or logical interface used to connect to a wide area network (WAN). In contrast, a Local Area Network Port (LAN port) is also a physical or logical interface used to connect to a local area network (LAN). User terminals access the Internet through a gateway, where a route is available between the gateway and the Internet. The gateway's LAN port connects to LAN user terminals, while the WAN port connects to WAN servers, enabling communication between user terminals and the Internet. The gateway's LAN port and WAN port each correspond to different IP addresses.

[0030] Vector Packet Processing (VPP) is a high-performance TCP / IP protocol stack that focuses on providing high-performance packet processing capabilities. It focuses on L2 (link layer) / L3 (network layer) forwarding, including network functions such as Bridge Domain (BD), Access Control List (ACL), Network Address Translation (NAT), and Ethernet Point-to-Point Protocol over Ethernet (PPPOE) dial-up. VPP is based on instruction-level and scheduling-level batch processing mechanisms, combined with user-level IO technology, to achieve line-speed forwarding of network packets using general-purpose servers. At the same time, through the VPP tap port, it can communicate with the kernel-level Ethernet interface to achieve Ethernet message forwarding from VPP to kernel-level. Through the VPP tun port, VPP is allowed to directly process IP-level packets, enabling IP message forwarding from VPP to kernel-level.

[0031] Proxy DNS Daemon (pdnsd for short) is an open source DNS proxy daemon that avoids repeated queries to remote DNS servers by caching DNS query results locally, thereby reducing network latency and load. It supports multiple modes, including cache mode and proxy mode. In cache mode, it only caches DNS query results, while in proxy mode, pdnsd can forward DNS queries to multiple DNS servers, select the server with the fastest response, and then cache the results. The pdnsd process usually runs as a daemon in the system, listening for DNS query requests. pdnsd can run on multiple network interfaces, and multiple DNS servers can be configured as backends to provide redundancy and load balancing. In addition, pdnsd also supports verifying the authenticity of DNS responses, which increases security.

[0032] Figure 1 This is a schematic diagram of a basic network for enterprise intranet users to access the external network based on relevant technologies, such as Figure 1 As shown in the figure, when an intranet user wishes to access a website using a domain name, the intranet user can use the gateway as a DNS proxy to request domain name resolution services from the domain name server. The specific process for an intranet user to access a website using a domain name (e.g., learner.com) is as follows:

[0033] S1, enterprise intranet users (e.g. Figure 1Host A) first sends a domain name request (DNS request) to the gateway, requesting the IP address corresponding to learner.com.

[0034] It should be noted that the enterprise intranet users are located on the LAN side of the gateway and communicate with the gateway through the LAN port of the gateway. The IP address of the LAN port of the gateway is 172.16.10.1, and the IP address of the WAN port of the gateway is 10.1.1.2.

[0035] S2: After receiving the DNS request message from the intranet user, the gateway searches the local DNS cache to see if there is a cache entry for the IP address corresponding to learner.com.

[0036] If it exists, the gateway directly encapsulates the IP address corresponding to learner.com (10.3.1.2) into the domain name response (DNS reply) message and returns it to the enterprise intranet user, so that the enterprise intranet user can access the services provided by the domain name learner.com through the IP address corresponding to learner.com (10.3.1.2), and the DNS lookup process ends.

[0037] If it does not exist, the gateway requests the IP address corresponding to learner.com from the IP address (10.2.1.2) of the domain name server configured on the WAN port of the gateway, and executes step S3.

[0038] S3: After receiving the DNS request message from the gateway, the domain name server returns the IP address (10.3.1.2) corresponding to learner.com to the gateway. The gateway caches the correspondence between the domain name learner.com and the IP address (10.3.1.2), and encapsulates the domain name learner.com and the IP address (10.3.1.2) into a DNS reply message and returns it to the enterprise intranet user.

[0039] S4: The intranet user receives the DNS reply message from the gateway and resolves it to obtain the correspondence between learner.com and the IP address (10.3.1.2). The intranet user then accesses the services provided by the domain name learner.com through the address 10.3.1.2.

[0040] With the development of gateways, there are more and more gateways with multiple WAN ports. In related technologies, each WAN port stores the website domain name and IP address that has been resolved by this interface in the same folder ( / etc / resolv.conf), and also stores the IP address of the domain name server configured for this interface in the same folder ( / etc / resolv.conf). After the gateway receives the DNS request sent by the user terminal, it will first traverse the website domain name and IP address that has been resolved by each WAN port in / etc / resolv.conf. If it cannot find it, it will traverse the IP address of the domain name server configured for each WAN port in / etc / resolv.conf, and send DNS requests to the IP address of the domain name server configured for each WAN port in turn until the IP address corresponding to the website domain name is obtained and returned to the user terminal.

[0041] However, the related technology has the following problems: DNS requests are sent to the IP addresses of the domain name servers configured for each WAN port in sequence until the IP address corresponding to the website domain name is obtained, which takes a long time; although each WAN port can be configured with a different domain name server, the IP addresses of all domain name servers are stored in the same folder ( / etc / resolv.conf), which cannot support the function of differentiated domain name resolution for different WAN ports.

[0042] In view of this, according to an embodiment of the present invention, an embodiment of a domain name resolution method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0043] Figure 2 Flowchart of a domain name resolution method according to an embodiment of the present invention. Figure 2 As shown, the method includes the following steps:

[0044] Step S102: receiving a website access request from a target terminal, wherein the website access request includes a target domain name of a target website.

[0045] As an optional embodiment, the execution subject of the method of this embodiment can be a gateway that provides network services to the target terminal, or a domain name proxy server that provides domain name resolution services to the target terminal. Among them, the gateway can also serve as a domain name proxy server to provide domain name resolution services to the target terminal.

[0046] As an optional embodiment, the website access request of the target terminal is used to access the target website, wherein the website access request includes the target domain name of the target website. To access the target website, it is necessary to perform domain name resolution on the target domain name to obtain the IP address corresponding to the target website.

[0047] Step S104: determining a target WAN interface based on the target LAN interface for receiving the website access request and the binding relationship between the LAN interface and the WAN interface.

[0048] As an optional embodiment, when a device receiving a website access request has multiple LAN interfaces and / or multiple WAN interfaces, the binding relationship between the LAN interface and the WAN interface allows a website access request received by a specific LAN interface to be processed using a specific WAN interface, thereby avoiding the time-consuming process of traversing through the WAN interfaces for processing, regardless of which LAN interface the website access request is received from, until a WAN interface capable of processing the website access request is found. In addition, the binding relationship between the LAN interface and the WAN interface allows isolation between different LAN interfaces and different WAN interfaces, which not only speeds up the processing of website access requests but also provides different domain name resolution services for the specific LAN interface and the specific WAN interface with which the binding relationship exists. For example, when the gateway is configured with three LAN interfaces (LAN1, LAN2, LAN3) and three WAN interfaces (WAN1, WAN2, WAN3), and each WAN interface is connected to a different domain name server (domain name server 1, domain name server 2, domain name server 3), through the binding of LAN1 and WAN1, LAN2 and WAN2, and LAN3 and WAN3, when a website access request is received through LAN1, it can be directly determined that the website access request is forwarded to domain name server 1 through WAN1 for domain name resolution, without involving other LAN interfaces, WAN interfaces and domain name servers.

[0049] As an optional embodiment, the binding relationship between the LAN interface and the WAN interface can be implemented in various ways. For example, it can be implemented through a table lookup, where the table includes the binding relationship between the LAN interface and the WAN interface. In another example, it can be implemented by binding the LAN interface, the WAN interface, and the process instance used to process website access requests. That is, the binding relationship can include the binding between the LAN interface, the WAN interface, and the process instance used to process website access requests. Compared to the table lookup method, the binding method of the LAN interface, the WAN interface, and the process instance used to process website access requests can achieve more thorough isolation by allocating running resources and storage space to the process instance, thus isolating the overall processing flow of website access requests. By binding the LAN interface, the WAN interface, and the process instance used to process website access requests, not only can the overall processing flow of website access requests be further differentiated, providing different domain name resolution and domain name services for different terminals to meet security and differentiated access requirements, but it can also support each process instance to independently process website access requests, avoiding delays or bottlenecks caused by a single process processing a large number of requests.

[0050] Step S106: Resolve the target domain name through the target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result.

[0051] As an optional embodiment, resolving the target domain name through the target domain name server corresponding to the target WAN interface can avoid traversing different domain name servers corresponding to different WAN interfaces, thereby quickly obtaining a domain name resolution result. The domain name servers corresponding to different WAN interfaces can be the same or different. The target domain name server can be specified or modified based on actual conditions, thereby returning the IP address corresponding to the target domain name within the permitted access range, and returning a resolution result indicating a resolution failure outside the permitted access range, thereby denying the target terminal access to websites outside of its authorized scope.

[0052] As an optional embodiment, when resolving the target domain name through the target domain name server corresponding to the target WAN interface to obtain the domain name resolution result, various methods can be used. For example, in the case where the binding relationship includes the binding between the LAN interface, the WAN interface, and the process instance for processing the website access request, the website access request can be forwarded to the target domain name server based on the target process instance corresponding to the target LAN interface and the target WAN interface; a website access response returned by the target domain name server is received, wherein the website access response includes the domain name resolution result; and the website access response is forwarded to the target terminal based on the target process instance. Since there is a binding relationship between the LAN interface, the WAN interface, and the process instance for processing website access requests, the target process instance can be determined based on the target LAN interface and the target WAN interface. The target process instance can be used to process the website access request, send the website access request sent by the target terminal to the target domain name server after processing, and send the website access response obtained by the target domain name server to the target terminal after processing. Compared with the gateway traversing the domain name servers corresponding to multiple WAN interfaces in sequence, the gateway and the target terminal can quickly obtain the domain name resolution result, and can also enhance the security and differentiation of the domain name resolution, and ensure the privacy of the target terminal.

[0053] As an optional embodiment, when forwarding a website access request to a target domain name server based on a target process instance corresponding to a target LAN interface and a target WAN interface, a variety of methods can be used. For example, based on the target process instance, the destination Internet Protocol IP address of the website access request can be replaced from the IP address of the target LAN interface to the IP address of the target domain name server, and the source IP address of the website access request can be replaced from the IP address of the target terminal to the IP address of the target WAN interface to obtain a replaced website access request; and the replaced website access request is forwarded to the target domain name server. By replacing the destination IP address and source IP address of the website access request based on the target process instance, the website access request originally sent from the target terminal to the target LAN interface can be processed into a website access request sent from the target WAN interface to the target domain name server, thereby sending the replaced website access request directly from the target WAN interface to the target domain name server, speeding up the sending speed to the target domain name server, and thus improving the response speed of domain name resolution.

[0054] As an optional embodiment, when forwarding a website access response to a target terminal based on a target process instance, a variety of methods can be used. For example, based on the target process instance, the destination IP address of the website access response can be replaced from the IP address of the target WAN interface to the IP address of the target terminal, and the source IP address of the website access response can be replaced from the IP address of the target domain name server to the IP address of the target LAN interface to obtain a replaced website access response; and the replaced website access response is forwarded to the target terminal. By replacing the destination IP address and source IP address of the website access response based on the target process instance, the website access response originally sent from the target domain name server to the target WAN interface can be processed into a website access response sent from the target LAN interface to the target terminal, thereby directly sending the replaced website access response from the target LAN interface to the target terminal, speeding up the sending speed to the target terminal, and thus improving the response speed of domain name resolution.

[0055] As an optional embodiment, in the case where the binding relationship includes the binding between the LAN interface, the WAN interface, and the process instance for processing the website access request, a domain name cache can also be allocated to each process instance, and the domain name cache is used to store the domain name of the resolved website of the corresponding process instance and the corresponding domain name resolution result. By allocating domain name caches to each process instance, and the domain name cache is used to store the domain name of the resolved website of the corresponding process instance and the corresponding domain name resolution result, after receiving the website access request again, the target domain name and the corresponding domain name resolution result can be first searched in the domain name cache allocated by the target process instance to see if they already exist. If they already exist, the domain name resolution result can be directly returned. If not, the domain name resolution result can be obtained based on the target domain name server. This avoids repeatedly initiating multiple requests to the target domain name server for the same target domain name, which can not only reduce the load on the target domain name server, but also significantly shorten the response time to the target terminal.

[0056] As an optional embodiment, the target LAN interface and the target WAN interface can belong to the target gateway, and the target gateway can include multiple WAN interfaces, and the multiple WAN interfaces can correspond to one or more domain name servers respectively. Among them, the target LAN interface can be used to connect to the terminal device of the intranet. When the terminal device of the intranet attempts to access the Internet resource through the domain name, the website access request first reaches the gateway through the target LAN interface. The target WAN interface can be the connection point between the gateway and the external network (such as the Internet). The processed website access request can be directly sent to the target domain name server through the target WAN interface, or the domain name cache of the target process instance corresponding to the target WAN interface can be searched first. If the domain name resolution result of the target domain name is not stored in the domain name cache, it is sent to the target domain name server through the target WAN interface. The target gateway can manage multiple WAN interfaces at the same time and can select the corresponding WAN interface to process the website access request according to different business needs or network conditions. Each WAN interface can be bound to one or more domain name servers to provide differentiated domain name resolution services for each WAN interface. Especially for highly sensitive domain name queries, a more secure WAN interface can be selected, which has fewer bound DNS servers. By binding the target LAN interface to the target WAN interface, the domain name resolution path can be optimized and differentiated domain name resolution can be provided. This capability is particularly important for gateways with multiple WAN interfaces, as it fully utilizes the hardware potential to provide efficient, secure, and intelligent domain name resolution and network connection services.

[0057] By adopting a method of binding a LAN interface and a WAN interface, a website access request of a target terminal is received, wherein the website access request includes a target domain name of a target website; based on the target LAN interface for receiving the website access request and the binding relationship between the LAN interface and the WAN interface, a target WAN interface is determined; the target domain name is resolved through a target domain name server corresponding to the target WAN interface to obtain a domain name resolution result, thereby achieving the purpose of using a corresponding domain name server for domain name resolution, thereby realizing the technical effect of shortening the domain name resolution time, and further solving the technical problem in the related art that a gateway with multiple WAN interfaces sequentially traverses different domain name servers according to the domain name until the corresponding website IP address is obtained, which takes a long time.

[0058] In combination with the above embodiment and optional embodiment, an optional implementation is provided. In this optional implementation, a method for implementing multiple DNS instances in a VPP high-performance network is proposed, which binds the gateway LAN port IP, the gateway WAN port IP, and the pdnsd instance. When the gateway LAN port receives a DNS request message sent by a terminal, the pdnsd process matches the pdnsd instance based on the destination IP address of the message. The gateway then sends the DNS request to the DNS server corresponding to the WAN port IP bound to the pdnsd instance, requesting domain name resolution. Figure 3 : is a schematic diagram of a basic networking method for implementing multiple DNS instances in a VPP high-performance network according to an optional embodiment of the present invention, such as Figure 3 As shown in the figure, the tap0 port on the VPP and the kernel host-tap0 port exchange Ethernet packets. pppox0 and pppox1 are tunnel ports created for PPPoE dial-up, configured with the public IP addresses obtained through PPPoE dial-up. pppox0 and tun-wan1, and pppox1 and tun-wan2, exchange IP packets. This method includes the following steps.

[0059] S1, the enterprise intranet user sends a DNS request to the gateway IP address on the LAN side of the gateway.

[0060] In step S2, after the LAN-side gateway interface on the VPP receives the DNS request, the VPP determines that the message type is a local DNS message and sends the request to the kernel through the tap port.

[0061] In step S3, the user-mode pdnsd instance binds to the kernel-mode Virtual Routing and Forwarding (VRF), the LAN IP address, and the WAN IP address. This is equivalent to the binding between the aforementioned LAN interface, WAN interface, and the process instance used to handle website access requests. When the kernel-mode receives a message from the LAN side (the VLAN subinterface of host-tap0), the user-mode pdnsd instance receives and processes the DNS message.

[0062] The processing flow of the pdnsd instance is as follows: According to the destination IP address of the received DNS message (i.e., the LAN-side gateway IP address), the corresponding pdnsd instance is matched, the source IP address of the DNS message (i.e., the enterprise intranet user IP address) is replaced with the tun-wan port address (synchronized with the WAN-side gateway IP address on the VPP), and the destination IP address is replaced with the DNS server IP address bound to the pdnsd instance. The replaced DNS message is sent to the VPP via the tun-wan port, and then forwarded by the VPP to the DNS server on the Internet.

[0063] S4: The DNS server returns the DNS resolution request to the gateway. The VPP receives the domain name and IP address mapping resolved by the Internet DNS server and sends it to the kernel state through the VPP's tun port connected to the kernel state.

[0064] S5: The user-mode pdnsd instance processes the domain name resolution reply message.

[0065] After receiving the DNS Reply message, the user-state pdnsd process matches the corresponding pdnsd instance based on the message's destination IP address (i.e., the WAN-side gateway IP address). It then translates the message's source IP address (i.e., the DNS server IP address) into the LAN-side gateway IP address and the destination IP address into the intranet user's terminal IP address. The replaced DNS Reply message is then sent to the kernel state, which, through VPP, returns the DNS Reply message to the intranet user. The intranet user then parses the DNS Reply message to obtain the IP address corresponding to the domain name.

[0066] S6: If the pdnsd process is running in proxy mode, the pdnsd process caches the correspondence between the resolved domain name and IP address in the DNS cache list of the corresponding pdnsd instance. When a DNS request is subsequently received from the terminal, the DNS cache list of the corresponding pdnsd instance will be queried first.

[0067] By binding the gateway's LAN and WAN IP addresses to a pdnsd instance, you can reduce the number of DNS servers queried and optimize query time. With two DNS servers corresponding to each WAN port, the maximum number of DNS servers queried is reduced from 2 * the number of WAN ports to precisely 2. By binding the gateway's LAN and WAN IP addresses to a pdnsd instance, you can also obtain the IP address corresponding to a domain name from a specified DNS server, providing differentiated domain name resolution services for different types of user terminals.

[0068] According to an embodiment of the present invention, a domain name resolution device is provided. Figure 4 is a structural block diagram of a domain name resolution device according to an embodiment of the present invention. Figure 4 As shown, the device includes: a receiving module 402, a determining module 404 and a parsing module 406. The device is described below.

[0069] A receiving module 402 is configured to receive a website access request from a target terminal, wherein the website access request includes a target domain name of a target website; a determining module 404 is connected to the receiving module 402 and configured to determine a target wide area network interface based on the target local area network interface receiving the website access request and a binding relationship between the local area network interface and the wide area network interface; a resolving module 406 is connected to the determining module 404 and configured to resolve the target domain name through a target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result.

[0070] It should be noted here that the above-mentioned receiving module 402, determination module 404 and analysis module 406 correspond to steps S202 to S206 in the embodiment, and the instances and application scenarios implemented by multiple modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment.

[0071] As an optional embodiment, the above binding relationship includes: binding between a local area network interface, a wide area network interface, and a process instance for processing website access requests.

[0072] As an optional embodiment, the resolution module 406 includes: a first forwarding unit, a receiving unit, and a second forwarding unit. The first forwarding unit is configured to forward the website access request to a target domain name server based on the target process instance corresponding to the target LAN interface and the target WAN interface; the receiving unit is connected to the first forwarding unit and is configured to receive a website access response returned by the target domain name server, wherein the website access response includes a domain name resolution result; and the second forwarding unit is connected to the receiving unit and is configured to forward the website access response to a target terminal based on the target process instance.

[0073] As an optional embodiment, the first forwarding unit includes: a first replacement subunit and a first forwarding subunit. The first replacement subunit is configured to, based on the target process instance, replace the destination Internet Protocol IP address of the website access request from the IP address of the target local area network interface to the IP address of the target domain name server, and replace the source IP address of the website access request from the IP address of the target terminal to the IP address of the target wide area network interface, thereby obtaining a replaced website access request; and the first forwarding subunit is connected to the first replacement subunit and is configured to forward the replaced website access request to the target domain name server.

[0074] As an optional embodiment, the second forwarding unit includes: a second replacement subunit and a second forwarding subunit. The second replacement subunit is configured to, based on the target process instance, replace the destination IP address of the website access response from the IP address of the target wide area network interface to the IP address of the target terminal, and replace the source IP address of the website access response from the IP address of the target domain name server to the IP address of the target local area network interface, thereby obtaining a replaced website access response; and the second forwarding subunit is connected to the second replacement subunit and is configured to forward the replaced website access response to the target terminal.

[0075] As an optional embodiment, the apparatus further includes a cache module configured to allocate a domain name cache to each process instance, wherein the domain name cache is configured to store the resolved website domain name of the corresponding process instance and the corresponding domain name resolution result.

[0076] As an optional embodiment, the target LAN interface and the target WAN interface belong to a target gateway, and the target gateway includes multiple WAN interfaces, and the multiple WAN interfaces correspond to one or more domain name servers respectively.

[0077] According to an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the domain name resolution methods described above.

[0078] According to an embodiment of the present invention, an electronic device is provided, comprising: a memory storing an executable program; and a processor configured to run the program, wherein the program executes any one of the above-mentioned domain name resolution methods when running.

[0079] According to an embodiment of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above methods are implemented.

[0080] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0081] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0082] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0083] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0084] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0086] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A domain name resolution method, characterized in that: include: receiving a website access request from a target terminal, wherein the website access request includes a target domain name of a target website; Determining a target WAN interface based on the target LAN interface for receiving the website access request and a binding relationship between the LAN interface and the WAN interface; The target domain name is resolved through the target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result.

2. The method according to claim 1, characterized in that The binding relationship includes: binding among the local area network interface, the wide area network interface, and a process instance for processing the website access request.

3. The method according to claim 2, characterized in that The step of resolving the target domain name through the target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result includes: forwarding the website access request to the target domain name server based on the target process instance corresponding to the target local area network interface and the target wide area network interface; receiving a website access response returned by the target domain name server, wherein the website access response includes the domain name resolution result; Based on the target process instance, the website access response is forwarded to the target terminal.

4. The method according to claim 3, characterized in that The forwarding the website access request to the target domain name server based on the target process instance corresponding to the target local area network interface and the target wide area network interface includes: Based on the target process instance, replacing the destination Internet Protocol IP address of the website access request from the IP address of the target local area network interface to the IP address of the target domain name server, and replacing the source IP address of the website access request from the IP address of the target terminal to the IP address of the target wide area network interface, to obtain a replaced website access request; Forward the replaced website access request to the target domain name server.

5. The method according to claim 3, characterized in that The forwarding the website access response to the target terminal based on the target process instance includes: Based on the target process instance, replacing the destination IP address of the website access response from the IP address of the target wide area network interface to the IP address of the target terminal, and replacing the source IP address of the website access response from the IP address of the target domain name server to the IP address of the target local area network interface, to obtain a replaced website access response; The replaced website access response is forwarded to the target terminal.

6. The method according to claim 2, characterized in that The method further includes: allocating a domain name cache to each of the process instances, wherein the domain name cache is used to store the domain name of the resolved website of the corresponding process instance and the corresponding domain name resolution result.

7. The method according to any one of claims 1 to 6, characterized in that The target LAN interface and the target WAN interface belong to a target gateway. The target gateway includes multiple WAN interfaces. The multiple WAN interfaces correspond to one or more domain name servers respectively.

8. A domain name resolution device, characterized in that: include: A receiving module, configured to receive a website access request from a target terminal, wherein the website access request includes a target domain name of a target website; a determination module, configured to determine a target wide area network interface based on the target local area network interface for receiving the website access request and a binding relationship between the local area network interface and the wide area network interface; The resolution module is used to resolve the target domain name through the target domain name server corresponding to the target wide area network interface to obtain a domain name resolution result.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the domain name resolution method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: a memory storing an executable program; A processor is used to run the program, wherein the domain name resolution method according to any one of claims 1 to 7 is executed when the program is run.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.