WO2017161965A1 - Method, device, and system for dynamic domain name system (dns) redirection - Google Patents
Method, device, and system for dynamic domain name system (dns) redirection Download PDFInfo
- Publication number
- WO2017161965A1 WO2017161965A1 PCT/CN2017/072835 CN2017072835W WO2017161965A1 WO 2017161965 A1 WO2017161965 A1 WO 2017161965A1 CN 2017072835 W CN2017072835 W CN 2017072835W WO 2017161965 A1 WO2017161965 A1 WO 2017161965A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- address information
- dns
- domain name
- redirection
- client
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 230000004044 response Effects 0.000 claims abstract description 39
- 238000013507 mapping Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000011084 recovery Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0668—Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
Definitions
- the present invention relates to the field of communications and computers, and in particular, to a dynamic domain name system DNS redirection method, apparatus and system.
- DNS Domain Name System
- IP Internet Protocol
- GSLB Global Server Load Balance
- the present invention provides a method, a device and a system for DNS redirection of a dynamic domain name system, so as to at least solve the problem that when a DNS server fails in a related art, the redirection needs to reconfigure the DNS database, and the service cannot be quickly restored.
- a dynamic domain name system DNS redirection method including: forwarding a domain name resolution request message received from a client to a dynamic domain name system DNS server; receiving the DNS server according to the domain name resolution request a response message returned by the message, wherein the response message carries the DNS for the client to allocate address information for accessing the network; and according to the address information, the pre-configured address information and the redirected address information Obtaining redirected address information in the corresponding relationship; and sending the redirected address information to the client.
- the correspondence table between the original IP address information and the redirected IP address information is stored on the gateway.
- the method before forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server, the method further includes: receiving a DNS redirection configuration command sent by the service management platform; and configuring the command according to the DNS redirection Configure the mapping between address information and redirected address information.
- the mapping between the address information and the redirected address information according to the DNS redirection configuration command includes: if the configuration file is not carried in the DNS redirection configuration command, according to the DNS redirection configuration command. Requesting and obtaining a configuration file from the service management platform, and establishing a correspondence between the address information and the redirected address information according to the configuration file; or, if the configuration file is carried in the DNS redirection configuration command, The configuration file configures a correspondence between the address information and the redirected address information.
- forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server includes: recording an IP address and a port number in the domain name resolution request message; and using an Ethernet header in the domain name resolution request message The source MAC address and the source IP address information in the IP header are replaced with the MAC address and the IP address of the outbound interface; and the modified domain name resolution request message is forwarded to the DNS server.
- the redirected address information carries an IP address and a port number of the client.
- a dynamic domain name system DNS redirection device which is applied to a gateway, and includes: a forwarding module, configured to forward a domain name resolution request message received from a client to a dynamic domain name system DNS server; a receiving module, configured to receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS to allocate address information for accessing the network to the client; And being configured to obtain, according to the address information, the redirected address information from the correspondence between the pre-configured address information and the redirected address information; and the sending module is configured to send the redirected address information to the client.
- the device further includes: a second receiving module, configured to receive a DNS redirection configuration command sent by the service management platform; and a configuration module, configured to configure address information and redirect address information according to the DNS redirection configuration command Correspondence.
- a second receiving module configured to receive a DNS redirection configuration command sent by the service management platform
- a configuration module configured to configure address information and redirect address information according to the DNS redirection configuration command Correspondence.
- the configuration module includes: a first configuration unit, configured to request, according to the DNS redirection configuration command, to the service management platform, if the configuration file is not carried in the DNS redirection configuration command Obtaining a configuration file, and establishing a correspondence between the address information and the redirected address information according to the configuration file; or, the second configuration unit is configured to: when the configuration file is carried in the DNS redirection configuration command, The correspondence between the configuration file configuration address information and the redirected address information.
- the forwarding module includes: a recording unit, configured to record an IP address and a port number in the domain name resolution request message; and a replacement unit configured to source the Ethernet header in the domain name resolution request message The source IP address information in the MAC address and the IP header is replaced with the MAC address and the IP address of the device; and the forwarding unit is configured to forward the modified domain name resolution request message to the DNS server.
- a dynamic domain name system DNS redirection system including a gateway and a DNS server, wherein: the DNS server is configured to receive a domain name resolution request message received by the gateway and forwarded from the client, according to the a response message returned by the domain name resolution request message, wherein the response message carries the DNS for the client to allocate address information for accessing the network; and the gateway is configured to receive the response message according to the address The information obtains the redirected address information from the correspondence between the pre-configured address information and the redirected address information, and sends the redirected address information to the client.
- system further includes: a service management platform, configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used to configure a correspondence between the gateway configuration address information and the redirected address information.
- a service management platform configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used to configure a correspondence between the gateway configuration address information and the redirected address information.
- Another embodiment of the present invention provides a computer storage medium, where the computer storage medium stores execution instructions for performing one or a combination of the steps in the foregoing method embodiments.
- the DNS server database can be avoided during the DNS redirection process, and the address replacement part in the traditional redirection process is placed on the gateway, which solves the problem that when the DNS server fails, the redirection needs to reconfigure the DNS database.
- Technical issues also reduce the load on the server; significantly improve network recovery speed and improve user satisfaction.
- FIG. 1 is a flowchart of a method for redirecting a DNS of a dynamic domain name system according to an embodiment of the present invention
- FIG. 2 is a structural block diagram of a dynamic domain name system DNS redirection device according to an embodiment of the present invention
- FIG. 3 is a block diagram 1 of a preferred structure of a dynamic domain name system DNS redirection device according to an embodiment of the present invention
- FIG. 4 is a structural block diagram of a configuration module in a DNS redirection device of a dynamic domain name system according to an embodiment of the present invention
- FIG. 5 is a structural block diagram of a forwarding module in a DNS redirection device of a dynamic domain name system according to an embodiment of the present invention
- FIG. 6 is a flowchart of a preferred DNS redirection system of a dynamic domain name system according to an embodiment of the present invention
- FIG. 7 is a flowchart of a preferred configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention.
- FIG. 8 is a flowchart of a configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention
- FIG. 9 is a flowchart of redirecting a dynamic domain name system DNS redirection system according to an embodiment of the present invention.
- the embodiment of the present invention provides a dynamic domain name system DNS redirection method, which is provided with a home gateway implementing the redirection method, and a system of a dynamic domain name system DNS redirection method, and FIG. 1 is drawn according to an embodiment of the present invention.
- Step S102 Forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server;
- Step S104 Receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS to allocate address information for accessing the network to the client.
- Step S106 Obtain redirection address information from the correspondence between the pre-configured address information and the redirected address information according to the address information; and send the redirected address information to the client.
- the home gateway forwards the domain name resolution request message to the DNS server, and the DNS server does not perform any processing on the message, directly returns the DNS response information carrying the incorrect address information, and the home gateway uses the wrong address information in the response information.
- the replacement is replaced with the correct address information, and then the home gateway forwards the response information that is claimed to be replaced to the client, and the client uses the address information in the replaced response information to access the Internet, thereby providing a quick reply manner of the DNS service, which is significantly improved.
- User experience reduces the difficulty of DNS server management.
- the DNS redirection device receives the DNS redirection configuration command sent by the service management platform before forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server; and the home gateway is configured according to the DNS redirection configuration command. Corresponding relationship between the address information and the redirected address information is configured for the home gateway to search in step S106.
- the DNS redirection device configures the correspondence between the address information and the redirected address information according to the DNS redirection configuration command in two ways.
- the DNS redirection configuration command does not carry the configuration file, and the DNS redirection is performed. After receiving the configuration command, the device requests and obtains a configuration file from the service management platform, and establishes a correspondence between the address information and the redirected address information according to the configuration file.
- the DNS redirection configuration is performed.
- the configuration file carries the configuration file.
- the DNS redirection device then configures the correspondence between the address information and the redirected address information according to the configuration file.
- the DNS redirection device records the IP address and port number in the client domain name resolution request message before forwarding the domain name resolution request message received by the client to the dynamic domain name system DNS server before performing the step S102;
- the source MAC address in the Ethernet header and the source IP address information in the IP header in the domain name resolution request message are replaced with the MAC address and the IP address of the outbound interface; and the modified domain name resolution request message is forwarded to the DNS server.
- the DNS redirector masquerades itself as a client to send DNS request information to the DNS server.
- the DNS redirection device performs step S106, that is, when sending the message of redirecting the address information to the client, adding the previously recorded IP address and port number of the client to the message, through this step, the DNS redirection device will I pretend to be a DNS server, so that the client receives the redirect message without any awareness.
- the correspondence between the original DNS address information and the redirected address information carried in the configuration file or configuration command managed by the service management platform should be unique, that is, an original address information Only one redirected address information can be used, which is guaranteed by the service management platform and can be verified by the gateway device. If the discovery is not unique, the service management platform will be notified that the configuration fails.
- FIG. 2 is a structural block diagram of a dynamic domain name system DNS redirection device according to an embodiment of the present invention. As shown in FIG. 2, the device includes The following sections:
- the forwarding module 22 is configured to forward the domain name resolution request message received from the client to the dynamic domain name system DNS server;
- the first receiving module 24 is configured to receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS address information for the client to access the network. ;
- the obtaining module 26 is configured to reconfigure the address information from the pre-configured address information according to the address information Obtaining redirected address information in a correspondence relationship of address information;
- the sending module 28 is configured to send the redirected address information to the client.
- FIG. 3 is a block diagram of a preferred structure of a dynamic domain name system DNS redirection device according to an embodiment of the present invention. As shown in FIG. 3, the device may further include:
- the second receiving module 32 is configured to receive a DNS redirection configuration command sent by the service management platform.
- the configuration module 34 is configured to configure a correspondence between the address information and the redirected address information according to the DNS redirection configuration command.
- the device can utilize the module to accept the configuration of the service management platform.
- the configuration module 34 includes:
- the configuration unit 42 is configured to: when the configuration file is not carried in the DNS redirection configuration command, request and acquire a configuration file from the service management platform according to the DNS redirection configuration command, and establish a configuration file according to the configuration file. Corresponding relationship between the address information and the redirected address information; or, if the configuration file is carried in the DNS redirection configuration command, the correspondence between the address information and the redirected address information is configured according to the configuration file.
- FIG. 5 is a structural block diagram of a forwarding module in a dynamic domain name system DNS redirection device according to an embodiment of the present invention. As shown in FIG. 5, the forwarding module 22 in the device includes:
- the recording unit 52 is configured to record an IP address and a port number in the domain name resolution request message
- the replacing unit 54 is configured to replace the source MAC address in the Ethernet header and the source IP address information in the IP header in the domain name resolution request message with the MAC address and the IP address of the device;
- the forwarding unit 56 is configured to forward the modified domain name resolution request message to the DNS server.
- the forwarding module disguise itself as a client when forwarding the request, so that The DNS server does not send a DNS response request.
- the embodiment of the present invention further provides a dynamic domain name system DNS redirection system, which includes a gateway and a DNS server, wherein: the DNS server is configured to receive a domain name resolution request message received from the client and forwarded by the gateway, according to the domain name resolution. a response message returned by the request message, wherein the response message returned from the DNS server carries the DNS to allocate address information for accessing the network to the client; and the gateway is configured to receive the response message according to the address The information obtains the redirected address information from the correspondence between the pre-configured address information and the redirected address information, and sends the redirected address information to the client.
- a dynamic domain name system DNS redirection system which includes a gateway and a DNS server, wherein: the DNS server is configured to receive a domain name resolution request message received from the client and forwarded by the gateway, according to the domain name resolution.
- a response message returned by the request message wherein the response message returned from the DNS server carries the DNS to allocate address information for accessing the network to the
- FIG. 6 is a flowchart of a preferred method for DNS redirection of a dynamic domain name system according to an embodiment of the present invention. As shown in FIG. 6, the method includes the following steps:
- Step S602 the terminal sends a DNS request message to the gateway.
- Step S604 the gateway forwards the client DNS request message to the DNS server.
- Step S606 the DNS server sends a DNS response message to the gateway.
- Step S608 the gateway parses the address message in the response message, and replaces the address in the DNS server with the redirect address according to the corresponding table in the database;
- Step S610 the gateway sends the replaced DNS response message to the client.
- the system further includes: a service management platform, configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used for mapping the correspondence between the address information and the redirected address information.
- a service management platform configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used for mapping the correspondence between the address information and the redirected address information.
- FIG. 7 is a flowchart of a preferred configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention. As shown in Figure 7, it includes:
- Step S702 The service platform sends a configuration command to the gateway.
- Step S704 the gateway configures a correspondence between the original address and the new address according to the configuration command.
- FIG. 8 is a flow chart of obtaining a configuration command of a dynamic domain name system DNS redirection system
- Step S802 The service management platform first sends a configuration command to the gateway, where the command information includes a URL of the server where the configuration file is located;
- Step S804 The gateway initiates an http or ftp request, and obtains a configuration file by itself at the specified location.
- Step S806 The gateway establishes a correspondence table between the original IP address and the redirected IP address according to the configuration file information, and stores the correspondence table on the gateway.
- FIG. 9 is a flowchart of a redirection process of a dynamic domain name system DNS redirection system according to an embodiment of the present invention.
- a dynamic domain name system redirection system is taken as an example to further illustrate an embodiment of the present invention. As shown in Figure 9:
- Step S902 The service platform sends a redirection configuration command to the home gateway, where the command carries the address information of the configuration file.
- Step S904 After the gateway parses the command, send an http or ftp request to the resource site where the configuration file is located;
- the gateway parses the configuration file and internally establishes a correspondence table between the original IP address and the redirected IP address.
- Step S908 The gateway checks whether the correspondence in the file is unique, that is, an original IP address corresponds to only one redirected IP address. If the uniqueness is met, the gateway will establish a correspondence between the original IP address and the redirected IP address. If the uniqueness is not met, the configuration file is discarded to notify the service platform that the redirection setting fails. ;
- Step S910 The gateway listens to the DNS request of the user side, and when intercepting the DNS request sent by the user equipment, records the IP address and port number of the user side request packet as the unique identifier of the user side client program; the gateway will report The source MAC address in the Ethernet header and the source IP address information in the IP header are replaced with the MAC address and IP address of the outbound interface of the gateway. Forward the modified message to the DNS server;
- Step S912 The DNS server returns a DNS response message.
- Step S914 The gateway receives the response of the DNS server. Parse the addr field of the DNS response message and extract the IP address. If the IP address is in the original IP address of the relational table, or the IP address is empty, the information is replaced and the message is reassembled. The gateway forwards the reassembled packet to the user-side process according to the recorded user-side client program identifier. ;
- the gateway analyzes the DNS response message and extracts the parsed IP address. If the response code (Response code) in the DNS response message is a Name Error, or the number of answer records (ANCOUNT) is 0, the original IP in the redirected configuration data is marked with "" (empty address) as a key. Look in the address list. If the IP address exists in the original address information in the mapping table, the addr information in the response packet is modified to be the corresponding redirected IP address. If the address is not available, the DNS packet part of the original packet is not modified.
- Embodiments of the present invention also provide a storage medium.
- the foregoing storage medium stores an execution instruction, where the execution instruction is used to perform one or a combination of the steps in the foregoing method embodiments.
- the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM).
- ROM Read-Only Memory
- RAM Random Access Memory
- modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
- the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
- the invention is not limited to any specific combination of hardware and software.
- the DNS redirection method, apparatus, and system for the domain name system provided by the embodiments of the present invention have the following beneficial effects: the DNS server database can be avoided during the DNS redirection process, and the DNS server fails when the DNS server fails. Redirection requires technical problems to reconfigure the DNS database, which also reduces the load on the server; improves network recovery speed and user satisfaction.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Provided in the present invention are a method, a device, and a system for a dynamic domain name system (DNS) redirection, the method comprising: forwarding a domain name resolution request message received from a client to a dynamic domain name system (DNS) server; receiving a response message which is returned by the DNS server according to the domain name resolution request message, the response message carrying the address information allocated by the DNS to the client for accessing a network; acquiring, according to the address information, redirection address information from a preconfigured correlation between address information and redirection address information; sending the redirection address information to the client. The present invention can avoid the operation of the DNS server database during the DNS redirection, which solves the technical problem that, when the DNS server fails, the redirection requires the reconfiguration of the DNS database, relieving the load of the server, improving the network restoration speed and the user satisfaction degree.
Description
本发明涉及通信和计算机领域,特别涉及一种动态域名***DNS重定向方法、装置及***。The present invention relates to the field of communications and computers, and in particular, to a dynamic domain name system DNS redirection method, apparatus and system.
域名***(Domain Name System,简称为DNS)域名解析可将域名映射为互联网协议(Internet Protocol,简称为IP)地址或IP地址映射为域名,方便用户直接使用主机名访问互联网。当DNS解析出现错误时,用户无法正常访问网站,此时需要对DNS服务器使用重定向技术恢复其正常的解析功能。现有的DNS重定向技术主要有两种,一种是使用DNS服务器进行重新定向,第二种是使用负载均衡(Global Server Load Balance,简称为GSLB)设备完成,这两种方法均需要重新调整DNS服务器数据库,因数据库操作复杂,导致DNS服务器故障恢复时间较长,严重影响用户的上网体验。The Domain Name System (DNS) domain name resolution maps domain names to Internet Protocol (IP) addresses or IP addresses to domain names, which allows users to directly access the Internet using host names. When the DNS resolution error occurs, the user cannot access the website normally. In this case, the DNS server needs to use the redirection technology to restore its normal parsing function. There are two main types of DNS redirection technologies: one is to use DNS server for redirection, and the other is to use load balancing (Global Server Load Balance, GSLB for short). Both methods need to be re-adjusted. The DNS server database is complicated due to database operations, resulting in a long recovery time of the DNS server, which seriously affects the user's online experience.
针对相关技术中当DNS服务器发生故障时,重定向需要重新配置DNS数据库,无法快速业务的问题,目前尚未提出有效的解决方案。In the related art, when the DNS server fails, the redirection needs to reconfigure the DNS database, and the problem of fast service cannot be solved. Currently, an effective solution has not been proposed.
发明内容Summary of the invention
本发明提供了一种动态域名***DNS重定向的方法,装置及***,以至少解决相关技术中当DNS服务器发生故障时,重定向需要重新配置DNS数据库,无法快速重新恢复业务的问题。The present invention provides a method, a device and a system for DNS redirection of a dynamic domain name system, so as to at least solve the problem that when a DNS server fails in a related art, the redirection needs to reconfigure the DNS database, and the service cannot be quickly restored.
根据本发明的一方面,提供了一种动态域名***DNS重定向方法,包括:将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器;接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;根据所述地址信息从预先配置的地址信息和重定向地址信息
的对应关系中获取重定向地址信息;将所述重定向地址信息发送给所述客户端。所诉原IP地址信息和重定向IP地址信息的对应关系表存放在网关上。According to an aspect of the present invention, a dynamic domain name system DNS redirection method is provided, including: forwarding a domain name resolution request message received from a client to a dynamic domain name system DNS server; receiving the DNS server according to the domain name resolution request a response message returned by the message, wherein the response message carries the DNS for the client to allocate address information for accessing the network; and according to the address information, the pre-configured address information and the redirected address information
Obtaining redirected address information in the corresponding relationship; and sending the redirected address information to the client. The correspondence table between the original IP address information and the redirected IP address information is stored on the gateway.
可选地,在将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器之前,所述方法还包括:接收业务管理平台发送的DNS重定向配置命令;根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。Optionally, before forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server, the method further includes: receiving a DNS redirection configuration command sent by the service management platform; and configuring the command according to the DNS redirection Configure the mapping between address information and redirected address information.
可选地,根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系包括:在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。Optionally, the mapping between the address information and the redirected address information according to the DNS redirection configuration command includes: if the configuration file is not carried in the DNS redirection configuration command, according to the DNS redirection configuration command. Requesting and obtaining a configuration file from the service management platform, and establishing a correspondence between the address information and the redirected address information according to the configuration file; or, if the configuration file is carried in the DNS redirection configuration command, The configuration file configures a correspondence between the address information and the redirected address information.
可选地,将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器包括:记录所述域名解析请求消息中的IP地址和端口号;将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为出接口的MAC地址和IP地址;将修改后的所述域名解析请求消息转发至所述DNS服务器。Optionally, forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server includes: recording an IP address and a port number in the domain name resolution request message; and using an Ethernet header in the domain name resolution request message The source MAC address and the source IP address information in the IP header are replaced with the MAC address and the IP address of the outbound interface; and the modified domain name resolution request message is forwarded to the DNS server.
可选地,所述重定向地址信息携带有所述客户端的IP地址和端口号。Optionally, the redirected address information carries an IP address and a port number of the client.
根据本发明的另一个方面,提供一种动态域名***DNS重定向装置,应用于网关,包括:转发模块,设置为将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器;第一接收模块,设置为接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;获取模块,设置为根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;发送模块,设置为将所述重定向地址信息发送给所述客户端。
According to another aspect of the present invention, a dynamic domain name system DNS redirection device is provided, which is applied to a gateway, and includes: a forwarding module, configured to forward a domain name resolution request message received from a client to a dynamic domain name system DNS server; a receiving module, configured to receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS to allocate address information for accessing the network to the client; And being configured to obtain, according to the address information, the redirected address information from the correspondence between the pre-configured address information and the redirected address information; and the sending module is configured to send the redirected address information to the client.
可选地,所述装置还包括:第二接收模块,设置为接收业务管理平台发送的DNS重定向配置命令;配置模块,设置为根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。Optionally, the device further includes: a second receiving module, configured to receive a DNS redirection configuration command sent by the service management platform; and a configuration module, configured to configure address information and redirect address information according to the DNS redirection configuration command Correspondence.
可选地,所述配置模块包括:第一配置单元,设置为在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,第二配置单元,设置为在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。Optionally, the configuration module includes: a first configuration unit, configured to request, according to the DNS redirection configuration command, to the service management platform, if the configuration file is not carried in the DNS redirection configuration command Obtaining a configuration file, and establishing a correspondence between the address information and the redirected address information according to the configuration file; or, the second configuration unit is configured to: when the configuration file is carried in the DNS redirection configuration command, The correspondence between the configuration file configuration address information and the redirected address information.
可选地,所述转发模块包括:记录单元,设置为记录所述域名解析请求消息中的IP地址和端口号;替换单元,设置为将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为所述装置的MAC地址和IP地址;转发单元,设置为将修改后的所述域名解析请求消息转发至所述DNS服务器。Optionally, the forwarding module includes: a recording unit, configured to record an IP address and a port number in the domain name resolution request message; and a replacement unit configured to source the Ethernet header in the domain name resolution request message The source IP address information in the MAC address and the IP header is replaced with the MAC address and the IP address of the device; and the forwarding unit is configured to forward the modified domain name resolution request message to the DNS server.
根据本发明的另一方面,还提供了一种动态域名***DNS重定向***,包括网关和DNS服务器,其中:DNS服务器,设置为接收网关转发的从客户端接收的域名解析请求消息,根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;网关,设置为接收所述响应消息,根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息,并将所述重定向地址信息发送给所述客户端。According to another aspect of the present invention, a dynamic domain name system DNS redirection system is provided, including a gateway and a DNS server, wherein: the DNS server is configured to receive a domain name resolution request message received by the gateway and forwarded from the client, according to the a response message returned by the domain name resolution request message, wherein the response message carries the DNS for the client to allocate address information for accessing the network; and the gateway is configured to receive the response message according to the address The information obtains the redirected address information from the correspondence between the pre-configured address information and the redirected address information, and sends the redirected address information to the client.
可选地,所述***还包括:业务管理平台,设置为向网关发送DNS重定向配置命令,其中,所述DNS重定向配置命令用于网关配置地址信息和重定向地址信息的对应关系。Optionally, the system further includes: a service management platform, configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used to configure a correspondence between the gateway configuration address information and the redirected address information.
本发明另一实施例提供了一种计算机存储介质,所述计算机存储介质存储有执行指令,所述执行指令用于执行上述方法实施例中的步骤之一或其组合。
Another embodiment of the present invention provides a computer storage medium, where the computer storage medium stores execution instructions for performing one or a combination of the steps in the foregoing method embodiments.
通过本发明,可以在对DNS重定向过程中避免操作DNS服务器数据库,将传统重定向流程中地址替换部分放在网关上完成,解决了当DNS服务器发生故障时,重定向需要重新配置DNS数据库的技术问题,也减轻了服务器的负荷;显著提高网络恢复速度,提高用户满意度。Through the invention, the DNS server database can be avoided during the DNS redirection process, and the address replacement part in the traditional redirection process is placed on the gateway, which solves the problem that when the DNS server fails, the redirection needs to reconfigure the DNS database. Technical issues also reduce the load on the server; significantly improve network recovery speed and improve user satisfaction.
图1是本发明实施例一种动态域名***DNS重定向方法的流程图;1 is a flowchart of a method for redirecting a DNS of a dynamic domain name system according to an embodiment of the present invention;
图2是本发明实施例一种动态域名***DNS重定向装置的结构框图;2 is a structural block diagram of a dynamic domain name system DNS redirection device according to an embodiment of the present invention;
图3是本发明实施例一种动态域名***DNS重定向装置的优选结构框图一;3 is a block diagram 1 of a preferred structure of a dynamic domain name system DNS redirection device according to an embodiment of the present invention;
图4是本发明实施例一种动态域名***DNS重定向装置中配置模块结构框图;4 is a structural block diagram of a configuration module in a DNS redirection device of a dynamic domain name system according to an embodiment of the present invention;
图5本发明实施例一种动态域名***DNS重定向装置中转发模块结构框图;FIG. 5 is a structural block diagram of a forwarding module in a DNS redirection device of a dynamic domain name system according to an embodiment of the present invention;
图6本发明实施例一种动态域名***DNS重定向***优选流程图;6 is a flowchart of a preferred DNS redirection system of a dynamic domain name system according to an embodiment of the present invention;
图7本发明实施例一种动态域名***DNS重定向***优选配置命令流程图;FIG. 7 is a flowchart of a preferred configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention;
图8本发明实施例一种动态域名***DNS重定向***获取配置命令流程图;FIG. 8 is a flowchart of a configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention;
图9本发明实施例一种动态域名***DNS重定向***重定向流程图。FIG. 9 is a flowchart of redirecting a dynamic domain name system DNS redirection system according to an embodiment of the present invention.
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.
本发明实施例提供了一种动态域名***DNS重定向方法,用于具备实现该重定向方法的家庭网关,以及一种动态域名***DNS重定向方法的***,图1是根据本发明实施例绘制的一种动态域名***DNS重定向方法的流程图,如图1所示,该流程包括如下步骤:The embodiment of the present invention provides a dynamic domain name system DNS redirection method, which is provided with a home gateway implementing the redirection method, and a system of a dynamic domain name system DNS redirection method, and FIG. 1 is drawn according to an embodiment of the present invention. A flowchart of a dynamic domain name system DNS redirection method, as shown in FIG. 1, the process includes the following steps:
步骤S102:将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器;Step S102: Forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server;
步骤S104:接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;Step S104: Receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS to allocate address information for accessing the network to the client.
步骤S106:根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;将所述重定向地址信息发送给所述客户端。Step S106: Obtain redirection address information from the correspondence between the pre-configured address information and the redirected address information according to the address information; and send the redirected address information to the client.
通过上述步骤,家庭网关将域名解析请求消息转发至DNS服务器,DNS服务器对该消息不做任何处理,直接返回携带有错误地址信息的DNS响应信息,由家庭网关将该响应信息中的错误地址信息替换替换成正确的地址信息,随后家庭网关将所诉被替换的响应信息转发给客户端,客户端利用被替换响应信息中的地址信息进行上网,从而提供了DNS业务快速回复的方式,显著提升用户体验,降低DNS服务器管理难度。Through the above steps, the home gateway forwards the domain name resolution request message to the DNS server, and the DNS server does not perform any processing on the message, directly returns the DNS response information carrying the incorrect address information, and the home gateway uses the wrong address information in the response information. The replacement is replaced with the correct address information, and then the home gateway forwards the response information that is claimed to be replaced to the client, and the client uses the address information in the replaced response information to access the Internet, thereby providing a quick reply manner of the DNS service, which is significantly improved. User experience reduces the difficulty of DNS server management.
优选地,DNS重定向装置在将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器之前,接收业务管理平台发送的DNS重定向配置命令;根据所述DNS重定向配置命令在家庭网关中配置地址信息和重定向地址信息的对应关系,用于家庭网关在步骤S106中查找。Preferably, the DNS redirection device receives the DNS redirection configuration command sent by the service management platform before forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server; and the home gateway is configured according to the DNS redirection configuration command. Corresponding relationship between the address information and the redirected address information is configured for the home gateway to search in step S106.
优选地,DNS重定向装置使用两种方式根据DNS重定向配置命令配置地址信息和重定向地址信息的对应关系,在其中一种场景中,DNS重定向配置命令中没有携带配置文件,DNS重定向装置在接受到配置命令后,随即向业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;在另外一种场景中,DNS重定向配置
命令中携带有配置文件,DNS重定向装置随即根据配置命令中携带配置文件配置地址信息和重定向地址信息的对应关系。Preferably, the DNS redirection device configures the correspondence between the address information and the redirected address information according to the DNS redirection configuration command in two ways. In one scenario, the DNS redirection configuration command does not carry the configuration file, and the DNS redirection is performed. After receiving the configuration command, the device requests and obtains a configuration file from the service management platform, and establishes a correspondence between the address information and the redirected address information according to the configuration file. In another scenario, the DNS redirection configuration is performed.
The configuration file carries the configuration file. The DNS redirection device then configures the correspondence between the address information and the redirected address information according to the configuration file.
优选地,DNS重定向装置在执行S102步骤之前,即将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器之前,记录客户端域名解析请求消息中的IP地址和端口号;将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为出接口的MAC地址和IP地址;将修改后的所述域名解析请求消息转发至所述DNS服务器。通过此步骤,DNS重定向装置将自己伪装为客户端向DNS服务器发送DNS请求信息。Preferably, the DNS redirection device records the IP address and port number in the client domain name resolution request message before forwarding the domain name resolution request message received by the client to the dynamic domain name system DNS server before performing the step S102; The source MAC address in the Ethernet header and the source IP address information in the IP header in the domain name resolution request message are replaced with the MAC address and the IP address of the outbound interface; and the modified domain name resolution request message is forwarded to the DNS server. . Through this step, the DNS redirector masquerades itself as a client to send DNS request information to the DNS server.
优选地,DNS重定向装置执行步骤S106,即在向客户端发送重定向地址信息的消息时,将之前记录的客户端的IP地址和端口号添加至消息中,通过此步骤,DNS重定向装置将自己伪装为DNS服务器,使客户端无感知地接收重定向消息。Preferably, the DNS redirection device performs step S106, that is, when sending the message of redirecting the address information to the client, adding the previously recorded IP address and port number of the client to the message, through this step, the DNS redirection device will I pretend to be a DNS server, so that the client receives the redirect message without any awareness.
本发明提供的一种动态域名***DNS重定向方法,由业务管理平台管理的配置文件或者配置命令中携带的DNS原地址信息和重定向地址信息的对应关系应是唯一的,即一个原地址信息只能对应一个重定向地址信息,由业务管理平台保证而网关装置可以对其校验,如果发现不唯一,将通知业务管理平台下发配置失败。The dynamic domain name system DNS redirection method provided by the present invention, the correspondence between the original DNS address information and the redirected address information carried in the configuration file or configuration command managed by the service management platform should be unique, that is, an original address information Only one redirected address information can be used, which is guaranteed by the service management platform and can be verified by the gateway device. If the discovery is not unique, the service management platform will be notified that the configuration fails.
本发明实施例还提供了一种动态域名***DNS重定向装置,应用于网关,图2是本发明实施例一种动态域名***DNS重定向装置的结构框图,如图2所示,该装置包括如下部分:The embodiment of the present invention further provides a dynamic domain name system DNS redirection device, which is applied to a gateway. FIG. 2 is a structural block diagram of a dynamic domain name system DNS redirection device according to an embodiment of the present invention. As shown in FIG. 2, the device includes The following sections:
转发模块22,设置为将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器;The forwarding module 22 is configured to forward the domain name resolution request message received from the client to the dynamic domain name system DNS server;
第一接收模块24,设置为接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;The first receiving module 24 is configured to receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS address information for the client to access the network. ;
获取模块26,设置为根据所述地址信息从预先配置的地址信息和重定
向地址信息的对应关系中获取重定向地址信息;The obtaining module 26 is configured to reconfigure the address information from the pre-configured address information according to the address information
Obtaining redirected address information in a correspondence relationship of address information;
发送模块28,设置为将所述重定向地址信息发送给所述客户端。The sending module 28 is configured to send the redirected address information to the client.
图3是本发明实施例一种动态域名***DNS重定向装置的优选结构框图一,如图3所示,所述装置还可以包括:3 is a block diagram of a preferred structure of a dynamic domain name system DNS redirection device according to an embodiment of the present invention. As shown in FIG. 3, the device may further include:
第二接收模块32,设置为接收业务管理平台发送的DNS重定向配置命令;The second receiving module 32 is configured to receive a DNS redirection configuration command sent by the service management platform.
配置模块34,设置为根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。装置可以利用该模块接受业务管理平台的配置。The configuration module 34 is configured to configure a correspondence between the address information and the redirected address information according to the DNS redirection configuration command. The device can utilize the module to accept the configuration of the service management platform.
图4是本发明实施例一种动态域名***DNS重定向装置中配置模块优选结构框图一,如图4所示,配置模块34包括:4 is a block diagram of a preferred structure of a configuration module in a DNS redirection device of a dynamic domain name system according to an embodiment of the present invention. As shown in FIG. 4, the configuration module 34 includes:
配置单元42,设置为在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。The configuration unit 42 is configured to: when the configuration file is not carried in the DNS redirection configuration command, request and acquire a configuration file from the service management platform according to the DNS redirection configuration command, and establish a configuration file according to the configuration file. Corresponding relationship between the address information and the redirected address information; or, if the configuration file is carried in the DNS redirection configuration command, the correspondence between the address information and the redirected address information is configured according to the configuration file.
图5本发明实施例一种动态域名***DNS重定向装置中转发模块结构框图,如图5所示,该装置中的转发模块22包括:FIG. 5 is a structural block diagram of a forwarding module in a dynamic domain name system DNS redirection device according to an embodiment of the present invention. As shown in FIG. 5, the forwarding module 22 in the device includes:
记录单元52,设置为记录所述域名解析请求消息中的IP地址和端口号;The recording unit 52 is configured to record an IP address and a port number in the domain name resolution request message;
替换单元54,设置为将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为所述装置的MAC地址和IP地址;The replacing unit 54 is configured to replace the source MAC address in the Ethernet header and the source IP address information in the IP header in the domain name resolution request message with the MAC address and the IP address of the device;
转发单元56,设置为将修改后的所述域名解析请求消息转发至所述DNS服务器。The forwarding unit 56 is configured to forward the modified domain name resolution request message to the DNS server.
通过上述结构使转发模块在转发请求时,将自己伪装成客户端,使
DNS服务器无感知发送DNS响应请求。Through the above structure, the forwarding module disguise itself as a client when forwarding the request, so that
The DNS server does not send a DNS response request.
本发明实施例还提供了一种动态域名***DNS重定向***,其包括网关和DNS服务器,其中:DNS服务器,设置为接收网关转发的从客户端接收的域名解析请求消息,根据所述域名解析请求消息返回的响应消息,其中,从DNS服务器返回的响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;网关,设置为接收所述响应消息,根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息,并将所述重定向地址信息发送给所述客户端。The embodiment of the present invention further provides a dynamic domain name system DNS redirection system, which includes a gateway and a DNS server, wherein: the DNS server is configured to receive a domain name resolution request message received from the client and forwarded by the gateway, according to the domain name resolution. a response message returned by the request message, wherein the response message returned from the DNS server carries the DNS to allocate address information for accessing the network to the client; and the gateway is configured to receive the response message according to the address The information obtains the redirected address information from the correspondence between the pre-configured address information and the redirected address information, and sends the redirected address information to the client.
图6本发明实施例一种动态域名***DNS重定向的优选流程图,如图6所示,包括以下步骤:FIG. 6 is a flowchart of a preferred method for DNS redirection of a dynamic domain name system according to an embodiment of the present invention. As shown in FIG. 6, the method includes the following steps:
步骤S602,终端向网关发送DNS请求消息;Step S602, the terminal sends a DNS request message to the gateway.
步骤S604,网关向DNS服务器转发客户端DNS请求消息;Step S604, the gateway forwards the client DNS request message to the DNS server.
步骤S606,DNS服务器向网关发送DNS响应消息;Step S606, the DNS server sends a DNS response message to the gateway.
步骤S608,网关解析响应消息中地址消息,并根据自身数据库中的对应表将DNS服务器中的地址替换为重定向地址;Step S608, the gateway parses the address message in the response message, and replaces the address in the DNS server with the redirect address according to the corresponding table in the database;
步骤S610,网关将替换后的DNS响应消息发送给客户端。Step S610, the gateway sends the replaced DNS response message to the client.
优选地,所述***还包括:业务管理平台,设置为向网关发送DNS重定向配置命令,其中,所述DNS重定向配置命令用于网关配置地址信息和重定向地址信息的对应关系。Preferably, the system further includes: a service management platform, configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used for mapping the correspondence between the address information and the redirected address information.
图7为本发明实施例一种动态域名***DNS重定向***优选配置命令流程图。如图7所示,包括:FIG. 7 is a flowchart of a preferred configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention. As shown in Figure 7, it includes:
步骤S702,业务平台向网关下发配置命令;Step S702: The service platform sends a configuration command to the gateway.
步骤S704,网关根据配置命令配置原地址和新地址的对应关系。Step S704, the gateway configures a correspondence between the original address and the new address according to the configuration command.
下面以一种动态域名***重定向***为例,结合具体实施例对本发明实施例进行进一步说明。图8是一种动态域名***DNS重定向***获取配置命令流程图,
The following takes a dynamic domain name system redirection system as an example, and further describes the embodiments of the present invention in conjunction with specific embodiments. 8 is a flow chart of obtaining a configuration command of a dynamic domain name system DNS redirection system,
步骤S802:业务管理平台先向网关下发配置命令,命令信息包括配置文件所在服务器的URL;Step S802: The service management platform first sends a configuration command to the gateway, where the command information includes a URL of the server where the configuration file is located;
步骤S804:网关发起http或ftp请求,到指定位置自行获取配置文件;Step S804: The gateway initiates an http or ftp request, and obtains a configuration file by itself at the specified location.
步骤S806:网关根据配置文件信息建立原IP地址和重定向IP地址的对应关系表并存放在网关上。Step S806: The gateway establishes a correspondence table between the original IP address and the redirected IP address according to the configuration file information, and stores the correspondence table on the gateway.
图9是按照本发明实施例提供的一种动态域名***DNS重定向***重定向流程图,以一种动态域名***重定向***为例结合具体实施例对本发明实施例进行进一步说明。如图9所示:FIG. 9 is a flowchart of a redirection process of a dynamic domain name system DNS redirection system according to an embodiment of the present invention. A dynamic domain name system redirection system is taken as an example to further illustrate an embodiment of the present invention. As shown in Figure 9:
步骤S902:业务平台先向家庭网关下发重定向配置命令,命令中携带配置文件所在地址信息;Step S902: The service platform sends a redirection configuration command to the home gateway, where the command carries the address information of the configuration file.
步骤S904:网关解析命令后向配置文件所在的资源站点发送http或ftp请求;Step S904: After the gateway parses the command, send an http or ftp request to the resource site where the configuration file is located;
步骤S906:配置服务器下发xml格式的配置文件,文件中每一条对应关系的格式如下:<ErrRedirect mode="1"SIP="aaa.aaa.aaa.aaa"DIP="bbb.bbb.bbb.bbb"/>,其中“aaa.aaa.aaa.aaa”和“bbb.bbb.bbb.bbb”代表任意合法的IP地址。网关解析配置文件,在内部建立原IP地址和重定向IP地址对应关系表。Step S906: The configuration server sends an xml format configuration file, and the format of each correspondence in the file is as follows: <ErrRedirect mode="1"SIP="aaa.aaa.aaa.aaa"DIP="bbb.bbb.bbb. Bbb"/>, where "aaa.aaa.aaa.aaa" and "bbb.bbb.bbb.bbb" represent any legal IP address. The gateway parses the configuration file and internally establishes a correspondence table between the original IP address and the redirected IP address.
步骤S908:网关检查文件里的对应关系是否唯一,即一个原IP地址仅对应一个重定向IP地址。如果满足唯一性,网关将建立原IP地址和重定向IP地址之间的对应关系。如果不满足唯一性,则丢弃此次配置文件,通知业务平台重定向设置失败。;Step S908: The gateway checks whether the correspondence in the file is unique, that is, an original IP address corresponds to only one redirected IP address. If the uniqueness is met, the gateway will establish a correspondence between the original IP address and the redirected IP address. If the uniqueness is not met, the configuration file is discarded to notify the service platform that the redirection setting fails. ;
步骤S910:网关侦听用户侧的DNS请求,当截获到用户设备发出的DNS请求时,记录下用户侧请求报文的IP地址和端口号,作为用户侧客户端程序的唯一标识;网关将报文中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为网关出接口的MAC地址和IP地址。将修改后报文转发至DNS服务器;Step S910: The gateway listens to the DNS request of the user side, and when intercepting the DNS request sent by the user equipment, records the IP address and port number of the user side request packet as the unique identifier of the user side client program; the gateway will report The source MAC address in the Ethernet header and the source IP address information in the IP header are replaced with the MAC address and IP address of the outbound interface of the gateway. Forward the modified message to the DNS server;
步骤S912:DNS服务器返回DNS响应消息;
Step S912: The DNS server returns a DNS response message.
步骤S914:网关收到DNS服务器的应答。解析DNS应答报文的addr字段,提取IP地址。如果IP地址在关系表原IP列里命中,或IP地址为空,则替换信息并重组报文;网关将重组后的报文根据已记录的用户侧客户端程序标识,转发给用户侧进程。;Step S914: The gateway receives the response of the DNS server. Parse the addr field of the DNS response message and extract the IP address. If the IP address is in the original IP address of the relational table, or the IP address is empty, the information is replaced and the message is reassembled. The gateway forwards the reassembled packet to the user-side process according to the recorded user-side client program identifier. ;
上诉过程中网关分析DNS应答报文,提取解析后的IP地址。如果DNS应答报文中应答码(Response code)为名字错误(Name Error),或者回答记录数(ANCOUNT)为0,则以“”(空地址)为关键字在重定向配置数据里的原IP地址列表里查找。对应关系表中原地址信息中存在该IP地址,则修改应答报文中的addr信息为对应的重定向IP地址。如果没有该地址,则不修改原始报文的DNS报文部分。During the appeal process, the gateway analyzes the DNS response message and extracts the parsed IP address. If the response code (Response code) in the DNS response message is a Name Error, or the number of answer records (ANCOUNT) is 0, the original IP in the redirected configuration data is marked with "" (empty address) as a key. Look in the address list. If the IP address exists in the original address information in the mapping table, the addr information in the response packet is modified to be the corresponding redirected IP address. If the address is not available, the DNS packet part of the original packet is not modified.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质中存储有执行指令,该执行指令用于执行上述方法实施例中的步骤之一或其组合。Embodiments of the present invention also provide a storage medium. Optionally, in this embodiment, the foregoing storage medium stores an execution instruction, where the execution instruction is used to perform one or a combination of the steps in the foregoing method embodiments.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in the embodiment, the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM). A variety of media that can store program code, such as a hard disk, a disk, or an optical disk.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精
神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Where in the essence of the invention
Any modifications, equivalent substitutions, improvements, etc. made within the principles of God and the principles are intended to be included within the scope of the present invention.
如上所述,本发明实施例提供的一种态域名***DNS重定向方法、装置及***具有以下有益效果:可以在对DNS重定向过程中避免操作DNS服务器数据库,解决了当DNS服务器发生故障时,重定向需要重新配置DNS数据库的技术问题,也减轻了服务器的负荷;提高网络恢复速度和用户满意度。
As described above, the DNS redirection method, apparatus, and system for the domain name system provided by the embodiments of the present invention have the following beneficial effects: the DNS server database can be avoided during the DNS redirection process, and the DNS server fails when the DNS server fails. Redirection requires technical problems to reconfigure the DNS database, which also reduces the load on the server; improves network recovery speed and user satisfaction.
Claims (11)
- 一种动态域名***DNS重定向方法,包括:A dynamic domain name system DNS redirection method includes:将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器;Forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server;接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;Receiving, by the DNS server, a response message returned by the domain name resolution request message, where the response message carries the DNS to allocate address information for accessing the network to the client;根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;Obtaining, according to the address information, redirection address information from a correspondence between the pre-configured address information and the redirected address information;将所述重定向地址信息发送给所述客户端。Sending the redirected address information to the client.
- 根据权利要求1所述的方法,其中,在将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器之前,所述方法还包括:The method of claim 1, wherein the method further comprises: before forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server, the method further comprising:接收业务管理平台发送的DNS重定向配置命令;Receiving a DNS redirection configuration command sent by the service management platform;根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。Corresponding relationship between the address information and the redirected address information is configured according to the DNS redirection configuration command.
- 根据权利要求2所述的方法,其中,根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系包括:The method of claim 2, wherein the mapping between the address information and the redirected address information according to the DNS redirection configuration command comprises:在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,If the configuration file is not carried in the DNS redirection configuration command, the configuration file is requested and obtained from the service management platform according to the DNS redirection configuration command, and the address information and the redirect address are established according to the configuration file. Correspondence of information; or,在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。When the configuration file is carried in the DNS redirection configuration command, the correspondence between the address information and the redirected address information is configured according to the configuration file.
- 根据权利要求1至3中任一项所述的方法,其中,将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器包括:The method according to any one of claims 1 to 3, wherein forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server comprises:记录所述域名解析请求消息中的IP地址和端口号;Recording an IP address and a port number in the domain name resolution request message;将所述域名解析请求消息中的以太网头中的源MAC地址和IP头 中的源IP地址信息替换为出接口的MAC地址和IP地址;Source MAC address and IP header in the Ethernet header in the domain name resolution request message Replace the source IP address information with the MAC address and IP address of the outbound interface.将修改后的所述域名解析请求消息转发至所述DNS服务器。Transmitting the modified domain name resolution request message to the DNS server.
- 根据权利要求4所述的方法,其中,所述重定向地址信息携带有所述客户端的IP地址和端口号。The method of claim 4, wherein the redirected address information carries an IP address and a port number of the client.
- 一种动态域名***DNS重定向装置,应用于网关,包括:A dynamic domain name system DNS redirection device is applied to a gateway, including:转发模块,设置为将从客户端接收的域名解析请求消息转发给动态域名***DNS服务器;The forwarding module is configured to forward the domain name resolution request message received from the client to the dynamic domain name system DNS server;第一接收模块,设置为接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;The first receiving module is configured to receive a response message that is returned by the DNS server according to the domain name resolution request message, where the response message carries the DNS address information for the client to access the network;获取模块,设置为根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;An obtaining module, configured to obtain, according to the address information, redirection address information from a correspondence between pre-configured address information and redirected address information;发送模块,设置为将所述重定向地址信息发送给所述客户端。And a sending module, configured to send the redirected address information to the client.
- 根据权利要求6所述的装置,其中,所述装置还包括:The apparatus of claim 6 wherein said apparatus further comprises:第二接收模块,设置为接收业务管理平台发送的DNS重定向配置命令;a second receiving module, configured to receive a DNS redirection configuration command sent by the service management platform;配置模块,设置为根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。The configuration module is configured to configure a correspondence between the address information and the redirected address information according to the DNS redirection configuration command.
- 根据权利要求7所述的装置,其中,所述配置模块包括:The apparatus of claim 7, wherein the configuration module comprises:第一配置单元,设置为在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,a first configuration unit, configured to request and acquire a configuration file from the service management platform according to the DNS redirection configuration command, if the configuration file is not carried in the DNS redirection configuration command, and according to the configuration file Establish a correspondence between the address information and the redirected address information; or,第二配置单元,设置为在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。 The second configuration unit is configured to configure, according to the configuration file, a correspondence between the address information and the redirected address information, where the configuration file is carried in the DNS redirection configuration command.
- 根据权利要求6至8中任一项所述的装置,其中,所述转发模块包括:The apparatus according to any one of claims 6 to 8, wherein the forwarding module comprises:记录单元,设置为记录所述域名解析请求消息中的IP地址和端口号;a recording unit, configured to record an IP address and a port number in the domain name resolution request message;替换单元,设置为将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为所述装置的MAC地址和IP地址;a replacement unit, configured to replace source MAC address in the Ethernet header and source IP address information in the IP header in the domain name resolution request message with a MAC address and an IP address of the device;转发单元,设置为将修改后的所述域名解析请求消息转发至所述DNS服务器。And a forwarding unit, configured to forward the modified domain name resolution request message to the DNS server.
- 一种动态域名***DNS重定向***,包括网关和DNS服务器,其中:A dynamic domain name system DNS redirection system, including a gateway and a DNS server, wherein:DNS服务器,设置为接收网关转发的从客户端接收的域名解析请求消息,根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;The DNS server is configured to receive, by the gateway, a domain name resolution request message received from the client, according to the response message returned by the domain name resolution request message, where the response message carries the DNS for the client Address information for accessing the network;网关,设置为接收所述响应消息,根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息,并将所述重定向地址信息发送给所述客户端。The gateway is configured to receive the response message, obtain redirection address information from the correspondence between the pre-configured address information and the redirected address information, and send the redirected address information to the client according to the address information. .
- 根据权利要求10所述的***,其中,所述***还包括:The system of claim 10 wherein said system further comprises:业务管理平台,设置为向网关发送DNS重定向配置命令,其中,所述DNS重定向配置命令用于网关配置地址信息和重定向地址信息的对应关系。 The service management platform is configured to send a DNS redirection configuration command to the gateway, where the DNS redirection configuration command is used to configure a correspondence between the gateway configuration address information and the redirected address information.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610169536.5 | 2016-03-23 | ||
CN201610169536.5A CN107231445A (en) | 2016-03-23 | 2016-03-23 | A kind of dynamic domain name system DNS reorientation methods, apparatus and system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017161965A1 true WO2017161965A1 (en) | 2017-09-28 |
Family
ID=59899189
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/072835 WO2017161965A1 (en) | 2016-03-23 | 2017-02-03 | Method, device, and system for dynamic domain name system (dns) redirection |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107231445A (en) |
WO (1) | WO2017161965A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111107171A (en) * | 2018-10-26 | 2020-05-05 | 中兴通讯股份有限公司 | Security defense method and device for DNS (Domain name Server), communication equipment and medium |
CN113873048A (en) * | 2020-06-12 | 2021-12-31 | 腾讯科技(上海)有限公司 | Method and system for downloading application package in application downloading platform |
CN114095562A (en) * | 2020-07-31 | 2022-02-25 | 中国电信股份有限公司 | Edge application discovery method and system and enhanced firewall |
CN114257390A (en) * | 2020-09-22 | 2022-03-29 | 华为技术有限公司 | Authentication method, network device, authentication server, user device, and storage medium |
CN117278524A (en) * | 2023-09-26 | 2023-12-22 | 北京网藤科技有限公司 | Method and system for solving problem of displaying warning prompt when browser opens local server |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110324241B (en) * | 2018-03-30 | 2022-05-31 | 北京华为数字技术有限公司 | Flow forwarding path adjusting method, message forwarding method and device |
CN110119392B (en) * | 2019-03-25 | 2022-02-11 | 福建天晴数码有限公司 | Method and storage medium for switching database IP (Internet protocol) application |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102546774A (en) * | 2011-12-27 | 2012-07-04 | 厦门市美亚柏科信息股份有限公司 | CDN (content distribution network) routing method for secondary redirection and system |
CN102668518A (en) * | 2011-12-02 | 2012-09-12 | 华为技术有限公司 | Content distribution network routing method, system, and user terminal |
CN103181147A (en) * | 2010-11-08 | 2013-06-26 | 瑞典爱立信有限公司 | Method and apparatus for enabling dns redirection in mobile telecommunication systems |
CN103384993A (en) * | 2012-12-14 | 2013-11-06 | 华为技术有限公司 | Redirection method of visiting web pages by user equipment, gateway and server |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7743094B2 (en) * | 2006-03-07 | 2010-06-22 | Motorola, Inc. | Method and apparatus for redirection of domain name service (DNS) packets |
-
2016
- 2016-03-23 CN CN201610169536.5A patent/CN107231445A/en active Pending
-
2017
- 2017-02-03 WO PCT/CN2017/072835 patent/WO2017161965A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103181147A (en) * | 2010-11-08 | 2013-06-26 | 瑞典爱立信有限公司 | Method and apparatus for enabling dns redirection in mobile telecommunication systems |
CN102668518A (en) * | 2011-12-02 | 2012-09-12 | 华为技术有限公司 | Content distribution network routing method, system, and user terminal |
CN102546774A (en) * | 2011-12-27 | 2012-07-04 | 厦门市美亚柏科信息股份有限公司 | CDN (content distribution network) routing method for secondary redirection and system |
CN103384993A (en) * | 2012-12-14 | 2013-11-06 | 华为技术有限公司 | Redirection method of visiting web pages by user equipment, gateway and server |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111107171A (en) * | 2018-10-26 | 2020-05-05 | 中兴通讯股份有限公司 | Security defense method and device for DNS (Domain name Server), communication equipment and medium |
CN111107171B (en) * | 2018-10-26 | 2022-07-12 | 中兴通讯股份有限公司 | Security defense method and device for DNS (Domain name Server), communication equipment and medium |
CN113873048A (en) * | 2020-06-12 | 2021-12-31 | 腾讯科技(上海)有限公司 | Method and system for downloading application package in application downloading platform |
CN113873048B (en) * | 2020-06-12 | 2023-05-12 | 腾讯科技(上海)有限公司 | Method and system for downloading application package in application downloading platform |
CN114095562A (en) * | 2020-07-31 | 2022-02-25 | 中国电信股份有限公司 | Edge application discovery method and system and enhanced firewall |
CN114257390A (en) * | 2020-09-22 | 2022-03-29 | 华为技术有限公司 | Authentication method, network device, authentication server, user device, and storage medium |
CN114257390B (en) * | 2020-09-22 | 2023-05-09 | 华为技术有限公司 | Authentication method, network device, authentication server, user device, and storage medium |
CN117278524A (en) * | 2023-09-26 | 2023-12-22 | 北京网藤科技有限公司 | Method and system for solving problem of displaying warning prompt when browser opens local server |
Also Published As
Publication number | Publication date |
---|---|
CN107231445A (en) | 2017-10-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017161965A1 (en) | Method, device, and system for dynamic domain name system (dns) redirection | |
US9935921B2 (en) | Correlating nameserver IPv6 and IPv4 addresses | |
US10476942B2 (en) | DNS resolution of overlapping domains in a multi-tenant computing environment | |
US7228359B1 (en) | Methods and apparatus for providing domain name service based on a client identifier | |
US8332522B2 (en) | Establishing unique sessions for DNS subscribers | |
US9900281B2 (en) | Computer-implemented method, apparatus, and computer-readable medium for processing named entity queries using a cached functionality in a domain name system | |
US8832238B2 (en) | Recording stateless IP addresses | |
EP2266064B1 (en) | Request routing | |
US9722806B2 (en) | Service discovery across different networks | |
US20120084382A1 (en) | On-the-fly reverse mapping | |
US8949952B2 (en) | Multi-stack subscriber sign on | |
WO2018214853A1 (en) | Method, apparatus, medium and device for reducing length of dns message | |
EP3132589A1 (en) | Geolocation via internet protocol | |
KR20140007363A (en) | Site-aware distributed file system access from outside enterprise network | |
CN112583952B (en) | Redirection scheduling processing method, device and system, related equipment and storage medium | |
US9697173B2 (en) | DNS proxy service for multi-core platforms | |
US20130117308A1 (en) | Apparatus, Method and System for Node Discovering | |
WO2016177185A1 (en) | Method and apparatus for processing media access control (mac) address | |
JP6605149B2 (en) | Method and apparatus for detecting shared terminal | |
EP2591586A1 (en) | Apparatus, method and system for node discovering | |
JP6001512B2 (en) | Communication control system and communication control method | |
JP5084716B2 (en) | VPN connection apparatus, DNS packet control method, and program | |
JP2008206081A (en) | Data relaying apparatus and data relaying method used for multi-homing communication system | |
WO2017221919A1 (en) | Communication connection management device, ip multimedia subsystem, registration device, communication connection management method, and recording medium having program recorded thereon | |
WO2022106027A1 (en) | Interconnecting semantic routing islands using non-semantic routing based services |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17769242 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17769242 Country of ref document: EP Kind code of ref document: A1 |