CN107231445A - A kind of dynamic domain name system DNS reorientation methods, apparatus and system - Google Patents
A kind of dynamic domain name system DNS reorientation methods, apparatus and system Download PDFInfo
- Publication number
- CN107231445A CN107231445A CN201610169536.5A CN201610169536A CN107231445A CN 107231445 A CN107231445 A CN 107231445A CN 201610169536 A CN201610169536 A CN 201610169536A CN 107231445 A CN107231445 A CN 107231445A
- Authority
- CN
- China
- Prior art keywords
- address information
- redirection
- dns
- domain name
- client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 30
- 238000011084 recovery Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
Classifications
-
- 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
- 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
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种动态域名系统DNS重定向的方法,装置及系统,包括:将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器;接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;将所述重定向地址信息发送给所述客户端。通过本发明,可以在对DNS重定向过程中避免操作DNS服务器数据库,解决了当DNS服务器发生故障时,重定向需要重新配置DNS数据库的技术问题,也减轻了服务器的负荷;提高网络恢复速度和用户满意度。
The present invention provides a DNS redirection method, device and system of a dynamic domain name system, comprising: 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 The response message returned by the message, wherein the response message carries the address information allocated by the DNS for the client to access the network; according to the address information, the corresponding Acquiring redirection address information in the relationship; sending the redirection address information to the client. Through the present invention, it is possible to avoid operating the DNS server database during the DNS redirection process, which solves the technical problem that the DNS database needs to be reconfigured for redirection when the DNS server fails, and also reduces the load on the server; improves network recovery speed and customer satisfaction.
Description
技术领域technical field
本发明涉及通信和计算机领域,特别涉及一种动态域名系统DNS重定向方法、装置及系统。The invention relates to the fields of communication and computer, in particular to a dynamic domain name system DNS redirection method, device and system.
背景技术Background technique
域名系统(Domain Name System,简称DNS)域名解析可将域名映射为互联网协议(Internet Protocol,简称为IP)地址或IP地址映射为域名,方便用户直接使用主机名访问互联网。当DNS解析出现错误时,用户无法正常访问网站,此时需要对DNS服务器使用重定向技术恢复其正常的解析功能。现有的DNS重定向技术主要有两种,一种是使用DNS服务器进行重新定向,第二种是使用负载均衡(G lobal Server Load Balance,简称为GSLB)设备完成,这两种方法均需要重新调整DNS服务器数据库,因数据库操作复杂,导致DNS服务器故障恢复时间较长,严重影响用户的上网体验。The domain name system (Domain Name System, referred to as DNS) domain name resolution can map domain names to Internet Protocol (Internet Protocol, referred to as IP) addresses or IP addresses to domain names, which is convenient for users to directly use host names to access the Internet. When an error occurs in the DNS resolution, the user cannot access the website normally. At this time, it is necessary to use redirection technology to the DNS server to restore its normal resolution function. Existing DNS redirection technology mainly contains two kinds, one is to use DNS server to redirect, the second is to use load balancing (Global Server Load Balance, referred to as GSLB) equipment to complete, these two methods all need to re-direct Adjust the DNS server database. Due to the complex operation of the database, it takes a long time to restore the DNS server failure, which seriously affects the user's online experience.
针对相关技术中当DNS服务器发生故障时,重定向需要重新配置DNS数据库,无法快速业务的问题,目前尚未提出有效的解决方案。In the related art, when the DNS server fails, the DNS database needs to be reconfigured for redirection, and the business cannot be performed quickly. No effective solution has been proposed yet.
发明内容Contents of the invention
本发明提供了一种动态域名系统DNS重定向的方法,装置及系统,以至少解决相关技术中当DNS服务器发生故障时,重定向需要重新配置DNS数据库,无法快速重新恢复业务的问题。The present invention provides a DNS redirection method, device and system of a dynamic domain name system to at least solve the problem in the related art that when the DNS server fails, the redirection needs to reconfigure the DNS database and the business cannot be quickly restored.
根据本发明的一方面,提供了一种动态域名系统DNS重定向方法,包括:将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器;接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;将所述重定向地址信息发送给所述客户端。所诉原IP地址信息和重定向IP地址信息的对应关系表存放在网关上。According to one aspect of the present invention, a dynamic domain name system DNS redirection method is provided, including: forwarding the domain name resolution request message received from the client to the 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 address information allocated by the DNS for the client to access the network; according to the address information, the corresponding Acquiring redirection address information in the relationship; sending the redirection address information to the client. The corresponding relationship table between the alleged original IP address information and the redirected IP address information is stored on the gateway.
进一步地,在将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器之前,所述方法还包括:接收业务管理平台发送的DNS重定向配置命令;根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。Further, before forwarding the domain name resolution request message received from the client to the DNS server of the dynamic domain name system, the method further includes: receiving a DNS redirection configuration command sent by the service management platform; configuring the DNS redirection configuration command according to the DNS redirection configuration command Correspondence between address information and redirection address information.
进一步地,根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系包括:在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。Further, configuring the corresponding relationship between address information and redirection address information according to the DNS redirection configuration command includes: in the case that the DNS redirection configuration command does not carry a configuration file, according to the DNS redirection configuration command to The service management platform requests and obtains a configuration file, and establishes a correspondence between address information and redirection address information according to the configuration file; or, in the case that the DNS redirection configuration command carries a configuration file, according to the configured The corresponding relationship between configuration address information and redirection address information in the above configuration file.
进一步地,将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器包括:记录所述域名解析请求消息中的IP地址和端口号;将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为出接口的MAC地址和IP地址;将修改后的所述域名解析请求消息转发至所述DNS服务器。Further, forwarding the domain name resolution request message received from the client to the dynamic domain name system DNS server includes: recording the IP address and port number 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 IP address of the outgoing interface; and the modified domain name resolution request message is forwarded to the DNS server.
进一步地,所述重定向地址信息携带有所述客户端的IP地址和端口号。Further, the redirection address information carries the IP address and 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, including: 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 returned by the DNS server according to the domain name resolution request message, wherein the response message carries address information allocated by the DNS for the client to access the network; an acquisition module The method is configured to obtain redirection address information from a pre-configured correspondence between address information and redirection address information according to the address information; a sending module is configured to send the redirection address information to the client.
进一步地,所述装置还包括:第二接收模块,用于接收业务管理平台发送的DNS重定向配置命令;配置模块,用于根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。Further, the device further includes: 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 redirection address information according to the DNS redirection configuration command Correspondence.
进一步地,所述配置模块包括:第一配置单元,用于在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,第二配置单元,用于在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。Further, the configuration module includes: a first configuration unit, configured to request and obtain from the service management platform according to the DNS redirection configuration command when no configuration file is carried in the DNS redirection configuration command. configuration file, and establish the corresponding relationship between address information and redirection address information according to the configuration file; or, the second configuration unit is configured to, in the case where the configuration file is carried in the DNS redirection configuration command, according to the The configuration file configures the corresponding relationship between address information and redirection address information.
进一步地,所述转发模块包括:记录单元,用于记录所述域名解析请求消息中的IP地址和端口号;替换单元,用于将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为所述装置的MAC地址和IP地址;转发单元,用于将修改后的所述域名解析请求消息转发至所述DNS服务器。Further, the forwarding module includes: a recording unit, configured to record the IP address and port number in the domain name resolution request message; a replacement unit, configured to replace the source MAC address in the Ethernet header in the domain name resolution request message The address and the source IP address information in the IP header are replaced with the MAC address and IP address of the device; a forwarding unit, 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 also provided, including a gateway and a DNS server, wherein: the DNS server is used to receive the domain name resolution request message received from the client forwarded by the gateway, and according to the The response message returned by the domain name resolution request message, wherein the response message carries the address information assigned by the DNS to the client for accessing the network; the gateway is configured to receive the response message, and according to the address The information obtains the redirection address information from the pre-configured correspondence between the address information and the redirection address information, and sends the redirection address information to the client.
进一步地,所述系统还包括:业务管理平台,用于向网关发送DNS重定向配置命令,其中,所述DNS重定向配置命令用于网关配置地址信息和重定向地址信息的对应关系。Further, the system further includes: a service management platform, configured to send a DNS redirection configuration command to the gateway, wherein the DNS redirection configuration command is used for the gateway to configure a correspondence between address information and redirection address information.
通过本发明,可以在对DNS重定向过程中避免操作DNS服务器数据库,将传统重定向流程中地址替换部分放在网关上完成,解决了当DNS服务器发生故障时,重定向需要重新配置DNS数据库的技术问题,也减轻了服务器的负荷;显著提高网络恢复速度,提高用户满意度。Through the present invention, it is possible to avoid operating the DNS server database during the DNS redirection process, and the address replacement part in the traditional redirection process is completed on the gateway, which solves the problem that the DNS database needs to be reconfigured when the DNS server fails. Technical problems also reduce the load on the server; significantly improve the network recovery speed and improve user satisfaction.
附图说明Description of drawings
图1是本发明实施例一种动态域名系统DNS重定向方法的流程图;Fig. 1 is the flow chart of a kind of dynamic domain name system DNS redirection method of the embodiment of the present invention;
图2是本发明实施例一种动态域名系统DNS重定向装置的结构框图;Fig. 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重定向装置的优选结构框图一;Fig. 3 is a preferred structural block diagram 1 of a dynamic domain name system DNS redirection device according to an embodiment of the present invention;
图4是本发明实施例一种动态域名系统DNS重定向装置中配置模块结构框图;Fig. 4 is a structural block diagram of a configuration module in a dynamic domain name system DNS redirection device according to an embodiment of the present invention;
图5本发明实施例一种动态域名系统DNS重定向装置中转发模块结构框图;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;
图6本发明实施例一种动态域名系统DNS重定向系统优选流程图;FIG. 6 is an optimal flowchart of a dynamic domain name system DNS redirection system according to an embodiment of the present invention;
图7本发明实施例一种动态域名系统DNS重定向系统优选配置命令流程图;Fig. 7 is a flowchart of optimal configuration commands of a dynamic domain name system DNS redirection system according to an embodiment of the present invention;
图8本发明实施例一种动态域名系统DNS重定向系统获取配置命令流程图;Fig. 8 is a flow chart of obtaining configuration commands of a dynamic domain name system DNS redirection system according to an embodiment of the present invention;
图9本发明实施例一种动态域名系统DNS重定向系统重定向流程图。Fig. 9 is a redirection flowchart of a dynamic domain name system DNS redirection system according to an embodiment of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present invention will be described in detail with reference to the drawings and examples. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the description and claims of the present invention and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence.
本发明实施例提供了一种动态域名系统DNS重定向方法,用于具备实现该重定向方法的家庭网关,以及一种动态域名系统DNS重定向方法的系统,图1是根据本发明实施例绘制的一种动态域名系统DNS重定向方法的流程图,如图1所示,该流程包括如下步骤:An embodiment of the present invention provides a dynamic domain name system DNS redirection method, which is used in a system with a home gateway implementing the redirection method, and a dynamic domain name system DNS redirection method. FIG. 1 is drawn according to an embodiment of the present invention A flow chart of a dynamic domain name system DNS redirection method, as shown in Figure 1, the process includes the following steps:
步骤S102:将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器;Step S102: forwarding the domain name resolution request message received from the client to the DNS server of the dynamic domain name system;
步骤S104:接收所述DNS服务器根据所述域名解析请求消息返回的响应消息,其中,所述响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;Step S104: receiving a response message returned by the DNS server according to the domain name resolution request message, wherein the response message carries address information assigned by the DNS to the client for accessing the network;
步骤S106:根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;将所述重定向地址信息发送给所述客户端。Step S106: Obtain redirection address information from the pre-configured correspondence between address information and redirection address information according to the address information; and send the redirection 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 process the message, and directly returns the DNS response information carrying the wrong address information, and the home gateway sends the wrong address information in the response information Replace with the correct address information, and then the home gateway forwards the replaced response information to the client, and the client uses the address information in the replaced response information to access the Internet, thus providing a fast reply method for DNS services, which significantly improves User experience, reducing the difficulty of DNS server management.
优选地,DNS重定向装置在将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器之前,接收业务管理平台发送的DNS重定向配置命令;根据所述DNS重定向配置命令在家庭网关中配置地址信息和重定向地址信息的对应关系,用于家庭网关在步骤S106中查找。Preferably, before the DNS redirection device forwards the domain name resolution request message received from the client to the DNS server of the dynamic domain name system, it receives the DNS redirection configuration command sent by the service management platform; according to the DNS redirection configuration command in the home gateway Configure the corresponding relationship between the address information and the redirection address information, which is used for the home gateway to search in step S106.
优选地,DNS重定向装置使用两种方式根据DNS重定向配置命令配置地址信息和重定向地址信息的对应关系,在其中一种场景中,DNS重定向配置命令中没有携带配置文件,DNS重定向装置在接受到配置命令后,随即向业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;在另外一种场景中,DNS重定向配置命令中携带有配置文件,DNS重定向装置随即根据配置命令中携带配置文件配置地址信息和重定向地址信息的对应关系。Preferably, the DNS redirection device uses two methods to configure the corresponding relationship between the address information and the redirection address information according to the DNS redirection configuration command. In one of the scenarios, the DNS redirection configuration command does not carry the configuration file, and the DNS redirection After receiving the configuration command, the device immediately requests and obtains the configuration file from the service management platform, and establishes the corresponding relationship between the address information and the redirection address information according to the configuration file; in another scenario, the DNS redirection configuration command The configuration file is carried, and the DNS redirection device then configures the corresponding relationship between the address information and the redirection address information according to the configuration file carried in the configuration command.
优选地,DNS重定向装置在执行S102步骤之前,即将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器之前,记录客户端域名解析请求消息中的IP地址和端口号;将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为出接口的MAC地址和IP地址;将修改后的所述域名解析请求消息转发至所述DNS服务器。通过此步骤,DNS重定向装置将自己伪装为客户端向DNS服务器发送DNS请求信息。Preferably, before the DNS redirection device executes the S102 step, before the domain name resolution request message received from the client is forwarded to the dynamic domain name system DNS server, it records the IP address and port number in the client domain name resolution request message; The source MAC address in the Ethernet header in the domain name resolution request message and the source IP address information in the IP header are replaced with the MAC address and IP address of the outgoing interface; the modified domain name resolution request message is forwarded to the DNS server . Through this step, the DNS redirection device disguises itself as a client and sends DNS request information to the DNS server.
优选地,DNS重定向装置执行步骤S106,即在向客户端发送重定向地址信息的消息时,将之前记录的客户端的IP地址和端口号添加至消息中,通过此步骤,DNS重定向装置将自己伪装为DNS服务器,使客户端无感知地接收重定向消息。Preferably, the DNS redirection device performs step S106, that is, when sending a message of redirection address information to the client, the previously recorded IP address and port number of the client are added to the message, and through this step, the DNS redirection device will Pretending to be a DNS server, so that the client receives redirection messages without awareness.
本发明提供的一种动态域名系统DNS重定向方法,由业务管理平台管理的配置文件或者配置命令中携带的DNS原地址信息和重定向地址信息的对应关系应是唯一的,即一个原地址信息只能对应一个重定向地址信息,由业务管理平台保证而网关装置可以对其校验,如果发现不唯一,将通知业务管理平台下发配置失败。In the DNS redirection method of a dynamic domain name system provided by the present invention, the corresponding relationship between the DNS original address information and the redirection address information carried in the configuration file or configuration command managed by the service management platform should be unique, that is, one original address information It can only correspond to one redirection address information, which is guaranteed by the service management platform and can be verified by the gateway device. If it is found to be not unique, the service management platform will be notified of the failure to deliver the configuration.
本发明实施例还提供了一种动态域名系统DNS重定向装置,应用于网关,图2是本发明实施例一种动态域名系统DNS重定向装置的结构框图,如图2所示,该装置包括如下部分:The embodiment of the present invention also 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 parts:
转发模块22,用于将从客户端接收的域名解析请求消息转发给动态域名系统DNS服务器;The forwarding module 22 is used 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 returned by the DNS server according to the domain name resolution request message, wherein the response message carries address information assigned by the DNS to the client for accessing the network ;
获取模块26,用于根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息;An obtaining module 26, configured to obtain redirection address information from the pre-configured correspondence between address information and redirection address information according to the address information;
发送模块28,用于将所述重定向地址信息发送给所述客户端。A sending module 28, configured to send the redirection address information to the client.
图3是本发明实施例一种动态域名系统DNS重定向装置的优选结构框图一,如图3所示,所述装置还可以包括:Fig. 3 is a preferred structural block diagram 1 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 also include:
第二接收模块32,用于接收业务管理平台发送的DNS重定向配置命令;The second receiving module 32 is configured to receive the DNS redirection configuration command sent by the service management platform;
配置模块34,用于根据所述DNS重定向配置命令配置地址信息和重定向地址信息的对应关系。装置可以利用该模块接受业务管理平台的配置。The configuration module 34 is configured to configure a correspondence between address information and redirection address information according to the DNS redirection configuration command. The device can use this module to accept the configuration of the service management platform.
图4是本发明实施例一种动态域名系统DNS重定向装置中配置模块优选结构框图一,如图4所示,配置模块34包括:Fig. 4 is a preferred structural block diagram 1 of configuration module in a kind of dynamic domain name system DNS redirection device of the embodiment of the present invention, as shown in Fig. 4, configuration module 34 comprises:
配置单元42,用于在所述DNS重定向配置命令中没有携带配置文件的情况下,根据所述DNS重定向配置命令向所述业务管理平台请求并获取配置文件,并根据所述配置文件建立地址信息和重定向地址信息的对应关系;或者,在所述DNS重定向配置命令中携带有配置文件的情况下,根据所述配置文件配置地址信息和重定向地址信息的对应关系。The configuration unit 42 is configured to request and obtain a configuration file from the service management platform according to the DNS redirection configuration command when the configuration file is not carried in the DNS redirection configuration command, and establish a configuration file according to the configuration file. The correspondence between address information and redirection address information; or, in the case that the DNS redirection configuration command carries a configuration file, configure the correspondence between address information and redirection address information according to the configuration file.
图5本发明实施例一种动态域名系统DNS重定向装置中转发模块结构框图,如图5所示,该装置中的转发模块22包括:Fig. 5 structural block diagram of forwarding module in a kind of dynamic domain name system DNS redirection device of the embodiment of the present invention, as shown in Fig. 5, the forwarding module 22 in this device comprises:
记录单元52,用于记录所述域名解析请求消息中的IP地址和端口号;A recording unit 52, configured to record the IP address and port number in the domain name resolution request message;
替换单元54,用于将所述域名解析请求消息中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为所述装置的MAC地址和IP地址;A replacement unit 54, 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 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-mentioned structure, the forwarding module disguises itself as a client when forwarding a request, so that the DNS server can send a DNS response request unconsciously.
本发明实施例还提供了一种动态域名系统DNS重定向系统,其包括网关和DNS服务器,其中:DNS服务器,用于接收网关转发的从客户端接收的域名解析请求消息,根据所述域名解析请求消息返回的响应消息,其中,从DNS服务器返回的响应消息中携带有所述DNS为所述客户端分配用于访问网络的地址信息;网关,用于接收所述响应消息,根据所述地址信息从预先配置的地址信息和重定向地址信息的对应关系中获取重定向地址信息,并将所述重定向地址信息发送给所述客户端。The embodiment of the present invention also provides a dynamic domain name system DNS redirection system, which includes a gateway and a DNS server, wherein: the DNS server is used to receive the domain name resolution request message received from the client and forwarded by the gateway, and 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 address information allocated by the DNS for the client to access the network; the gateway is used to receive the response message, and according to the address The information obtains the redirection address information from the pre-configured correspondence between the address information and the redirection address information, and sends the redirection address information to the client.
图6本发明实施例一种动态域名系统DNS重定向的优选流程图,如图6所示,包括以下步骤: Fig. 6 is a preferred flow chart of a dynamic domain name system DNS redirection in the embodiment of the present invention , as shown in Fig. 6, comprising 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 DNS request message of the client 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 redirection address according to the corresponding table in its own 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, wherein the DNS redirection configuration command is used for gateway configuration address information and redirection address information correspondence.
图7为本发明实施例一种动态域名系统DNS重定向系统优选配置命令流程图。如图7所示,包括:FIG. 7 is a flowchart of an optimal configuration command of a dynamic domain name system DNS redirection system according to an embodiment of the present invention. As shown in Figure 7, including:
步骤S702,业务平台向网关下发配置命令;Step S702, the service platform sends a configuration command to the gateway;
步骤S704,网关根据配置命令配置原地址和新地址的对应关系。Step S704, the gateway configures the corresponding relationship between the original address and the new address according to the configuration command.
下面以一种动态域名系统重定向系统为例,结合具体实施例对本发明实施例进行进一步说明。图8是一种动态域名系统DNS重定向系统获取配置命令流程图,Taking a dynamic domain name system redirection system as an example below, the embodiments of the present invention will be further described in combination with specific embodiments. Fig. 8 is a kind of dynamic domain name system DNS redirection system acquisition configuration order flow chart,
步骤S802:业务管理平台先向网关下发配置命令,命令信息包括配置文件所在服务器的URL;Step S802: the service management platform first sends a configuration command to the gateway, and the command information includes the 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 the configuration file by itself at a designated 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 it on the gateway.
图9是按照本发明实施例提供的一种动态域名系统DNS重定向系统重定向流程图,以一种动态域名系统重定向系统为例结合具体实施例对本发明实施例进行进一步说明。如图9所示:Fig. 9 is a redirection flow chart of a dynamic domain name system DNS redirection system provided according to an embodiment of the present invention. The embodiment of the present invention is further described by taking a dynamic domain name system redirection system as an example in combination with specific embodiments. As shown in Figure 9:
步骤S902:业务平台先向家庭网关下发重定向配置命令,命令中携带配置文件所在地址信息;Step S902: the service platform first sends a redirection configuration command to the home gateway, and the command carries the address information of the configuration file;
步骤S904:网关解析命令后向配置文件所在的资源站点发送http或ftp请求;Step S904: After the gateway parses the command, it sends an http or ftp request to the resource site where the configuration file is located;
步骤S906:配置服务器下发xml格式的配置文件,文件中每一条对应关系的格式如下:<ErrRedirectmode="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 the configuration file in xml format. The format of each corresponding relationship in the file is as follows: <ErrRedirectmode="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 corresponding relationship in the file is unique, that is, one original IP address only corresponds to one redirected IP address. If the uniqueness is satisfied, the gateway will establish the corresponding relationship between the original IP address and the redirected IP address. If the uniqueness is not satisfied, the configuration file is discarded, and the business platform is notified that the redirection setting fails. ;
步骤S910:网关侦听用户侧的DNS请求,当截获到用户设备发出的DNS请求时,记录下用户侧请求报文的IP地址和端口号,作为用户侧客户端程序的唯一标识;网关将报文中的以太网头中的源MAC地址和IP头中的源IP地址信息替换为网关出接口的MAC地址和IP地址。将修改后报文转发至DNS服务器;Step S910: the gateway listens to the DNS request from the user side, and when intercepting the DNS request sent by the user equipment, records the IP address and port number of the request message on the user side as the unique identifier of the client program on the user side; the gateway will report In this article, 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 outgoing 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 a reply from the DNS server. Parses the addr field of the DNS response message to extract the IP address. If the IP address matches in the original IP column of the relationship table, or the IP address is empty, replace the information and reorganize the message; the gateway forwards the reorganized message to the user-side process according to the recorded user-side client program identification. ;
上诉过程中网关分析DNS应答报文,提取解析后的IP地址。如果DNS应答报文中应答码(Responsecode)为名字错误(Name Error),或者回答记录数(ANCOUNT)为0,则以“”(空地址)为关键字在重定向配置数据里的原IP地址列表里查找。对应关系表中原地址信息中存在该IP地址,则修改应答报文中的addr信息为对应的重定向IP地址。如果没有该地址,则不修改原始报文的DNS报文部分。During the appeal process, the gateway analyzes the DNS response message and extracts the resolved IP address. If the response code (Responsecode) in the DNS response message is a name error (Name Error), or the number of answer records (ANCOUNT) is 0, then use "" (empty address) as the keyword in the original IP address in the redirection configuration data Find in the list. If the IP address exists in the original address information in the correspondence table, the addr information in the response message is modified to be the corresponding redirected IP address. If there is no such address, the DNS message part of the original message will not be modified.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned present invention can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network formed by multiple computing devices Alternatively, they may be implemented in program code executable by a computing device so that they may be stored in a storage device to be executed by a computing device, and in some cases in an order different from that shown here The steps shown or described are carried out, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (11)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610169536.5A CN107231445A (en) | 2016-03-23 | 2016-03-23 | A kind of dynamic domain name system DNS reorientation methods, apparatus and system |
PCT/CN2017/072835 WO2017161965A1 (en) | 2016-03-23 | 2017-02-03 | Method, device, and system for dynamic domain name system (dns) redirection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
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 |
---|---|
CN107231445A true CN107231445A (en) | 2017-10-03 |
Family
ID=59899189
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610169536.5A Pending CN107231445A (en) | 2016-03-23 | 2016-03-23 | A kind of dynamic domain name system DNS reorientation methods, apparatus and system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107231445A (en) |
WO (1) | WO2017161965A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110119392A (en) * | 2019-03-25 | 2019-08-13 | 福建天晴数码有限公司 | The method of application switching database IP, storage medium |
CN110324241A (en) * | 2018-03-30 | 2019-10-11 | 北京华为数字技术有限公司 | A kind of method of adjustment, message forwarding method and the device of flow forward-path |
CN115442378A (en) * | 2021-06-03 | 2022-12-06 | 贵州白山云科技股份有限公司 | Domain name resolution method, device, system, medium and equipment |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111107171B (en) * | 2018-10-26 | 2022-07-12 | 中兴通讯股份有限公司 | Security defense method and device for DNS (Domain name Server), communication equipment and medium |
CN113873048B (en) * | 2020-06-12 | 2023-05-12 | 腾讯科技(上海)有限公司 | Method and system for downloading application package in application downloading platform |
CN114095562B (en) * | 2020-07-31 | 2024-10-15 | 中国电信股份有限公司 | Edge application discovery method, system and enhanced firewall |
CN114257390B (en) * | 2020-09-22 | 2023-05-09 | 华为技术有限公司 | Authentication method, network equipment, authentication server, user equipment and storage medium |
CN117278524B (en) * | 2023-09-26 | 2024-06-14 | 北京网藤科技有限公司 | Method and system for solving problem of displaying warning prompt when browser opens local server |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070211714A1 (en) * | 2006-03-07 | 2007-09-13 | Metke Anthony R | Method and apparatus for redirection of Domain Name Service (DNS) packets |
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, gateway and server for user equipment to access webpage |
-
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 (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070211714A1 (en) * | 2006-03-07 | 2007-09-13 | Metke Anthony R | Method and apparatus for redirection of Domain Name Service (DNS) packets |
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, gateway and server for user equipment to access webpage |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110324241A (en) * | 2018-03-30 | 2019-10-11 | 北京华为数字技术有限公司 | A kind of method of adjustment, message forwarding method and the device of flow forward-path |
CN110324241B (en) * | 2018-03-30 | 2022-05-31 | 北京华为数字技术有限公司 | A method for adjusting a traffic forwarding path, a message forwarding method and device |
CN110119392A (en) * | 2019-03-25 | 2019-08-13 | 福建天晴数码有限公司 | The method of application switching database IP, storage medium |
CN110119392B (en) * | 2019-03-25 | 2022-02-11 | 福建天晴数码有限公司 | Method and storage medium for switching database IP (Internet protocol) application |
CN115442378A (en) * | 2021-06-03 | 2022-12-06 | 贵州白山云科技股份有限公司 | Domain name resolution method, device, system, medium and equipment |
Also Published As
Publication number | Publication date |
---|---|
WO2017161965A1 (en) | 2017-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107231445A (en) | A kind of dynamic domain name system DNS reorientation methods, apparatus and system | |
EP3427465B1 (en) | Methods and apparatus for intelligent domain name system forwarding | |
US7228359B1 (en) | Methods and apparatus for providing domain name service based on a client identifier | |
KR101143667B1 (en) | A method and apparatus for providing distributed slf routing capability in an internet multimedia subsystem ims metwork | |
JP5529889B2 (en) | Generation of globally unique identifiers for subscriber devices | |
US8762573B2 (en) | Reverse DNS lookup with modified reverse mappings | |
CN103780715B (en) | Domain name mapping implementation method, client and Cloud Server | |
CN105991796B (en) | A kind of method and system of the configuration service of the user terminal in on-premise network | |
US20120151072A1 (en) | Establishing Unique Sessions for DNS Subscribers | |
CN103109517B (en) | Method, terminal and system for dual-stack terminal accessing server | |
US8751665B2 (en) | Method and apparatus for reporting uniform resource locator, method and apparatus for setting up connection, and communication system | |
US10341288B2 (en) | Methods circuits devices systems and associated computer executable code for providing conditional domain name resolution | |
CN107707683B (en) | A kind of method and apparatus for reducing DNS message lengths | |
WO2015160934A1 (en) | Geolocation via internet protocol | |
CN109076082A (en) | Anonymous identities in identity-oriented networks and protocols | |
CN103997479B (en) | A kind of asymmetric services IP Proxy Methods and equipment | |
US8553685B2 (en) | Session border control migration | |
US20190149508A1 (en) | Explicit service function chaining (sfc) using dns extensions | |
CN103581361A (en) | Domain name resolution proxy method, device and system | |
CN106534204B (en) | Method and system for connecting client and server | |
CN112887441A (en) | Domain name resolution method, terminal and DNS (Domain name Server) | |
US20160065747A1 (en) | A method of resolving a ported telephone number into a network resource identifier | |
CN106375489B (en) | Method and device for processing Media Access Control (MAC) address | |
CN105429880B (en) | The network equipment and its method for carrying out routing forwarding | |
CN102811263A (en) | Communication method and system based on IPv6 for mobile terminal and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171003 |
|
RJ01 | Rejection of invention patent application after publication |