[go: up one dir, main page]

CN108574744A - Domain name resolution method, device, electronic device and readable storage medium - Google Patents

Domain name resolution method, device, electronic device and readable storage medium Download PDF

Info

Publication number
CN108574744A
CN108574744A CN201710631292.2A CN201710631292A CN108574744A CN 108574744 A CN108574744 A CN 108574744A CN 201710631292 A CN201710631292 A CN 201710631292A CN 108574744 A CN108574744 A CN 108574744A
Authority
CN
China
Prior art keywords
domain name
address
name resolution
resolution
mapping table
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
Application number
CN201710631292.2A
Other languages
Chinese (zh)
Inventor
王鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201710631292.2A priority Critical patent/CN108574744A/en
Publication of CN108574744A publication Critical patent/CN108574744A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

An embodiment of the present invention provides a kind of domain name analytic method, device, electronic equipment and readable storage medium storing program for executing, wherein the method includes:Obtain the domain name carried in the domain name mapping request message that local dns server is sent and source IP address, according to domain name, the inquiry domain name mapping information corresponding with domain name in presetting privately owned mapping table, when inquiring domain name mapping information corresponding with domain name, the resolution response message that transmission carries domain name mapping information gives the corresponding local dns server of source IP address.A kind of domain name analytic method, device, electronic equipment and the readable storage medium storing program for executing provided through the embodiment of the present invention, it may be implemented directly to be resolved to domain name mapping information by domain name, domain name mapping is asked to carry out fine granularity parsing, domain name mapping accuracy is improved, and reduces the time of parsing domain name consumption.

Description

一种域名解析方法、装置、电子设备及可读存储介质Domain name resolution method, device, electronic device and readable storage medium

技术领域technical field

本发明涉及计算机网络通信技术领域,特别涉及一种域名解析方法、装置、电子设备及可读存储介质。The invention relates to the technical field of computer network communication, in particular to a domain name resolution method, device, electronic equipment and readable storage medium.

背景技术Background technique

DNS(Domain Name System,域名系统),互联网上作为域名和IP(InternetProtocol,网络之间互连的协议)地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP数字串。通过主机名,得到该主机名对应的IP地址的过程叫做域名解析(或主机名解析),执行域名解析的网络主机称为DNS服务器。通过DNS服务器,可以得到所需站点或资源的IP地址,进而对该站点或资源进行访问。DNS (Domain Name System, Domain Name System), a distributed database on the Internet that maps domain names and IP (Internet Protocol, a protocol for interconnection between networks) addresses, enables users to access the Internet more conveniently without having to remember A string of IP numbers that can be read directly by a machine. The process of obtaining the IP address corresponding to the host name through the host name is called domain name resolution (or host name resolution), and the network host that performs domain name resolution is called a DNS server. Through the DNS server, the IP address of the required site or resource can be obtained, and then the site or resource can be accessed.

ICP(Internet Content Provider,互联网内容提供商)基于GSLB(Global ServerLoad Balance,全局服务器负载均衡)考虑,在域名解析过程中都会对解析请求进行调度,从而实现负载均衡。ICP (Internet Content Provider, Internet Content Provider) is based on the consideration of GSLB (Global Server Load Balance, global server load balancing). During the process of domain name resolution, it will schedule resolution requests to achieve load balancing.

在现有技术中,ICP对解析请求进行调度的过程中,常用的方法是根据请求解析的客户端IP(Internet Protocol,网络互连协议)地址或本地DNS服务器的IP地址,对解析请求进行调度。In the prior art, in the process of ICP scheduling the resolution request, the common method is to schedule the resolution request according to the client IP (Internet Protocol, Internet Protocol) address or the IP address of the local DNS server requesting resolution .

例如,某ISP(Internet Service Provider,互联网服务提供商)的接入用户在浏览器中输入某网站域名,则该接入用户向该ISP的DNS服务器(一般称为本地DNS服务器)发起域名解析请求,其中,该域名解析请求中携带有该网站域名;假设本地DNS服务器在本地数据库和缓存中未查询到该网站域名对应的解析记录,也未在根域DNS服务器和二级域DNS服务器中查询到该网站域名对应的解析记录,则本地DNS服务器会根据二级域DNS服务器返回的权威DNS服务器的IP地址,向权威DNS服务器发起域名解析请求,其中,该域名解析请求中携带有该网站域名及本地DNS服务器的IP地址或该接入用户的IP地址。For example, when an access user of an ISP (Internet Service Provider, Internet Service Provider) enters a website domain name in a browser, the access user initiates a domain name resolution request to the DNS server of the ISP (generally referred to as a local DNS server). , where the domain name resolution request carries the domain name of the website; it is assumed that the local DNS server has not found the resolution record corresponding to the domain name of the website in the local database and cache, nor has it queried in the DNS server of the root domain and the DNS server of the secondary domain If the resolution record corresponding to the domain name of the website is found, the local DNS server will initiate a domain name resolution request to the authoritative DNS server according to the IP address of the authoritative DNS server returned by the DNS server of the secondary domain, where the domain name resolution request carries the domain name of the website and the IP address of the local DNS server or the IP address of the access user.

权威DNS服务器在接收到该域名解析请求后,在包含本地DNS服务器IP地址或接入用户IP地址的IP地址段对应的节点中查询解析记录,其中,权威DNS服务器中保存有按照地理位置进行划分的IP地址段,每个IP地址段对应的地理位置对应为一个入口节点,该入口节点还存在父节点,权威DNS服务器在与该IP地址段对应的入口节点,及该入口节点的父节点中查询,在查询到到与该网站域名对应的解析记录后,将该解析记录添加到与该域名解析请求对应的DNS响应报文,并返回给该接入用户。After receiving the domain name resolution request, the authoritative DNS server queries the resolution record in the node corresponding to the IP address segment containing the local DNS server IP address or the IP address of the access user. The IP address segment corresponding to each IP address segment corresponds to an entry node, and the entry node also has a parent node, and the authoritative DNS server is in the entry node corresponding to the IP address segment and the parent node of the entry node Query, after finding the resolution record corresponding to the website domain name, add the resolution record to the DNS response message corresponding to the domain name resolution request, and return it to the access user.

然而,由于权威DNS服务器中每个节点对应的是预先划分的IP地址段,IP地址粒度较粗,当该IP地址段对应的入口节点或该入口节点的父节点出现故障后,会造成域名解析的结果出现偏差,降低了域名解析的精确度。其中,IP地址粒度表示IP地址划分的精细程度。However, since each node in the authoritative DNS server corresponds to a pre-divided IP address segment, the granularity of the IP address is relatively coarse. When the entry node corresponding to the IP address segment or the parent node of the entry node fails, domain name resolution will be caused. The results are biased, reducing the accuracy of domain name resolution. Wherein, the IP address granularity indicates the fineness of IP address division.

发明内容Contents of the invention

本发明实施例的目的在于提供一种域名解析方法、装置、电子设备及可读存储介质,以对解析请求实现细粒度解析,提高域名解析的精确度。具体技术方案如下:The purpose of the embodiment of the present invention is to provide a domain name resolution method, device, electronic equipment and readable storage medium, so as to implement fine-grained resolution of resolution requests and improve the accuracy of domain name resolution. The specific technical scheme is as follows:

第一方面,本发明实施例提供了一种域名解析方法,该方法包括:In the first aspect, the embodiment of the present invention provides a domain name resolution method, the method comprising:

获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;Obtain the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, where the source IP address includes the local DNS server IP address;

根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;According to the domain name, the domain name resolution information corresponding to the domain name is queried in the preset private mapping table, wherein the domain name and domain name resolution information corresponding to the domain name are stored in the preset private mapping table, and the domain name resolution information includes: the resolution type corresponding to the domain name and The resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and saved in the preset private mapping table;

在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。When the domain name resolution information corresponding to the domain name is queried, a resolution response message carrying the domain name resolution information is sent to the local DNS server corresponding to the source IP address.

可选的,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,包括:Optionally, obtain the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, including:

获取本地DNS服务器发送的域名解析请求报文,并检测域名解析请求报文是否有标记位;Obtain the domain name resolution request message sent by the local DNS server, and detect whether the domain name resolution request message has a flag bit;

在域名解析请求报文没有标记位时,获取域名解析请求报文中携带的本地DNS服务器IP地址和域名;When the domain name resolution request message has no flag bit, obtain the local DNS server IP address and domain name carried in the domain name resolution request message;

在域名解析请求报文有标记位时,获取域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。When the domain name resolution request message has a flag bit, obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message.

可选的,预设私有映射表中还保存有多个第一IP地址段,根据域名,在预设私有映射表中查询与域名对应的域名解析信息,包括:Optionally, multiple first IP address segments are also stored in the preset private mapping table. According to the domain name, query the domain name resolution information corresponding to the domain name in the preset private mapping table, including:

获取预设私有映射表中保存的与域名对应的多个第一IP地址段,其中,第一IP地址段为多个本地DNS服务器IP地址的集合;Obtain a plurality of first IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the first IP address segment is a collection of multiple local DNS server IP addresses;

在多个第一IP地址段中,确定与本地DNS服务器IP地址对应的第一IP地址段为第一目标IP地址段;Among the plurality of first IP address segments, determining that the first IP address segment corresponding to the IP address of the local DNS server is the first target IP address segment;

将预设私有映射表中,与第一目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。The domain name resolution information corresponding to the first target IP address segment in the preset private mapping table is determined as the domain name resolution information corresponding to the domain name.

可选的,第一IP地址段为按照地理位置划分的IP地址段,或者按照业务服务器的业务划分的IP地址段。Optionally, the first IP address segment is an IP address segment divided according to geographical location, or an IP address segment divided according to service of the service server.

可选的,预设私有映射表中还保存有多个第二IP地址段,根据域名,在预设私有映射表中查询与域名对应的域名解析信息,包括:Optionally, multiple second IP address segments are stored in the preset private mapping table. According to the domain name, the domain name resolution information corresponding to the domain name is queried in the preset private mapping table, including:

获取预设私有映射表中,保存的与域名对应的多个第二IP地址段,其中,第二IP地址段为多个客户端IP地址的集合;Obtaining multiple second IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the second IP address segment is a collection of multiple client IP addresses;

在多个第二IP地址段中,确定与客户端IP地址对应的第二IP地址段为第二目标IP地址段;Among the plurality of second IP address segments, determining that the second IP address segment corresponding to the client IP address is the second target IP address segment;

将预设私有映射表中,与第二目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。The domain name resolution information corresponding to the second target IP address segment in the preset private mapping table is determined as the domain name resolution information corresponding to the domain name.

可选的,上述解析类型可以包括:地址记录、规范名记录、邮件交换记录或解析服务器记录;Optionally, the above resolution types may include: address record, canonical name record, mail exchange record or resolution server record;

上述解析值可以包括:网站服务器IP地址、邮件服务器IP地址或解析服务器IP地址。The above resolution value may include: the IP address of the website server, the IP address of the mail server or the IP address of the resolution server.

可选的,在获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址之前,本发明实施例的域名解析方法还包括:Optionally, before obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, the domain name resolution method in the embodiment of the present invention further includes:

获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段,其中,第一IP地址段为多个本地DNS服务器IP地址的集合,第二IP地址段为多个客户端IP地址的集合;Obtain domain names, domain name resolution information, multiple first IP address segments or multiple second IP address segments, where the first IP address segment is a collection of multiple local DNS server IP addresses, and the second IP address segment is a collection of multiple client IP addresses A collection of endpoint IP addresses;

建立域名与域名解析信息、多个第一IP地址段对应的预设私有映射表,或者建立域名与域名解析信息、多个第二IP地址段对应的预设私有映射表。Establish a preset private mapping table corresponding to domain name and domain name resolution information, multiple first IP address segments, or establish a preset private mapping table corresponding to domain name and domain name resolution information, and multiple second IP address segments.

可选的,预设私有映射表包括状态标识,状态标识用于对预设私有映射表进行区分。Optionally, the preset private mapping table includes a status identifier, and the status identifier is used to distinguish the preset private mapping table.

第二方面,本发明实施例还提供了一种域名解析装置,该装置包括:In the second aspect, the embodiment of the present invention also provides a domain name resolution device, which includes:

第一获取模块,用于获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;The first obtaining module is used to obtain the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address;

解析模块,用于根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;The resolution module is used to query the domain name resolution information corresponding to the domain name in the preset private mapping table according to the domain name, where the domain name and domain name resolution information corresponding to the domain name are stored in the preset private mapping table, and the domain name resolution information includes: The resolution type corresponding to the domain name and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and saved in the preset private mapping table;

响应模块,用于在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。The response module is configured to send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address when the domain name resolution information corresponding to the domain name is queried.

可选的,第一获取模块,具体用于:Optionally, the first acquisition module is specifically used for:

获取本地DNS服务器发送的域名解析请求报文,并检测域名解析请求报文是否有标记位;在域名解析请求报文没有标记位时,获取域名解析请求报文中携带的本地DNS服务器IP地址和域名;在域名解析请求报文有标记位时,获取域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。Obtain the domain name resolution request message sent by the local DNS server, and detect whether the domain name resolution request message has a flag bit; when the domain name resolution request message does not have a flag bit, obtain the local DNS server IP address and Domain name; when the domain name resolution request message has a flag bit, obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message.

可选的,预设私有映射表中还保存有多个第一IP地址段,解析模块,包括:Optionally, a plurality of first IP address segments and parsing modules are also stored in the preset private mapping table, including:

第一获取子模块,用于获取预设私有映射表中,保存的与域名对应的多个第一IP地址段,其中,第一IP地址段为多个本地DNS服务器IP地址的集合;The first obtaining submodule is used to obtain a plurality of first IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the first IP address segment is a collection of multiple local DNS server IP addresses;

第一确定子模块,用于在多个第一IP地址段中,确定与本地DNS服务器IP地址对应的第一IP地址段为第一目标IP地址段;The first determination submodule is used to determine, among the plurality of first IP address segments, that the first IP address segment corresponding to the IP address of the local DNS server is the first target IP address segment;

第一解析子模块,用于将预设私有映射表中,与第一目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。The first resolution sub-module is configured to determine domain name resolution information corresponding to the first target IP address segment in the preset private mapping table as domain name resolution information corresponding to the domain name.

可选的,第一IP地址段为按照地理位置划分的IP地址段,或者按照业务服务器的业务划分的IP地址段。Optionally, the first IP address segment is an IP address segment divided according to geographical location, or an IP address segment divided according to service of the service server.

可选的,预设私有映射表中还保存有多个第二IP地址段,解析模块,还包括:Optionally, multiple second IP address segments are also stored in the preset private mapping table, and the parsing module also includes:

第二获取子模块,用于获取预设私有映射表中,保存的与域名对应的多个第二IP地址段,其中,第二IP地址段为多个客户端IP地址的集合;The second obtaining submodule is used to obtain multiple second IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the second IP address segment is a collection of multiple client IP addresses;

第二确定模块,用于在多个第二IP地址段中,确定与客户端IP地址对应的第二IP地址段为第二目标IP地址段;The second determination module is configured to determine, among the plurality of second IP address segments, that the second IP address segment corresponding to the client IP address is the second target IP address segment;

第二解析子模块,用于将预设私有映射表中,与第二目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。The second resolution sub-module is configured to determine domain name resolution information corresponding to the second target IP address segment in the preset private mapping table as domain name resolution information corresponding to the domain name.

可选的,上述解析类型可以包括:地址记录、规范名记录、邮件交换记录或解析服务器记录;Optionally, the above resolution types may include: address record, canonical name record, mail exchange record or resolution server record;

上述解析值可以包括:网站服务器IP地址、邮件服务器IP地址或解析服务器IP地址。The above resolution value may include: the IP address of the website server, the IP address of the mail server or the IP address of the resolution server.

可选的,本发明实施例的域名解析装置,还包括:Optionally, the domain name resolution device in the embodiment of the present invention further includes:

预设私有映射表建立模块,用于获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段,建立域名与域名解析信息、多个第一IP地址段对应的预设私有映射表,或者建立域名与域名解析信息、多个第二IP地址段对应的预设私有映射表,其中,第一IP地址段为多个本地DNS服务器IP地址的集合,第二IP地址段为多个客户端IP地址的集合。The preset private mapping table establishment module is used to obtain the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments, and establish a preset mapping table corresponding to the domain name and domain name resolution information, and multiple first IP address segments. Set up a private mapping table, or establish a domain name and domain name resolution information, and a preset private mapping table corresponding to multiple second IP address segments, wherein the first IP address segment is a collection of multiple local DNS server IP addresses, and the second IP address A segment is a collection of multiple client IP addresses.

可选的,预设私有映射表包括状态标识,状态标识用于对预设私有映射表进行区分。Optionally, the preset private mapping table includes a status identifier, and the status identifier is used to distinguish the preset private mapping table.

第三方面,本发明实施例还提供了一种电子设备,其特征在于,包括处理器和机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器被机器可执行指令促使:实现上述第一方面提供的一种域名解析方法步骤。In the third aspect, the embodiment of the present invention also provides an electronic device, which is characterized in that it includes a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor Prompted by machine-executable instructions: implementing the steps of a domain name resolution method provided in the first aspect above.

第四方面,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时,实现上述第一方面提供的一种域名解析方法的步骤。In the fourth aspect, the embodiment of the present invention also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the domain name resolution method provided in the above-mentioned first aspect is realized A step of.

第五方面,本发明实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面提供的一种域名解析方法。In the fifth aspect, the embodiment of the present invention also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the domain name resolution method provided in the first aspect above.

第六方面,本发明实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面提供的一种域名解析方法。In the sixth aspect, the embodiment of the present invention also provides a computer program, which, when running on a computer, causes the computer to execute the domain name resolution method provided in the first aspect above.

本发明实施例提供的一种域名解析方法、装置、电子设备及可读存储介质,根据域名在预设私有映射表中查询到与域名对应的域名解析信息,在查询到与域名对应的域名解析信息时,根据源IP地址,发送携带有域名解析信息的解析相应报文给本地DNS服务器;可以实现通过域名直接解析到域名解析信息,对域名解析请求进行细粒度解析,提高了域名解析精确度,并且降低了解析域名消耗的时间。当然,实施本发明的任一产品或方法并不一定需要同时达到上述的所有优点。According to the domain name resolution method, device, electronic device and readable storage medium provided by the embodiments of the present invention, the domain name resolution information corresponding to the domain name is queried in the preset private mapping table according to the domain name, and the domain name resolution information corresponding to the domain name is queried. When sending information, according to the source IP address, send the corresponding resolution message carrying the domain name resolution information to the local DNS server; it can directly resolve the domain name resolution information through the domain name, and perform fine-grained resolution on the domain name resolution request, improving the accuracy of domain name resolution , and reduce the time consumed by resolving domain names. Of course, implementing any product or method of the present invention does not necessarily need to achieve all the advantages mentioned above at the same time.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例的域名解析方法应用于域名解析系统的结构示意图;FIG. 1 is a schematic structural diagram of a domain name resolution method applied to a domain name resolution system according to an embodiment of the present invention;

图2为本发明实施例的一种域名解析方法的第一种实施方式的流程图;FIG. 2 is a flowchart of a first implementation of a domain name resolution method according to an embodiment of the present invention;

图3为本发明实施例的一种域名解析方法的第二种实施方式的流程图;FIG. 3 is a flowchart of a second implementation of a domain name resolution method according to an embodiment of the present invention;

图4为本发明实施例的一种域名解析方法的第三种实施方式的流程图;FIG. 4 is a flowchart of a third implementation manner of a domain name resolution method according to an embodiment of the present invention;

图5为本发明实施例的一种域名解析方法的第四种实施方式的流程图;FIG. 5 is a flowchart of a fourth implementation manner of a domain name resolution method according to an embodiment of the present invention;

图6为本发明实施例的一种域名解析方法的公共DNS服务器的节点划分示意图;6 is a schematic diagram of node division of a public DNS server of a domain name resolution method according to an embodiment of the present invention;

图7为本发明实施例的一种域名解析装置的结构示意图;FIG. 7 is a schematic structural diagram of a domain name resolution device according to an embodiment of the present invention;

图8为本发明实施例的一种域名解析方法应用于电子设备的结构示意图。FIG. 8 is a schematic structural diagram of a domain name resolution method applied to an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

为了解决现有技术存在的问题,本发明实施例提供了一种域名解析方法、装置、电子设备及可读存储介质,以通过域名直接解析到域名解析信息,可以实现对域名解析请求进行细粒度解析,提高域名解析精确度。In order to solve the problems existing in the prior art, the embodiment of the present invention provides a domain name resolution method, device, electronic equipment and readable storage medium, so that the domain name resolution information can be directly resolved through the domain name, and fine-grained domain name resolution requests can be implemented. Analysis, improve the accuracy of domain name resolution.

首先,本发明实施例提供的一种域名解析方法、装置、电子设备及可读存储介质的可以应用于权威DNS服务器,如图1所示,为本发明实施例的域名解析方法应用于域名解析系统的结构示意图;该域名解析系统可以包括本地DNS服务器102、根域DNS服务器103、二级域DNS服务器104和权威DNS服务器105,其中,权威DNS服务器105是应用本发明实施例的一种域名解析方法的DNS服务器。First of all, a domain name resolution method, device, electronic device, and readable storage medium provided by the embodiment of the present invention can be applied to an authoritative DNS server, as shown in Figure 1, which is a domain name resolution method applied to domain name resolution Schematic diagram of the structure of the system; the domain name resolution system may include a local DNS server 102, a root domain DNS server 103, a secondary domain DNS server 104 and an authoritative DNS server 105, wherein the authoritative DNS server 105 is a domain name applying the embodiment of the present invention The DNS server for the resolution method.

用户在访问网站时,可以通过DNS服务器系统对目标网站的域名进行解析,得到该网站服务器对应的IP地址,进而向拥有该IP地址的网站服务器发送访问请求,实现对该网站的访问。When users visit a website, they can analyze the domain name of the target website through the DNS server system to obtain the IP address corresponding to the website server, and then send an access request to the website server with the IP address to realize access to the website.

用户发送电子邮件时,可以通过DNS服务器系统对目标电子邮箱的邮件服务器的域名进行解析,得到目标电子邮箱的邮件服务器的IP地址,进而实现通过拥有该IP地址的邮件服务器向目标电子邮箱发送电子邮件。When a user sends an e-mail, the domain name of the mail server of the target e-mail can be analyzed through the DNS server system, and the IP address of the mail server of the target e-mail can be obtained, and then the mail server with the IP address can send an e-mail to the target e-mail. mail.

因此,当客户端101访问网站或者发送电子邮件时,可以首先向本地DNS服务器102发起域名解析请求,本地DNS服务器102接收到该域名解析请求后,在本地DNS服务器102的本地数据库和缓存中查询与该域名对应的解析记录,在未查询到与该域名对应的解析记录时,本地DNS服务器102可以向根域DNS服务器103发送携带有该域名的域名解析请求,其中,该客户端101可以是个人计算机、也可以是连接互联网的移动设备。Therefore, when the client 101 visits a website or sends an e-mail, it can first initiate a domain name resolution request to the local DNS server 102. After the local DNS server 102 receives the domain name resolution request, it can query The resolution record corresponding to the domain name, when no resolution record corresponding to the domain name is found, the local DNS server 102 may send a domain name resolution request carrying the domain name to the root domain DNS server 103, wherein the client 101 may be A personal computer, or a mobile device connected to the Internet.

当根域DNS服务器103中没有与该域名对应的域名解析记录时,可以发送与该域名对应的二级域DNS服务器104的IP地址给本地DNS服务器102,本地DNS服务器102可以发送域名解析请求给与该域名对应的二级域DNS服务器104,请求二级域DNS服务器104解析该域名。When there is no domain name resolution record corresponding to the domain name in the root domain DNS server 103, the IP address of the secondary domain DNS server 104 corresponding to the domain name can be sent to the local DNS server 102, and the local DNS server 102 can send a domain name resolution request to The second-level domain DNS server 104 corresponding to the domain name requests the second-level domain DNS server 104 to resolve the domain name.

具体的,二级域DNS服务器104可以在自身缓存中查询与该域名对应的解析记录,当未查询到与该域名对应的解析记录时,二级DNS服务器104可以发送与该域名对应的、应用本发明实施例的域名解析方法的权威DNS服务器105的IP地址给本地DNS服务器102。Specifically, the secondary domain DNS server 104 can query the resolution record corresponding to the domain name in its own cache, and when no resolution record corresponding to the domain name is found, the secondary DNS server 104 can send the application corresponding to the domain name The IP address of the authoritative DNS server 105 of the domain name resolution method in the embodiment of the present invention is given to the local DNS server 102 .

本地DNS服务器102可以发送域名解析请求给应用本发明实施例的域名解析方法的权威DNS服务器105。权威DNS服务器105可以应用本发明实施例的域名解析方法对本地DNS服务器102发送的域名解析请求中携带的域名进行解析,并反馈与该域名对应的域名解析信息给本地DNS服务器102。本地DNS服务器102,将该域名解析信息返回给该客户端101,以使得该客户端101可以访问网站或者发送电子邮件。The local DNS server 102 may send a domain name resolution request to the authoritative DNS server 105 applying the domain name resolution method of the embodiment of the present invention. The authoritative DNS server 105 can apply the domain name resolution method of the embodiment of the present invention to resolve the domain name carried in the domain name resolution request sent by the local DNS server 102, and feed back the domain name resolution information corresponding to the domain name to the local DNS server 102. The local DNS server 102 returns the domain name resolution information to the client 101, so that the client 101 can access websites or send emails.

通过将应用本发明实施例的域名解析方法的权威DNS服务器105应用于图1所示的域名解析系统中,可以实现通过域名直接解析到域名解析信息,对域名解析请求进行细粒度解析,并且降低了解析域名消耗的时间,提高了域名解析质量。By applying the authoritative DNS server 105 of the domain name resolution method of the embodiment of the present invention to the domain name resolution system shown in FIG. Reduced the time spent on resolving domain names and improved the quality of domain name resolution.

下面,对本发明实施例的一种域名解析方法进行介绍,如图2所示,为本发明实施例的一种域名解析方法的第一种实施方式的流程图,该方法可以包括:Next, a method for resolving a domain name in an embodiment of the present invention is introduced, as shown in FIG. 2 , which is a flowchart of a first implementation of a method for resolving a domain name in an embodiment of the present invention. The method may include:

S201,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址。S201. Obtain the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server.

在一些示例中,上述的源IP地址可以包括本地DNS服务器IP地址,该域名可以是用户输入到浏览器的目标网站的域名,还可以是发送电子邮件时,目标电子邮箱的邮件服务器的域名。In some examples, the above-mentioned source IP address may include a local DNS server IP address, and the domain name may be the domain name of the target website entered by the user into the browser, or the domain name of the mail server of the target email address when sending an email.

在一些示例中,当本地DNS服务器发送域名解析请求给权威DNS服务器时,可以将域名和源IP地址添加到域名解析请求报文中,因此,应用本发明实施例的一种域名解析方法的权威DNS服务器,在接收到本地DNS服务器发送的域名解析请求报文后,可以从该域名解析请求报文中获取到域名和源IP地址,该源IP地址可以是本地DNS服务器的IP地址。In some examples, when the local DNS server sends a domain name resolution request to the authoritative DNS server, the domain name and source IP address can be added to the domain name resolution request message. The DNS server, after receiving the domain name resolution request message sent by the local DNS server, can obtain the domain name and source IP address from the domain name resolution request message, and the source IP address can be the IP address of the local DNS server.

例如,用户在浏览器中输入了“www.abc.com”的域名,本地DNS服务器可以将携带有该域名和本地DNS服务器IP地址的域名解析请求报文,发送给应用本发明实施例的域名解析方法的权威DNS服务器。该权威DNS服务器在接收到域名解析请求报文后,可以从该域名解析请求报文中提取到域名“www.abc.com”和发送该域名解析请求报文的本地DNS服务器的IP地址。For example, if the user enters the domain name "www.abc.com" in the browser, the local DNS server can send the domain name resolution request message carrying the domain name and the IP address of the local DNS server to the domain name application of the embodiment of the present invention. The authoritative DNS server for the resolution method. After receiving the domain name resolution request message, the authoritative DNS server can extract the domain name "www.abc.com" and the IP address of the local DNS server sending the domain name resolution request message from the domain name resolution request message.

S202,根据域名,在预设私有映射表中查询与域名对应的域名解析信息。S202, query domain name resolution information corresponding to the domain name in a preset private mapping table according to the domain name.

其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中,该域名为请求解析的域名。Among them, the default private mapping table stores the domain name and domain name resolution information corresponding to the domain name. The domain name resolution information includes: the resolution type corresponding to the domain name and the resolution value corresponding to the resolution type. The domain name resolution information is pre-configured and stored in the preset private In the mapping table, the domain name is the domain name requested to be resolved.

例如,该预设私有映射表可以是由用户预先自定义建立的,保存有不同网站服务器的域名和对应的网站服务器的域名解析信息,或者,保存有不同邮件服务器的域名和对应的邮件服务器的域名解析信息,还可以同时保存有不同网站服务器的域名和对应的网站服务器的域名解析信息、不同邮件服务器的域名和对应的邮件服务器的域名解析信息。For example, the preset private mapping table may be pre-customized and established by the user, storing the domain names of different web servers and the domain name resolution information of the corresponding web servers, or storing the domain names of different mail servers and the corresponding mail server The domain name resolution information may also store domain names of different web servers and domain name resolution information of corresponding web servers, domain names of different mail servers and domain name resolution information of corresponding mail servers.

在一些示例中,当预设私有映射表中保存的是不同网站服务器的域名和对应的网站服务器的域名解析信息时,该域名解析信息中的解析类型可以是:A(Address,地址)记录、CNAME(Canonical Name,规范名)记录或NS(Name Server,解析服务器)记录。In some examples, when the domain names of different web servers and the domain name resolution information of the corresponding web servers are stored in the preset private mapping table, the resolution type in the domain name resolution information may be: A (Address, address) record, CNAME (Canonical Name, canonical name) record or NS (Name Server, resolution server) record.

解析值可以包括:网站服务器IP地址或解析服务器IP地址。The resolution value may include: the IP address of the website server or the IP address of the resolution server.

该域名解析信息还可以包括:网站服务器主机名、解析服务器主机名、域名解析信息生存时间或网站服务器域名设置说明。The domain name resolution information may also include: the host name of the website server, the host name of the resolution server, the survival time of the domain name resolution information or the description of the domain name setting of the website server.

在一些示例中,当预设私有映射表中保存的是不同邮件服务器的域名和对应的邮件服务器的域名解析信息时,该域名解析信息中的解析类型可以是:A(Address,地址)记录、CNAME(Canonical Name,规范名)记录、MX(Mail Exchanger,邮件交换)记录或NS(NameServer,解析服务器)记录,解析值可以包括:邮件服务器IP地址或解析服务器IP地址。In some examples, when the domain names of different mail servers and the domain name resolution information of the corresponding mail servers are stored in the preset private mapping table, the resolution type in the domain name resolution information may be: A (Address, address) record, CNAME (Canonical Name, canonical name) record, MX (Mail Exchanger, mail exchange) record or NS (NameServer, resolution server) record, the resolution value can include: mail server IP address or resolution server IP address.

该域名解析信息还可以包括:邮件服务器主机名、解析服务器主机名、域名解析信息生存时间或邮件服务器域名设置说明。The domain name resolution information may also include: mail server host name, resolution server host name, domain name resolution information survival time or mail server domain name setting instructions.

在通过步骤S201得到域名解析请求报文中携带的域名后,可以在预设私有映射表进行查询,查询与域名对应的域名解析信息。After the domain name carried in the domain name resolution request message is obtained through step S201, the domain name resolution information corresponding to the domain name can be queried in the preset private mapping table.

例如,如表1所示,表1为预设私有映射表,在表1中,保存有不同网站服务器的域名和对应的网站服务器的域名解析信息,在表1中,域名解析信息包括:解析类型、生存时间和解析值。For example, as shown in Table 1, Table 1 is a preset private mapping table. In Table 1, the domain names of different web servers and the domain name resolution information of the corresponding web servers are stored. In Table 1, the domain name resolution information includes: type, time-to-live, and parsed value.

例如:“abc.com”的域名解析类型为:A(Address,地址)记录,解析值为:网站服务器IP地址;生存时间:3600s。For example: the domain name resolution type of "abc.com" is: A (Address, address) record, and the resolution value is: IP address of the website server; survival time: 3600s.

bcd.com的域名解析类型为:CNAME(规范名字)记录,解析值:网站服务器主机名;生存时间:3600s。The domain name resolution type of bcd.com is: CNAME (canonical name) record, resolution value: host name of the website server; survival time: 3600s.

cde.com的域名解析类型为:NS(Name Server,解析服务器)记录,解析值:解析服务器主机名/IP地址;生存时间:3600s。The domain name resolution type of cde.com is: NS (Name Server, resolution server) record, resolution value: resolution server hostname/IP address; survival time: 3600s.

表1预设私有映射表Table 1 Default private mapping table

域名名称domain name 解析类型parsing type 生存时间(s)Survival time (s) 解析值parsing value abc.comabc.com AA 36003600 网站服务器IP地址Web server IP address bcd.combcd.com CNAMECNAME 36003600 网站服务器主机名Web server hostname cde.comcde.com NSNS 36003600 解析服务器主机名/IP地址Resolve server hostname/IP address

在一些示例中,该预设私有映射表可以是两张表,分别为预设一级域名表和预设二级域名表。如表2所示,为预设私有映射表中的预设一级域名表,在表2中,可以包括域名ID(identity,身份)、一级域名和生存时间。其中,域名ID是建立预设私有映射表时,由应用本发明实施例的域名解析方法的权威DNS服务器生成的ID,可以用来对不同域名进行区分。In some examples, the preset private mapping table may be two tables, namely a preset first-level domain name table and a preset second-level domain name table. As shown in Table 2, it is the preset first-level domain name table in the preset private mapping table. In Table 2, it may include domain name ID (identity, identity), first-level domain name and survival time. Wherein, the domain name ID is the ID generated by the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention when establishing the preset private mapping table, and can be used to distinguish different domain names.

表2预设私有映射表中的预设一级域名表Table 2 The default first-level domain name table in the default private mapping table

域名IDDomain ID 一级域名First-level domain name 生存时间(s)Survival time (s) 01022020102202 abc.comabc.com 8640086400 01022030102203 bcd.combcd.com 8640086400 01022040102204 cde.comcde.com 8640086400

如表3所示,为预设私有映射表中的预设二级域名表,在表3中,可以包括域名ID、二级域名、解析类型、生存时间以及解析值。其中,表3中的域名ID与表2中的域名ID相同。在表3中,包括域名ID、二级域名、解析类型、生存时间和解析值。As shown in Table 3, it is the preset second-level domain name table in the preset private mapping table. In Table 3, it may include domain name ID, second-level domain name, resolution type, survival time and resolution value. Wherein, the domain name ID in Table 3 is the same as the domain name ID in Table 2. In Table 3, domain name ID, second-level domain name, resolution type, survival time and resolution value are included.

表3预设私有映射表中的预设二级域名表Table 3 The default second-level domain name table in the default private mapping table

域名IDDomain ID 二级域名secondary domain 解析类型parsing type 生存时间(s)Survival time (s) 解析值parsing value 01022020102202 www.www. AA 8640086400 IP地址1IP address 1 01022030102203 www.www. AA 8640086400 IP地址2IP address 2 01022040102204 www.www. AA 8640086400 IP地址3IP address 3

例如,当应用本发明实施例的域名解析方法的权威DNS服务器,从域名解析请求报文中提取的域名为“www.abc.com”时,可以首先从表2所示的预设私有映射表中的预设一级域名表中获取与一级域名对应的域名ID,为“0102202”,然后,可以在表3所示的预设私有映射表中的预设二级域名表中,查找与域名ID“0102202”对应的解析类型、生存时间以及解析值,可以得到与域名“www.abc.com”对应的域名解析信息。当域名解析请求报文中携带有请求解析的解析类型时,通过如表3得到与该解析类型对应的解析值。例如,域名解析请求报文中携带的请求解析的解析类型为A(Address,地址)时,可以通过表3得到与域名“www.abc.com”对应的IP地址,为IP地址1。For example, when the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention extracts the domain name from the domain name resolution request message as "www.abc.com", it can firstly select the default private mapping table shown in Table 2 Obtain the domain name ID corresponding to the first-level domain name in the preset first-level domain name table in the table, which is "0102202", and then, in the preset second-level domain name table in the preset private mapping table shown in Table 3, search for the same The domain name resolution information corresponding to the domain name "www.abc.com" can be obtained from the resolution type, lifetime and resolution value corresponding to the domain name ID "0102202". When the domain name resolution request message carries the resolution type requested for resolution, the resolution value corresponding to the resolution type is obtained as shown in Table 3. For example, when the resolution type of the request resolution carried in the domain name resolution request message is A (Address, address), the IP address corresponding to the domain name "www.abc.com" can be obtained from Table 3, which is IP address 1.

在一些示例中,为了方便存储,在建立预设二级域名表时,将二级域名的“www.abc.com”中的“abc.com”省略,仅将“www.abc.com”中的“www.”存储在预设二级域名表中,以域名ID将预设一级域名表和预设二级域名表关联起来。通过预设私有映射表中的预设一级域名表和预设二级域名表可以得到域名“www.abc.com”对应的域名解析信息。In some examples, for the convenience of storage, when establishing the preset second-level domain name table, the "abc.com" in the "www.abc.com" of the second-level domain name is omitted, and only the "www.abc.com" in "www.abc.com" "www." is stored in the default second-level domain name table, and the default first-level domain name table and the default second-level domain name table are associated with the domain name ID. The domain name resolution information corresponding to the domain name "www.abc.com" can be obtained through the preset first-level domain name table and the preset second-level domain name table in the preset private mapping table.

在一些示例中,当应用本发明实施例的域名解析方法的权威DNS服务器,从域名解析请求报文中提取的域名为“www.bcd.com”时,可以通过查询表2和表3得到与该域名对应的IP地址,为IP地址2。In some examples, when the authoritative DNS server using the domain name resolution method of the embodiment of the present invention extracts the domain name from the domain name resolution request message as "www.bcd.com", it can be obtained by querying Table 2 and Table 3. The IP address corresponding to the domain name is IP address 2.

当应用本发明实施例的域名解析方法的权威DNS服务器,从域名解析请求报文中提取的域名为“www.cde.com”时,可以通过查询表2和表3得到与该域名对应的IP地址,为IP地址3。When applying the authoritative DNS server of the domain name resolution method of the embodiment of the present invention, when the domain name extracted from the domain name resolution request message is "www.cde.com", the IP corresponding to the domain name can be obtained by querying Table 2 and Table 3 address, which is IP address 3.

在一些示例中,该权威DNS服务器还可以将预设私有映射表中的预设一级域名表和预设二级域名表加载到内部存储器中,在接收到域名解析请求报文时,可以直接从内部存储器中,得到与该域名解析请求报文中携带的域名对应的域名解析信息,可以实现快速的查询和响应。In some examples, the authoritative DNS server can also load the preset first-level domain name table and the preset second-level domain name table in the preset private mapping table into the internal memory, and when receiving the domain name resolution request message, it can directly The domain name resolution information corresponding to the domain name carried in the domain name resolution request message is obtained from the internal memory, so that fast query and response can be realized.

在一些示例中,本发明实施例的预设私有映射表可以保存在数据库中,该数据库可以位于应用本发明实施例的域名解析方法的权威DNS服务器,也可以位于数据库服务器,通过通信接口与该权威DNS服务器实现通信。In some examples, the preset private mapping table in the embodiment of the present invention can be stored in a database, which can be located in the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention, or can be located in the database server, communicate with the Authoritative DNS server for communication.

通过在预设私有映射表中查询与域名对应的域名解析信息,实现了通过域名直接解析到域名解析信息,对域名解析请求进行细粒度解析,不需要通过现有技术中的多个节点逐级解析,得到域名解析信息。并且通过本步骤,降低了解析域名消耗的时间,提高了域名解析精确度。By querying the domain name resolution information corresponding to the domain name in the preset private mapping table, the domain name resolution information can be directly resolved through the domain name, and the domain name resolution request can be fine-grained without going through multiple nodes in the prior art. Analyze to get domain name resolution information. And through this step, the time consumed for resolving the domain name is reduced, and the resolution accuracy of the domain name is improved.

S203,在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。S203, when the domain name resolution information corresponding to the domain name is queried, send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address.

在一些示例中,在通过步骤S202得到与域名对应的域名解析信息时,应用本发明实施例的域名解析方法的权威DNS服务器,可以将该域名解析信息和源IP地址添加到解析响应报文中,发送给与源IP地址对应的本地DNS服务器。In some examples, when the domain name resolution information corresponding to the domain name is obtained through step S202, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention may add the domain name resolution information and the source IP address to the resolution response message , sent to the local DNS server corresponding to the source IP address.

其中,这里的源IP地址在解析响应报文中为目的IP地址。Wherein, the source IP address here is the destination IP address in the parsing response message.

本发明实施例提供的域名解析方法,根据域名在预设私有映射表中查询到与域名对应的域名解析信息,在查询到与域名对应的域名解析信息时,根据源IP地址,发送携带有域名解析信息的解析相应报文给本地DNS服务器;可以实现通过域名直接解析到域名解析信息,对域名解析请求进行稳定高效地细粒度解析,提高了域名解析精确度,并且降低了解析域名消耗的时间,加速DNS解析。In the domain name resolution method provided by the embodiment of the present invention, the domain name resolution information corresponding to the domain name is queried in the preset private mapping table according to the domain name, and when the domain name resolution information corresponding to the domain name is queried, according to the source IP address, a The corresponding message of the resolution information is sent to the local DNS server; it can directly resolve the domain name resolution information through the domain name, perform stable and efficient fine-grained resolution of the domain name resolution request, improve the accuracy of domain name resolution, and reduce the time consumed by domain name resolution , to speed up DNS resolution.

在一些示例中,在获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址时,可以对域名解析请求报文进行检测,具体的,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,可以包括:In some examples, when obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, the domain name resolution request message can be detected. Specifically, the domain name resolution request message sent by the local DNS server can be obtained. The domain name and source IP address carried in the text may include:

第一步,获取本地DNS服务器发送的域名解析请求报文,并检测域名解析请求报文是否有标记位;The first step is to obtain the domain name resolution request message sent by the local DNS server, and detect whether the domain name resolution request message has a flag;

第二步,在域名解析请求报文没有标记位时,获取域名解析请求报文中携带的本地DNS服务器IP地址和域名;In the second step, when the domain name resolution request message does not have a marker bit, obtain the local DNS server IP address and the domain name carried in the domain name resolution request message;

第三步,在域名解析请求报文有标记位时,获取域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。The third step is to obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message when the domain name resolution request message has a flag bit.

在本步骤中,可以通过检测域名解析请求报文中是否有标记位,判断该域名解析请求报文是否支持EDNS,其中,EDNS为DNS协议的扩展协议。该协议支持将客户端IP地址添加到域名解析请求报文中。In this step, it may be determined whether the domain name resolution request message supports EDNS by detecting whether there is a flag in the domain name resolution request message, wherein EDNS is an extension protocol of the DNS protocol. This protocol supports adding the client IP address to the domain name resolution request message.

在一些示例中,在检测域名解析请求报文中是否有标记位时,可以检测域名解析请求报文中是否有附加记录,在域名解析请求报文中有附加记录时,可以查看该附加记录的名称和附加记录类型,这里,附加记录的名称和附加记录类型可以是本发明实施例中的标记位。In some examples, when detecting whether there is a flag bit in the domain name resolution request message, it can be detected whether there is an additional record in the domain name resolution request message, and when there is an additional record in the domain name resolution request message, you can view the additional record of the domain name resolution request message. A name and an additional record type. Here, the name of the additional record and the additional record type may be flag bits in this embodiment of the present invention.

例如,在该附加记录的名称为空,附加记录类型为41时,可以查看附加记录对应的选择码长度。在该选择码长度为8时,则可以获取到客户端的IP地址。For example, when the name of the additional record is empty and the type of the additional record is 41, the length of the selection code corresponding to the additional record can be checked. When the length of the selection code is 8, the IP address of the client can be obtained.

对于内容提供商的服务器,基于GSLB(Global Server Load Balance,全局服务器负载均衡)考虑,可以在不同的地理位置分别部署多个服务器,且每个服务器的IP地址不同,例如,可以为同一个网站在不同的地理位置分别部署多个服务器,且每个服务器的IP地址不同。For the servers of content providers, based on GSLB (Global Server Load Balance, global server load balancing), multiple servers can be deployed in different geographic locations, and the IP addresses of each server are different. For example, the same website can Multiple servers are deployed in different geographic locations, and each server has a different IP address.

针对上述情况,为了能够实现对域名的正确解析,本发明实施例还提供了一种实现方法,如图3所示,为本发明实施例的一种域名解析方法的第二种实施方式的流程图,该方法可以包括:In view of the above situation, in order to realize the correct resolution of the domain name, the embodiment of the present invention also provides an implementation method, as shown in FIG. 3 , which is the flow of the second implementation mode of a domain name resolution method in the embodiment of the present invention Figure, the method may include:

S301,获取域名解析请求报文中携带的本地DNS服务器IP地址和域名。S301. Obtain the IP address and domain name of the local DNS server carried in the domain name resolution request message.

在一些示例中,应用本发明实施例的域名解析方法的权威DNS服务器,在接收到本地DNS服务器发送的域名解析请求报文后,可以检测该域名解析请求报文的标志位,从而,可以判断该域名解析请求报文是否为支持EDNS协议的域名解析请求报文。In some examples, after receiving the domain name resolution request message sent by the local DNS server, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can detect the flag bit of the domain name resolution request message, thereby, can judge Whether the domain name resolution request message is a domain name resolution request message supporting the EDNS protocol.

在该域名解析请求报文不支持EDNS时,应用本发明实施例的域名解析方法的权威DNS服务器,可以在该域名解析请求报文中获取到本地DNS服务器IP地址和域名。When the domain name resolution request message does not support EDNS, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can obtain the local DNS server IP address and domain name in the domain name resolution request message.

S302,获取预设私有映射表中,保存的与域名对应的多个第一IP地址段。S302. Obtain a plurality of first IP address segments corresponding to the domain name stored in the preset private mapping table.

其中,第一IP地址段为多个本地DNS服务器IP地址的集合,该第一IP地址段可以是预先按照一定规则划分的IP地址段,例如,可以按照地理位置划分IP地址段,也可以按照各服务器的具体业务划分IP地址段。该第一IP地址段可以以“起始IP地址—终止IP地址”的形式保存在预设私有映射表中。该预设私有映射表中还可以保存多个第一IP地址段,每个域名可以与多个第一IP地址段对应。Wherein, the first IP address segment is a collection of IP addresses of multiple local DNS servers, and the first IP address segment may be an IP address segment previously divided according to certain rules. The specific business of each server is divided into IP address segments. The first IP address segment may be stored in a preset private mapping table in the form of "start IP address-end IP address". The preset private mapping table may also store multiple first IP address segments, and each domain name may correspond to multiple first IP address segments.

具体的,在通过步骤S301得到域名后,可以在预设私有映射表中查找与域名对应的多个第一IP地址段。Specifically, after the domain name is obtained through step S301, a plurality of first IP address segments corresponding to the domain name may be searched in a preset private mapping table.

例如,可以对表1所示的预设私有映射表中的“abc.com”配置多个第一IP地址段,每个第一IP地址段配置不同的解析类型和对应的解析值。For example, multiple first IP address segments may be configured for "abc.com" in the preset private mapping table shown in Table 1, and each first IP address segment is configured with a different resolution type and corresponding resolution value.

如表4所示,为对“abc.com”配置多个第一IP地址段的预设私有映射表,在表4中,“abc.com”对应于多个第一IP地址段,分别为“起始IP地址1—终止IP地址1”、“起始IP地址2—终止IP地址2”和“起始IP地址3—终止IP地址3”。每个第一IP地址段可以配置有解析类型、生存时间和解析值。例如,第一IP地址段“起始IP地址1—终止IP地址1”对应的解析类型为A,生存时间为86400s,解析值为网站服务器1IP地址。As shown in Table 4, in order to configure the preset private mapping tables of multiple first IP address segments for "abc.com", in Table 4, "abc.com" corresponds to multiple first IP address segments, respectively "Start IP address 1—end IP address 1", "start IP address 2—end IP address 2" and "start IP address 3—end IP address 3". Each first IP address segment may be configured with a resolution type, a lifetime and a resolution value. For example, the resolution type corresponding to the first IP address segment "starting IP address 1-ending IP address 1" is A, the lifetime is 86400s, and the resolution value is the IP address of the website server 1.

表4对“abc.com”配置多个第一IP地址段的预设私有映射表Table 4 The default private mapping table for configuring multiple first IP address segments for "abc.com"

假设,“abc.com”为请求解析的域名,在本步骤中,可以将与“abc.com”对应的“起始IP地址1—终止IP地址1”、“起始IP地址2—终止IP地址2”和“起始IP地址3—终止IP地址3”,确定为与域名对应的多个第一IP地址段。Assuming that "abc.com" is the domain name requested for resolution, in this step, the "start IP address 1-end IP address 1" and "start IP address 2-end IP address" corresponding to "abc.com" can be Address 2" and "starting IP address 3-terminating IP address 3" are determined as a plurality of first IP address segments corresponding to the domain name.

S303,在多个第一IP地址段中,确定与本地DNS服务器IP地址对应的第一IP地址段为第一目标IP地址段。S303. Among the multiple first IP address segments, determine the first IP address segment corresponding to the IP address of the local DNS server as the first target IP address segment.

在一些示例中,在得到与请求解析的域名对应的多个第一IP地址段后,可以查看本地DNS服务器IP地址包含于多个第一IP地址段中的哪个IP地址段。然后可以将包含该本地DNS服务器IP地址的第一IP地址段确定为第一目标IP地址段。In some examples, after obtaining multiple first IP address segments corresponding to the domain name requested to be resolved, it may be checked which IP address segment the IP address of the local DNS server is included in the multiple first IP address segments. Then the first IP address segment including the IP address of the local DNS server may be determined as the first target IP address segment.

假设,本地DNS服务器IP地址包含于“起始IP地址2—终止IP地址2”的第一IP地址段,则可以将“起始IP地址2—终止IP地址2”确定为第一目标IP地址段。Assuming that the local DNS server IP address is included in the first IP address segment of "start IP address 2-end IP address 2", then "start IP address 2-end IP address 2" can be determined as the first target IP address part.

S304,将预设私有映射表中,与第一目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。S304. Determine the domain name resolution information corresponding to the first target IP address segment in the preset private mapping table as the domain name resolution information corresponding to the domain name.

在得到第一目标IP地址后,可以在预设私有映射表中查找与第一目标IP地址段对应的域名解析信息。在查找到与第一目标IP地址段对应的域名解析信息后,可以将该域名解析信息确定为与域名对应的域名解析信息。After obtaining the first target IP address, domain name resolution information corresponding to the first target IP address segment can be searched in the preset private mapping table. After the domain name resolution information corresponding to the first target IP address segment is found, the domain name resolution information may be determined as domain name resolution information corresponding to the domain name.

例如,在通过上述步骤S303将“起始IP地址2—终止IP地址2”确定为第一目标IP地址段后,可以在表4中查找与“起始IP地址2—终止IP地址2”对应的域名解析信息,具体的,在表4中,“起始IP地址2—终止IP地址2”对应的解析类型为A,也就是说,表4中记录的是与请求解析的域名“abc.com”对应的网站服务器1IP地址。因此,可以将“网站服务器1IP地址”确定为与域名对应的域名解析信息。For example, after the "starting IP address 2-ending IP address 2" is determined as the first target IP address segment through the above step S303, you can search in Table 4 corresponding to the "starting IP address 2-ending IP address 2" Specifically, in Table 4, the resolution type corresponding to "starting IP address 2-ending IP address 2" is A, that is to say, what is recorded in Table 4 is the domain name "abc. com" corresponds to the IP address of the web server 1. Therefore, the "website server 1 IP address" can be determined as the domain name resolution information corresponding to the domain name.

S305,发送携带有域名解析信息的解析响应报文给本地DNS服务器。S305. Send a resolution response message carrying domain name resolution information to the local DNS server.

在一些示例中,在通过上述步骤得到与域名对应的域名解析信息后,应用本发明实施例的域名解析方法的权威DNS服务器,可以将该域名解析信息和本地DNS服务器的IP地址添加到解析响应报文中,发送给本地DNS服务器。In some examples, after obtaining the domain name resolution information corresponding to the domain name through the above steps, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can add the domain name resolution information and the IP address of the local DNS server to the resolution response In the message, it is sent to the local DNS server.

其中,这里的本地DNS服务器的IP地址为解析响应报文的目的IP地址。Wherein, the IP address of the local DNS server here is the destination IP address of the parsing response message.

在现有技术中,各大DNS域名服务商是对IP库进行拆分,从而拆分出基于地理位置的解析线路,粒度最大也不过是省、市以及运营商,这对于普通的DNS解析足够了,但是,对于高速发展的CDN和视频云服务,现有技术的粗粒度的解析并不能满足用户对网路速度和服务质量的要求。In the existing technology, the major DNS domain name service providers split the IP database, so as to split the analysis line based on the geographical location. The largest granularity is only the province, city and operator, which is enough for ordinary DNS resolution. However, for the rapid development of CDN and video cloud services, the coarse-grained analysis of the existing technology cannot meet the user's requirements for network speed and service quality.

通过本发明实施例的域名解析方法,将域名、域名解析信息与IP地址段进行绑定,能够实现得到与本地DNS服务器最近的目标服务器的域名解析信息,并且将该域名解析信息返回给本地DNS服务器,从而可以使得用户可以访问与客户端最近的目标服务器,实现根据本地DNS服务器的IP地址对域名的精准调度解析,这里的目标服务器可以是客户端访问网站的网站服务器,或者向目标电子邮箱发送电子邮件时,目标电子邮箱的邮件服务器,例如,提供视频服务的网站服务器或者提供CDN(Content Delivery Network,内容分发网络)服务的服务器。Through the domain name resolution method of the embodiment of the present invention, the domain name and domain name resolution information are bound to the IP address segment, so that the domain name resolution information of the target server closest to the local DNS server can be obtained, and the domain name resolution information is returned to the local DNS Server, so that the user can access the target server closest to the client, and realize the precise scheduling and analysis of the domain name according to the IP address of the local DNS server. When sending an email, the mail server of the target email box, for example, a website server providing video services or a server providing CDN (Content Delivery Network, content distribution network) services.

在一些示例中,该预设私有映射表可以是两张表,分别为包含多个第一IP地址段的预设一级域名表和包含不同IP地址的预设二级域名表。In some examples, the preset private mapping table may be two tables, namely a preset first-level domain name table including multiple first IP address segments and a preset second-level domain name table including different IP addresses.

如表5所示,为包含多个第一IP地址段的预设一级域名表,在表5中,每个一级域名可以对应于不同的域名ID,不同的IP地址段和生存时间。如表6所示,为包含不同IP地址的预设二级域名表,在表6中,不同的域名ID可以对应不同的二级域名、解析类型、生存时间、和解析值。As shown in Table 5, it is a preset first-level domain name table including multiple first IP address segments. In Table 5, each first-level domain name may correspond to different domain name IDs, different IP address segments and lifetimes. As shown in Table 6, it is a preset second-level domain name table containing different IP addresses. In Table 6, different domain name IDs may correspond to different second-level domain names, resolution types, lifetimes, and resolution values.

假设,发送域名解析请求报文的本地DNS服务器请求解析的域名为“www.bcd.com”,应用本发明实施例的域名解析方法的权威DNS服务器,接收到该域名解析请求报文后,可以获取到域名“www.bcd.com”以及该本地DNS服务器的IP地址,然后,可以在表5所示的包含多个第一IP地址段的预设一级域名表中,查找与该本地DNS服务器对应的IP地址段。Assuming that the domain name requested by the local DNS server sending the domain name resolution request message to be resolved is "www.bcd.com", the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention, after receiving the domain name resolution request message, can Obtain the domain name "www.bcd.com" and the IP address of the local DNS server, and then, in the preset first-level domain name table containing multiple first IP address segments shown in Table 5, search for the domain name related to the local DNS IP address segment corresponding to the server.

假设,该本地DNS服务器的IP地址为“起始IP地址5—终止IP地址5”IP地址段中的一个IP地址,则本地DNS服务器的IP地址与“起始IP地址5—终止IP地址5”IP地址段对应。可以将“起始IP地址5—终止IP地址5”确定为第一目标IP地址段。然后,可以从表5中查找与“起始IP地址5—终止IP地址5”对应的域名ID,为“01022031”。Assuming that the IP address of the local DNS server is an IP address in the IP address range of "starting IP address 5 - ending IP address 5", then the IP address of the local DNS server is the same as "starting IP address 5 - ending IP address 5" "IP address segment corresponding. "Start IP address 5-end IP address 5" may be determined as the first target IP address segment. Then, the domain name ID corresponding to "starting IP address 5-ending IP address 5" can be searched from Table 5, which is "01022031".

例如,应用本发明实施例的域名解析方法的权威DNS服务器,可以根据该域名ID,从表6所示的包含不同IP地址的预设二级域名表中进行查找,得到与域名ID“01022031”对应的二级域名“ar.”,解析类型为A,生存时间为86400s,解析类型A对应的解析值为IP地址8。For example, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can search from the preset second-level domain name table containing different IP addresses shown in Table 6 according to the domain name ID, and obtain the domain name ID "01022031" The corresponding second-level domain name "ar." has resolution type A, lifetime is 86400s, and resolution value corresponding to resolution type A is IP address 8.

在一些示例中,这里为了方便存储,在建立预设二级域名表时,可以将二级域名的“ar.bcd.com”中的“bcd.com”省略,仅将“ar.bcd.com”中的“ar.”存储在预设二级域名表中,以域名ID将预设一级域名表和预设二级域名表关联起来。In some examples, for the convenience of storage, when creating the preset second-level domain name table, the "bcd.com" in the second-level domain name "ar.bcd.com" can be omitted, and only "ar.bcd.com The "ar." in " is stored in the preset second-level domain name table, and the default first-level domain name table and the preset second-level domain name table are associated with the domain name ID.

例如,通过查询表5和表6可以得到与本地DNS服务器IP地址对应的服务器的IP地址,并将该IP地址返回给本地DNS服务器。从而使得客户端可以访问二级域名为“ar.bcd.com”的服务器,实现对域名的调度解析。For example, by querying Table 5 and Table 6, the IP address of the server corresponding to the IP address of the local DNS server can be obtained, and the IP address is returned to the local DNS server. In this way, the client can access the server with the second-level domain name "ar.bcd.com", and realize the scheduling and resolution of the domain name.

表5包含多个第一IP地址段的预设一级域名表Table 5 contains a table of preset first-level domain names of multiple first IP address segments

域名IDDomain ID 一级域名First-level domain name IP地址段IP address segment 生存时间(s)Survival time (s) 0102202001022020 abc.comabc.com 起始IP地址1—终止IP地址1Start IP address 1—end IP address 1 8640086400 0102202101022021 abc.comabc.com 起始IP地址2—终止IP地址2Start IP address 2—end IP address 2 8640086400 0102202201022022 abc.comabc.com 起始IP地址3—终止IP地址3Start IP address 3—end IP address 3 8640086400 0102203001022030 bcd.combcd.com 起始IP地址4—终止IP地址4Start IP Address 4—End IP Address 4 8640086400 0102203101022031 bcd.combcd.com 起始IP地址5—终止IP地址5Start IP address 5—end IP address 5 8640086400 0102203201022032 bcd.combcd.com 起始IP地址6—终止IP地址6Start IP Address 6—End IP Address 6 8640086400 0102204001022040 cde.comcde.com 起始IP地址7—终止IP地址7Start IP address 7—end IP address 7 8640086400 0102204101022041 cde.comcde.com 起始IP地址8—终止IP地址8Start IP address 8—end IP address 8 8640086400 0102204201022042 cde.comcde.com 起始IP地址9—终止IP地址9Start IP address 9—end IP address 9 8640086400

表6包含不同IP地址的预设二级域名表Table 6 contains the default second-level domain name table of different IP addresses

域名IDDomain ID 二级域名secondary domain 解析类型parsing type 生存时间(s)Survival time (s) 解析值parsing value 0102202001022020 ef.ef. AA 8640086400 IP地址4IP address 4 0102202101022021 ar.ar. AA 8640086400 IP地址5IP address 5 0102202201022022 dg.dg. AA 8640086400 IP地址6IP address 6 0102203001022030 ef.ef. AA 8640086400 IP地址7IP address 7 0102203101022031 ar.ar. AA 8640086400 IP地址8IP address 8 0102203201022032 dg.dg. AA 8640086400 IP地址9IP address 9 0102204001022040 ef.ef. AA 8640086400 IP地址10IP address 10 0102204101022041 ar.ar. AA 8640086400 IP地址11IP address 11 0102204201022042 dg.dg. AA 8640086400 IP地址12IP address 12

但是,在一种可能的情况下,客户端可能会将域名解析请求报文发送到与客户端距离较远的本地DNS服务器,这样,会使得返回的目标服务器的域名解析信息。并不是距离客户端最近的目标服务器的域名解析信息。However, in a possible situation, the client may send the domain name resolution request message to a local DNS server far away from the client, so that the domain name resolution information of the target server will be returned. It is not the domain name resolution information of the target server closest to the client.

为了解决上述问题,本发明实施例还提供了一种实现方法,如图4所示,为本发明实施例的一种域名解析方法的第三种实施方式的流程图,该方法可以包括:In order to solve the above problems, the embodiment of the present invention also provides an implementation method, as shown in FIG. 4 , which is a flowchart of a third implementation mode of a domain name resolution method in the embodiment of the present invention. The method may include:

S401,获取域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。S401. Obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message.

在一些示例中,应用本发明实施例的域名解析方法的权威DNS服务器,在接收到本地DNS服务器发送的域名解析请求报文后,可以检测该域名解析请求报文的标志位,从而,可以判断该域名解析请求报文是否为支持EDNS协议的域名解析请求报文。In some examples, after receiving the domain name resolution request message sent by the local DNS server, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can detect the flag bit of the domain name resolution request message, thereby, can judge Whether the domain name resolution request message is a domain name resolution request message supporting the EDNS protocol.

在该域名解析请求报文支持EDNS时,应用本发明实施例的域名解析方法的权威DNS服务器,可以在该域名解析请求报文中获取到本地DNS服务器IP地址和域名和客户端IP地址。When the domain name resolution request message supports EDNS, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can obtain the local DNS server IP address and domain name and client IP address in the domain name resolution request message.

S402,获取预设私有映射表中,保存的与域名对应的多个第二IP地址段。S402. Obtain a plurality of second IP address segments corresponding to the domain name stored in the preset private mapping table.

其中,第二IP地址段为多个客户端IP地址的集合,该第二IP地址段可以是预先按照一定规则划分的IP地址段,例如,可以按照地理位置划分IP地址段,也可以按照各服务器的具体业务划分IP地址段。该第二IP地址段可以以“起始IP地址—终止IP地址”的形式保存在预设私有映射表中。该预设私有映射表中还可以保存多个第二IP地址段,每个域名可以与多个第二IP地址段对应。Wherein, the second IP address segment is a collection of multiple client IP addresses, and the second IP address segment may be an IP address segment that is pre-divided according to certain rules. The specific business of the server is divided into IP address segments. The second IP address segment may be stored in a preset private mapping table in the form of "starting IP address-terminating IP address". Multiple second IP address segments may also be stored in the preset private mapping table, and each domain name may correspond to multiple second IP address segments.

具体的,在通过步骤S401得到域名后,可以在预设私有映射表中查找与域名对应的多个第二IP地址段。Specifically, after the domain name is obtained in step S401, a plurality of second IP address segments corresponding to the domain name may be searched in a preset private mapping table.

S403,在多个第二IP地址段中,确定与客户端IP地址对应的第二IP地址段为第二目标IP地址段。S403. Among the multiple second IP address segments, determine that the second IP address segment corresponding to the client IP address is the second target IP address segment.

在得到与域名对应的多个第二IP地址段后,可以在多个第二IP地址段中查找与客户端IP地址对应的第二IP地址段,将该第二IP地址段确定为第二目标IP地址段。After obtaining multiple second IP address segments corresponding to the domain name, you can search for the second IP address segment corresponding to the client IP address in the multiple second IP address segments, and determine the second IP address segment as the second IP address segment. Destination IP address segment.

这里,该第二IP地址段中可以包括客户端IP地址。Here, the second IP address segment may include the IP address of the client.

S404,将预设私有映射表中,与第二目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。S404. Determine the domain name resolution information corresponding to the second target IP address segment in the preset private mapping table as the domain name resolution information corresponding to the domain name.

具体的,在建立预设私有映射表时,可以将与客户端距离最近的服务器的IP地址、主机名配置为第二目标IP地址段对应的域名解析信息。Specifically, when establishing the preset private mapping table, the IP address and host name of the server closest to the client may be configured as domain name resolution information corresponding to the second target IP address segment.

在一些示例中,在得到第二目标IP地址后,可以在预设私有映射表中查找与第二目标IP地址段对应的域名解析信息。在查找到与第二目标IP地址段对应的域名解析信息后,可以将该域名解析信息确定为与域名对应的域名解析信息。In some examples, after obtaining the second target IP address, domain name resolution information corresponding to the second target IP address segment may be searched in a preset private mapping table. After finding the domain name resolution information corresponding to the second target IP address segment, the domain name resolution information may be determined as domain name resolution information corresponding to the domain name.

S405,发送携带有域名解析信息的解析响应报文给本地DNS服务器。S405. Send a resolution response message carrying domain name resolution information to the local DNS server.

在一些示例中,在通过上述步骤得到与域名对应的域名解析信息后,应用本发明实施例的域名解析方法的权威DNS服务器,可以将该域名解析信息和本地DNS服务器的IP地址添加到解析响应报文中,发送给本地DNS服务器。In some examples, after obtaining the domain name resolution information corresponding to the domain name through the above steps, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention can add the domain name resolution information and the IP address of the local DNS server to the resolution response In the message, it is sent to the local DNS server.

其中,这里的本地DNS服务器的IP地址为解析响应报文的目的IP地址。Wherein, the IP address of the local DNS server here is the destination IP address of the parsing response message.

通过本发明实施例的域名解析方法,可以将解析调度的粒度精确到客户端IP地址,实现将与客户端最近的目标服务器的域名解析信息返回给本地DNS服务器,从而可以使得用户可以访问与客户端最近的网站服务器。实现对域名的精细化调度解析,这里的目标服务器为客户端访问网站的网站服务器,或者向目标电子邮箱发送电子邮件时,目标电子邮箱的邮件服务器。Through the domain name resolution method of the embodiment of the present invention, the granularity of resolution scheduling can be accurate to the client IP address, and the domain name resolution information of the target server closest to the client can be returned to the local DNS server, so that the user can access the domain name with the client. to the nearest web server. Realize fine-grained scheduling and analysis of the domain name, where the target server is the web server of the client accessing the website, or the mail server of the target email when sending an email to the target email.

在一些示例中,当在权威DNS服务器的预设私有映射表中,未查询到与域名对应的域名解析信息时,本发明实施例还提供了一种域名解析方法,如图5所示,为本发明实施例的一种域名解析方法的第四种实施方式的流程图,在根据域名,在预设私有映射表中查询与域名对应的域名解析信息之后,该方法还可以包括:In some examples, when the domain name resolution information corresponding to the domain name is not found in the preset private mapping table of the authoritative DNS server, the embodiment of the present invention also provides a domain name resolution method, as shown in FIG. 5 , which is A flowchart of a fourth implementation of a domain name resolution method according to an embodiment of the present invention. After querying the domain name resolution information corresponding to the domain name in the preset private mapping table according to the domain name, the method may further include:

S501,在未查询到与域名对应的域名解析信息时,发送携带有域名的域名解析请求报文至公共DNS服务器,使公共DNS服务器进行递归查询。S501. When no domain name resolution information corresponding to the domain name is found, send a domain name resolution request message carrying the domain name to the public DNS server, so that the public DNS server performs recursive query.

具体的,当在应用本发明实施例的域名解析方法的权威DNS服务器中未查询到与域名对应的域名解析信息时,该权威DNS服务器可以将该域名添加到一域名解析请求报文中,并发送给公共DNS服务器,使公共DNS服务器进行递归查询。Specifically, when the domain name resolution information corresponding to the domain name is not found in the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention, the authoritative DNS server can add the domain name to a domain name resolution request message, and Sent to the public DNS server, so that the public DNS server performs recursive query.

为了更清楚的说明公共DNS服务器进行递归查询的过程,下面结合图6进行说明,如图6所示,为本发明实施例的一种域名解析方法的公共DNS服务器的节点划分示意图。在图6中,可以包括根节点(Default)、一级子节点(电信、移动等)、叶子节点(华北电信、华南电信、华北网通、华南网通等),根节点、子节点和叶子结点可以构成一个树形结构,每个叶子节点绑定有对应的IP地址段,该IP地址段可以是包括本地DNS服务器IP地址的IP地址段,也可以是包括客户端IP地址的IP地址段。In order to more clearly illustrate the recursive query process of the public DNS server, the following will be described in conjunction with FIG. 6 . As shown in FIG. 6 , it is a schematic diagram of node division of the public DNS server in a domain name resolution method according to an embodiment of the present invention. In Figure 6, it can include root node (Default), first-level child nodes (telecom, mobile, etc.), leaf nodes (North China Telecom, South China Telecom, North China Netcom, South China Netcom, etc.), root node, child nodes and leaf nodes A tree structure can be formed, and each leaf node is bound to a corresponding IP address segment, and the IP address segment can be an IP address segment including the IP address of the local DNS server, or an IP address segment including the IP address of the client.

假设,公共DNS服务器在接收到该域名解析请求报文,并获取到该域名后,首先在“华北电信”节点的解析记录中查询,当在该节点中未查询到该域名对应的解析记录时,则在该节点的上级节点“电信”节点中进行查询,当在该“电信”节点中未查询到是,则在根节点“Default”中进行查询。直至查询到该域名对应的解析记录。Suppose, after the public DNS server receives the domain name resolution request message and obtains the domain name, it first inquires in the resolution record of the "North China Telecom" node. When the resolution record corresponding to the domain name is not found in the node , then query in the node’s superior node “Telecom” node, if no query is found in the “Telecom” node, then query in the root node “Default”. Until the resolution record corresponding to the domain name is found.

上述逐级向上查询的过程称为递归查询过程。The above step-by-step query process is called a recursive query process.

S502,获取公共DNS服务器通过递归查询得到的域名解析记录,发送携带有域名解析记录的解析响应报文给与源IP地址对应的本地DNS服务器。S502. Obtain the domain name resolution record obtained by the public DNS server through recursive query, and send a resolution response message carrying the domain name resolution record to the local DNS server corresponding to the source IP address.

其中,该源IP地址可以为本地DNS服务器的IP地址。Wherein, the source IP address may be an IP address of a local DNS server.

在一些示例中,在公共DNS服务器通过递归查询得到与域名对应的域名解析记录后,可以将该域名解析记录及本地DNS服务器的IP地址,添加到解析响应报文中,反馈给该本地DNS服务器。In some examples, after the public DNS server obtains the domain name resolution record corresponding to the domain name through recursive query, the domain name resolution record and the IP address of the local DNS server can be added to the resolution response message and fed back to the local DNS server .

通过本发明实施例,可以使得在预设私有映射表中未查询到与域名对应的域名解析信息时,可以在公共DNS服务器中逐级向上查询每个节点的域名解析记录,保证客户端能够得到与域名对应的域名解析信息。从而保证客户端能够正确访问网站,或者正确发送电子邮件,并且可以实现与现有的基于地理位置的域名解析调度的相辅相成、相互补充,使域名解析过程更加快速、高效。Through the embodiment of the present invention, when the domain name resolution information corresponding to the domain name is not queried in the preset private mapping table, the domain name resolution record of each node can be queried in the public DNS server level by level, ensuring that the client can obtain Domain name resolution information corresponding to the domain name. This ensures that the client can correctly access the website or send emails correctly, and can complement and complement each other with the existing geographical location-based domain name resolution scheduling, making the domain name resolution process faster and more efficient.

需要说明的是,应用本发明实施例的域名解析方法的权威DNS服务器,在接收到域名解析请求报文后,首先在预设私有映射表中查询,当在预设私有映射表中未查询到与请求解析的域名对应的域名解析信息时,再在公共DNS服务器中进行查询。可就是说,预设私有映射表的查询优先级高于公共DNS服务器。It should be noted that, after receiving the domain name resolution request message, the authoritative DNS server applying the domain name resolution method of the embodiment of the present invention first inquires in the preset private mapping table. When the domain name resolution information corresponding to the domain name requested for resolution is requested, it is queried in the public DNS server. That is to say, the query priority of the preset private mapping table is higher than that of the public DNS server.

具体的,在获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址之前,本发明实施例的域名解析方法,还可以包括:Specifically, before obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, the domain name resolution method in the embodiment of the present invention may also include:

第一步,获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段。The first step is to obtain the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments.

其中,第一IP地址段为多个本地DNS服务器IP地址的集合,第二IP地址段为多个客户端IP地址的集合。Wherein, the first IP address segment is a collection of multiple local DNS server IP addresses, and the second IP address segment is a collection of multiple client IP addresses.

在一些示例中,应用本发明实施例的域名解析方法的装置,可以通过应用程序编程接口获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段。例如,在终端上输入域名、域名解析信息、多个第一IP地址段或多个第二IP地址段后,可以通过API接口获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段。其中,该应用程序编程接口可以是API(Application Programming Interface,应用程序编程接口)接口,该API接口可以连接至终端,该终端可以是个人计算机。In some examples, the device applying the domain name resolution method of the embodiment of the present invention can obtain the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments through an application programming interface. For example, after inputting the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments on the terminal, the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments can be obtained through the API interface. The second IP address segment. Wherein, the application programming interface may be an API (Application Programming Interface, application programming interface) interface, and the API interface may be connected to a terminal, and the terminal may be a personal computer.

在一些示例中,应用本发明实施例的域名解析方法的装置,可以提供一个动态网页,用户可以在该动态网页中输入域名、域名解析信息、多个第一IP地址段或多个第二IP地址段,然后,应用本发明实施例的域名解析方法的装置可以通过提供的动态网页获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段。In some examples, the device applying the domain name resolution method of the embodiment of the present invention can provide a dynamic webpage, and the user can input the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments into the dynamic webpage address segment, and then, the device applying the domain name resolution method of the embodiment of the present invention can obtain the domain name, domain name resolution information, multiple first IP address segments or multiple second IP address segments through the provided dynamic web page.

具体的,可以在终端输入域名、域名解析信息、多个第一IP地址段,则本发明实施例的域名解析装置,可以通过API接口获取到域名、域名解析信息、多个第一IP地址段。Specifically, the domain name, domain name resolution information, and multiple first IP address segments can be input at the terminal, then the domain name resolution device in the embodiment of the present invention can obtain the domain name, domain name resolution information, and multiple first IP address segments through the API interface. .

也可以在终端输入域名、域名解析信息、多个第二IP地址段,则本发明实施例的域名解析装置可以通过API接口获取到域名、域名解析信息、多个第二IP地址段。It is also possible to input the domain name, domain name resolution information, and multiple second IP address segments at the terminal, then the domain name resolution device in the embodiment of the present invention can obtain the domain name, domain name resolution information, and multiple second IP address segments through the API interface.

第二步,建立域名与域名解析信息、多个第一IP地址段对应的预设私有映射表,或者建立域名与域名解析信息、多个第二IP地址段对应的预设私有映射表。The second step is to establish a preset private mapping table corresponding to the domain name and domain name resolution information and multiple first IP address segments, or to establish a preset private mapping table corresponding to domain name and domain name resolution information and multiple second IP address segments.

具体的,当本发明实施例的域名解析装置,通过API接口获取到域名、域名解析信息、多个第一IP地址段时,可以建立包括域名、域名解析信息、多个第一IP地址段的预设私有映射表;当本发明实施例的域名解析装置,可以通过API接口获取到域名、域名解析信息、多个第二IP地址段时,可以建立包括域名、域名解析信息、多个第二IP地址段的预设私有映射表。Specifically, when the domain name resolution device of the embodiment of the present invention obtains the domain name, domain name resolution information, and multiple first IP address segments through the API interface, it can establish a domain name, domain name resolution information, and multiple first IP address segments. Preset private mapping table; when the domain name resolution device of the embodiment of the present invention can obtain the domain name, domain name resolution information, and multiple second IP address segments through the API interface, it can establish domain name, domain name resolution information, and multiple second IP address segments. The preset private mapping table of the IP address segment.

通过本发明实施例的域名解析方法,可以在不同终端上远程自定义预设私有映射表,远程传输到应用本发明实施例的域名解析装置上。Through the domain name resolution method of the embodiment of the present invention, the preset private mapping table can be customized remotely on different terminals, and remotely transmitted to the domain name resolution device applying the embodiment of the present invention.

需要说明的是,在建立预设私有映射表后,还可以通过API接口对预设私有映射表中的内容进行修改、删除、添加、查询等操作。It should be noted that after the preset private mapping table is established, operations such as modifying, deleting, adding, and querying the contents of the preset private mapping table can also be performed through the API interface.

具体的,在建立预设私有映射表时,可以对预设私有映射表添加状态标识以进行标记,该状态标识用于对预设私有映射表进行区分。Specifically, when the preset private mapping table is established, a status identifier may be added to the preset private mapping table for marking, and the status identifier is used to distinguish the preset private mapping table.

例如,该状态标识可以是“0”、“1”,状态标识“1”表示预设私有映射表,状态标识“0”表示非预设私有映射表。For example, the status identifier may be "0" or "1", the status identifier "1" indicates a preset private mapping table, and the status identifier "0" indicates a non-preset private mapping table.

通过对预设私有映射表添加状态标识,可以方便管理人员对预设私有映射表和非预设私有映射表进行区分,从而方便管理人员的管理。By adding a state identifier to the preset private mapping table, it is convenient for the manager to distinguish the preset private mapping table from the non-preset private mapping table, thereby facilitating the management of the manager.

相应于上述方法实施例,本发明实施例还提供了一种域名解析装置,如图7所示,为本发明实施例的一种域名解析装置的结构示意图,该装置可以包括:Corresponding to the above method embodiment, the embodiment of the present invention also provides a domain name resolution device, as shown in FIG. 7 , which is a schematic structural diagram of a domain name resolution device according to the embodiment of the present invention. The device may include:

第一获取模块701,用于获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;The first acquiring module 701 is configured to acquire the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, where the source IP address includes the local DNS server IP address;

解析模块702,用于根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;The parsing module 702 is configured to query domain name resolution information corresponding to the domain name in the preset private mapping table according to the domain name, wherein the preset private mapping table stores the domain name and domain name resolution information corresponding to the domain name, and the domain name resolution information includes : The resolution type corresponding to the domain name and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and saved in the preset private mapping table;

响应模块703,用于在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。The response module 703 is configured to send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address when the domain name resolution information corresponding to the domain name is queried.

本发明实施例提供的域名解析装置,根据域名在预设私有映射表中查询到与域名对应的域名解析信息,在查询到与域名对应的域名解析信息时,根据源IP地址,发送携带有域名解析信息的解析相应报文给本地DNS服务器;可以实现通过域名直接解析到域名解析信息,对域名解析请求进行细粒度解析,提高了域名解析精确度,并且降低了解析域名消耗的时间。The domain name resolution device provided by the embodiment of the present invention queries the domain name resolution information corresponding to the domain name in the preset private mapping table according to the domain name. When the domain name resolution information corresponding to the domain name is found, according to the source IP address, it sends The resolution information of the resolution information is sent to the local DNS server; the domain name resolution information can be directly resolved through the domain name, and fine-grained resolution is performed on the domain name resolution request, which improves the accuracy of domain name resolution and reduces the time consumed by domain name resolution.

具体的,第一获取模块701,具体用于:Specifically, the first obtaining module 701 is specifically used for:

获取本地DNS服务器发送的域名解析请求报文,并检测域名解析请求报文是否有标记位;在域名解析请求报文没有标记位时,获取域名解析请求报文中携带的本地DNS服务器IP地址和域名;在域名解析请求报文有标记位时,获取域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。Obtain the domain name resolution request message sent by the local DNS server, and detect whether the domain name resolution request message has a flag bit; when the domain name resolution request message does not have a flag bit, obtain the local DNS server IP address and Domain name; when the domain name resolution request message has a flag bit, obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message.

具体的,预设私有映射表中还保存有多个第一IP地址段,解析模块802,包括:Specifically, a plurality of first IP address segments are also stored in the preset private mapping table, and the parsing module 802 includes:

第一获取子模块,用于获取预设私有映射表中保存的与域名对应的多个第一IP地址段,其中,第一IP地址段为多个本地DNS服务器IP地址的集合;The first obtaining submodule is used to obtain a plurality of first IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the first IP address segment is a collection of IP addresses of a plurality of local DNS servers;

第一确定子模块,用于在多个第一IP地址段中,确定与本地DNS服务器IP地址对应的第一IP地址段为第一目标IP地址段;The first determination submodule is used to determine, among the plurality of first IP address segments, that the first IP address segment corresponding to the IP address of the local DNS server is the first target IP address segment;

第一解析子模块,用于将预设私有映射表中、与第一目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。The first resolution sub-module is configured to determine domain name resolution information corresponding to the first target IP address segment in the preset private mapping table as domain name resolution information corresponding to the domain name.

具体的,第一IP地址段为按照地理位置划分的IP地址段,或者按照业务服务器的业务划分的IP地址段。Specifically, the first IP address segment is an IP address segment divided according to a geographical location, or an IP address segment divided according to a service of a service server.

具体的,预设私有映射表中还保存有多个第二IP地址段,解析模块802,还包括:Specifically, a plurality of second IP address segments are also stored in the preset private mapping table, and the parsing module 802 also includes:

第二获取子模块,用于获取预设私有映射表中保存的与域名对应的多个第二IP地址段,其中,第二IP地址段为多个客户端IP地址的集合;The second obtaining submodule is used to obtain multiple second IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the second IP address segment is a collection of multiple client IP addresses;

第二确定模块,用于在多个第二IP地址段中确定与客户端IP地址对应的第二IP地址段为第二目标IP地址段;A second determining module, configured to determine, among the plurality of second IP address segments, that the second IP address segment corresponding to the client IP address is the second target IP address segment;

第二解析子模块,用于将预设私有映射表中、与第二目标IP地址段对应的域名解析信息,确定为与域名对应的域名解析信息。The second resolution sub-module is configured to determine domain name resolution information corresponding to the second target IP address segment in the preset private mapping table as domain name resolution information corresponding to the domain name.

具体的,本发明实施例的域名解析装置还包括:Specifically, the domain name resolution device in the embodiment of the present invention also includes:

发送模块,用于在未查询到与域名对应的域名解析信息时,发送携带有域名的域名解析请求报文至公共DNS服务器,使公共DNS服务器进行递归查询;The sending module is used to send the domain name resolution request message carrying the domain name to the public DNS server when the domain name resolution information corresponding to the domain name is not found, so that the public DNS server performs recursive query;

响应模块703,还用于获取公共DNS服务器通过递归查询得到的域名解析记录,发送携带有域名解析记录的解析响应报文给与源IP地址对应的本地DNS服务器。The response module 703 is also used to obtain the domain name resolution records obtained by the public DNS server through recursive query, and send a resolution response message carrying the domain name resolution records to the local DNS server corresponding to the source IP address.

具体的,解析类型包括:地址记录、规范名记录、邮件交换记录或解析服务器记录;Specifically, the resolution type includes: address record, canonical name record, mail exchange record or resolution server record;

解析值可以包括:网站服务器IP地址、邮件服务器IP地址或解析服务器IP地址。The resolution value may include: the IP address of the website server, the IP address of the mail server or the IP address of the resolution server.

具体的,本发明实施例的域名解析装置,还可以包括:Specifically, the domain name resolution device in the embodiment of the present invention may also include:

预设私有映射表建立模块,用于通过应用程序编程接口获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段,建立域名与域名解析信息、多个第一IP地址段对应的预设私有映射表,或者建立域名与域名解析信息、多个第二IP地址段对应的预设私有映射表,其中,第一IP地址段为多个本地DNS服务器IP地址的集合,第二IP地址段为多个客户端IP地址的集合。The preset private mapping table building module is used to obtain domain names, domain name resolution information, multiple first IP address segments or multiple second IP address segments through application programming interfaces, and establish domain names and domain name resolution information, multiple first IP address segments A preset private mapping table corresponding to the address segment, or establishing a default private mapping table corresponding to the domain name and domain name resolution information, and multiple second IP address segments, wherein the first IP address segment is a collection of multiple local DNS server IP addresses , the second IP address segment is a collection of multiple client IP addresses.

具体的,预设私有映射表包括状态标识,状态标识用于对预设私有映射表进行区分。Specifically, the preset private mapping table includes a status identifier, and the status identifier is used to distinguish the preset private mapping table.

本发明实施例还提供了一种电子设备,如图8所示,为本发明实施例的一种域名解析方法应用于电子设备的结构示意图,该电子设备可以包括处理器810和机器可读存储介质820,机器可读存储介质820存储有能够被处理器810执行的机器可执行指令,处理器810被机器可执行指令促使:实现以下步骤:The embodiment of the present invention also provides an electronic device. As shown in FIG. 8 , it is a schematic structural diagram of a domain name resolution method applied to an electronic device according to an embodiment of the present invention. The electronic device may include a processor 810 and a machine-readable storage The medium 820, the machine-readable storage medium 820 stores machine-executable instructions that can be executed by the processor 810, and the processor 810 is prompted by the machine-executable instructions to: implement the following steps:

步骤A,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;Step A, obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address;

步骤B,根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;Step B, according to the domain name, query the domain name resolution information corresponding to the domain name in the preset private mapping table, wherein the domain name and domain name resolution information corresponding to the domain name are stored in the preset private mapping table, and the domain name resolution information includes: domain name correspondence The resolution type and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and saved in the preset private mapping table;

步骤C,在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。Step C, when the domain name resolution information corresponding to the domain name is queried, send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address.

机器可读存储介质820可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The machine-readable storage medium 820 may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one magnetic disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.

上述的处理器810可以是通用处理器,包括中央处理器(Central ProcessingUnit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(DigitalSignal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor 810 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

本发明实施例提供的应用域名解析方法的电子设备,根据域名在预设私有映射表中查询到与域名对应的域名解析信息,在查询到与域名对应的域名解析信息时,根据源IP地址,发送携带有域名解析信息的解析相应报文给本地DNS服务器;可以实现通过域名直接解析到域名解析信息,对域名解析请求进行细粒度解析,提高了域名解析精确度,并且降低了解析域名消耗的时间。In the electronic device applying the domain name resolution method provided by the embodiment of the present invention, the domain name resolution information corresponding to the domain name is queried in the preset private mapping table according to the domain name, and when the domain name resolution information corresponding to the domain name is queried, according to the source IP address, Send the corresponding resolution message carrying the domain name resolution information to the local DNS server; it can directly resolve the domain name resolution information through the domain name, perform fine-grained resolution on the domain name resolution request, improve the accuracy of domain name resolution, and reduce the consumption of domain name resolution time.

本发明实施例还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现以下方法:The embodiment of the present invention also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the following methods are implemented:

步骤A,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;Step A, obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address;

步骤B,根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;Step B, according to the domain name, query the domain name resolution information corresponding to the domain name in the preset private mapping table, wherein the domain name and domain name resolution information corresponding to the domain name are stored in the preset private mapping table, and the domain name resolution information includes: domain name correspondence The resolution type and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and stored in the preset private mapping table;

步骤C,在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。Step C, when the domain name resolution information corresponding to the domain name is queried, send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address.

本发明实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行以下方法:An embodiment of the present invention also provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the following method:

步骤A,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;Step A, obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address;

步骤B,根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;Step B, according to the domain name, query the domain name resolution information corresponding to the domain name in the preset private mapping table, wherein the domain name and domain name resolution information corresponding to the domain name are stored in the preset private mapping table, and the domain name resolution information includes: domain name correspondence The resolution type and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and stored in the preset private mapping table;

步骤C,在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。Step C, when the domain name resolution information corresponding to the domain name is queried, send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address.

第六方面,本发明实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行以下方法:In the sixth aspect, the embodiment of the present invention also provides a computer program, which, when running on a computer, causes the computer to perform the following method:

步骤A,获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,源IP地址包括本地DNS服务器IP地址;Step A, obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address;

步骤B,根据域名,在预设私有映射表中查询与域名对应的域名解析信息,其中,预设私有映射表中保存有域名和,与域名对应的域名解析信息,域名解析信息包括:域名对应的解析类型和解析类型对应的解析值,域名解析信息预先配置并保存在预设私有映射表中;Step B, according to the domain name, query the domain name resolution information corresponding to the domain name in the preset private mapping table, wherein the domain name and domain name resolution information corresponding to the domain name are stored in the preset private mapping table, and the domain name resolution information includes: domain name correspondence The resolution type and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and stored in the preset private mapping table;

步骤C,在查询到与域名对应的域名解析信息时,发送携带有域名解析信息的解析响应报文给与源IP地址对应的本地DNS服务器。Step C, when the domain name resolution information corresponding to the domain name is queried, send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiment.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.

Claims (16)

1.一种域名解析方法,其特征在于,所述方法包括:1. a domain name resolution method, is characterized in that, described method comprises: 获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,所述源IP地址包括本地DNS服务器IP地址;Obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address; 根据所述域名,在预设私有映射表中查询与所述域名对应的域名解析信息,其中,所述预设私有映射表中保存有所述域名和,与所述域名对应的所述域名解析信息,所述域名解析信息包括:所述域名对应的解析类型和所述解析类型对应的解析值,所述域名解析信息预先配置并保存在所述预设私有映射表中;According to the domain name, the domain name resolution information corresponding to the domain name is queried in the preset private mapping table, wherein the domain name and the domain name resolution corresponding to the domain name are stored in the preset private mapping table information, the domain name resolution information includes: the resolution type corresponding to the domain name and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and stored in the preset private mapping table; 在查询到与所述域名对应的域名解析信息时,发送携带有所述域名解析信息的解析响应报文,给与所述源IP地址对应的所述本地DNS服务器。When the domain name resolution information corresponding to the domain name is queried, a resolution response message carrying the domain name resolution information is sent to the local DNS server corresponding to the source IP address. 2.根据权利要求1所述的方法,其特征在于,所述获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,包括:2. The method according to claim 1, wherein said obtaining the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server comprises: 获取本地DNS服务器发送的域名解析请求报文,并检测所述域名解析请求报文是否有标记位;Obtain the domain name resolution request message sent by the local DNS server, and detect whether the domain name resolution request message has a flag; 在所述域名解析请求报文没有标记位时,获取所述域名解析请求报文中携带的本地DNS服务器IP地址和域名;When the domain name resolution request message has no flag bit, obtain the local DNS server IP address and domain name carried in the domain name resolution request message; 在所述域名解析请求报文有标记位时,获取所述域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。When the domain name resolution request message has a flag bit, obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message. 3.根据权利要求1或2所述的方法,其特征在于,所述预设私有映射表中还保存有多个第一IP地址段,所述根据所述域名,在预设私有映射表中查询与所述域名对应的域名解析信息,包括:3. The method according to claim 1 or 2, wherein a plurality of first IP address segments are also stored in the preset private mapping table, and according to the domain name, in the preset private mapping table Query the domain name resolution information corresponding to the domain name, including: 获取所述预设私有映射表中保存的与所述域名对应的多个第一IP地址段,其中,所述第一IP地址段为多个所述本地DNS服务器IP地址的集合;Obtaining multiple first IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the first IP address segment is a set of multiple IP addresses of the local DNS server; 在所述多个第一IP地址段中,确定与所述本地DNS服务器IP地址对应的第一IP地址段为第一目标IP地址段;Among the plurality of first IP address segments, determining that the first IP address segment corresponding to the IP address of the local DNS server is the first target IP address segment; 将所述预设私有映射表中,与所述第一目标IP地址段对应的域名解析信息,确定为与所述域名对应的域名解析信息。The domain name resolution information corresponding to the first target IP address segment in the preset private mapping table is determined as the domain name resolution information corresponding to the domain name. 4.根据权利要求3所述的方法,其特征在于,所述第一IP地址段为按照地理位置划分的IP地址段,或者按照业务服务器的业务划分的IP地址段。4. The method according to claim 3, wherein the first IP address segment is an IP address segment divided according to geographical location, or an IP address segment divided according to service of a service server. 5.根据权利要求2所述的方法,其特征在于,所述预设私有映射表中还保存有多个第二IP地址段,所述根据所述域名,在预设私有映射表中查询与所述域名对应的域名解析信息,包括:5. The method according to claim 2, wherein a plurality of second IP address segments are also stored in the preset private mapping table, and according to the domain name, query and The domain name resolution information corresponding to the domain name includes: 获取所述预设私有映射表中保存的,与所述域名对应的多个第二IP地址段,其中,所述第二IP地址段为多个所述客户端IP地址的集合;Obtaining multiple second IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the second IP address segment is a set of multiple client IP addresses; 在所述多个第二IP地址段中,确定与所述客户端IP地址对应的第二IP地址段为第二目标IP地址段;Among the plurality of second IP address segments, determining that the second IP address segment corresponding to the client IP address is the second target IP address segment; 将所述预设私有映射表中,与所述第二目标IP地址段对应的域名解析信息,确定为与所述域名对应的域名解析信息。The domain name resolution information corresponding to the second target IP address segment in the preset private mapping table is determined as the domain name resolution information corresponding to the domain name. 6.根据权利要求1所述的方法,其特征在于,所述解析类型包括:地址记录、规范名记录、邮件交换记录或解析服务器记录;6. The method according to claim 1, wherein the resolution type includes: address record, canonical name record, mail exchange record or resolution server record; 所述解析值包括:网站服务器IP地址、邮件服务器IP地址或解析服务器IP地址。The resolution value includes: the IP address of the website server, the IP address of the mail server or the IP address of the resolution server. 7.根据权利要求1所述的方法,其特征在于,在所述获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址之前,所述方法还包括:7. The method according to claim 1, wherein, before obtaining the domain name and the source IP address carried in the domain name resolution request message sent by the local DNS server, the method further comprises: 获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段,其中,所述第一IP地址段为多个本地DNS服务器IP地址的集合,所述第二IP地址段为多个客户端IP地址的集合;Obtain domain names, domain name resolution information, multiple first IP address segments or multiple second IP address segments, wherein the first IP address segments are a collection of multiple local DNS server IP addresses, and the second IP address segments It is a collection of multiple client IP addresses; 建立所述域名与所述域名解析信息、所述多个第一IP地址段对应的预设私有映射表,或者建立所述域名与所述域名解析信息、所述多个第二IP地址段对应的预设私有映射表。Establishing a preset private mapping table corresponding to the domain name and the domain name resolution information and the plurality of first IP address segments, or establishing a correspondence between the domain name and the domain name resolution information and the plurality of second IP address segments The default private mapping table for . 8.根据权利要求7所述的方法,其特征在于,所述预设私有映射表包括状态标识,所述状态标识用于对所述预设私有映射表进行区分。8. The method according to claim 7, wherein the preset private mapping table includes a status identifier, and the status identifier is used to distinguish the preset private mapping table. 9.一种域名解析装置,其特征在于,所述装置包括:9. A domain name resolution device, characterized in that the device comprises: 第一获取模块,用于获取本地DNS服务器发送的域名解析请求报文中携带的域名和源IP地址,其中,所述源IP地址包括本地DNS服务器IP地址;The first obtaining module is used to obtain the domain name and source IP address carried in the domain name resolution request message sent by the local DNS server, wherein the source IP address includes the local DNS server IP address; 解析模块,用于根据所述域名,在预设私有映射表中查询与所述域名对应的域名解析信息,其中,所述预设私有映射表中保存有所述域名和,与所述域名对应的所述域名解析信息,所述域名解析信息包括:所述域名对应的解析类型和所述解析类型对应的解析值,所述域名解析信息预先配置并保存在所述预设私有映射表中;A resolution module, configured to query domain name resolution information corresponding to the domain name in a preset private mapping table according to the domain name, wherein the preset private mapping table stores the domain name and the domain name corresponding to the domain name The domain name resolution information, the domain name resolution information includes: the resolution type corresponding to the domain name and the resolution value corresponding to the resolution type, the domain name resolution information is pre-configured and stored in the preset private mapping table; 响应模块,用于在查询到与所述域名对应的域名解析信息时,发送携带有所述域名解析信息的解析响应报文给与所述源IP地址对应的所述本地DNS服务器。A response module, configured to send a resolution response message carrying the domain name resolution information to the local DNS server corresponding to the source IP address when the domain name resolution information corresponding to the domain name is queried. 10.根据权利要求9所述的装置,其特征在于,所述第一获取模块,具体用于:10. The device according to claim 9, wherein the first acquiring module is specifically configured to: 获取本地DNS服务器发送的域名解析请求报文,并检测所述域名解析请求报文是否有标记位;在所述域名解析请求报文没有标记位时,获取所述域名解析请求报文中携带的本地DNS服务器IP地址和域名;在所述域名解析请求报文有标记位时,获取所述域名解析请求报文中携带的客户端IP地址、域名和本地DNS服务器IP地址。Obtain the domain name resolution request message sent by the local DNS server, and detect whether the domain name resolution request message has a flag; when the domain name resolution request message does not have a flag, obtain the Local DNS server IP address and domain name; when the domain name resolution request message has a flag bit, obtain the client IP address, domain name and local DNS server IP address carried in the domain name resolution request message. 11.根据权利要求9或10所述的装置,其特征在于,所述预设私有映射表中还保存有多个第一IP地址段,所述解析模块,包括:11. The device according to claim 9 or 10, wherein a plurality of first IP address segments are also stored in the preset private mapping table, and the parsing module includes: 第一获取子模块,用于获取所述预设私有映射表中,保存的与所述域名对应的多个第一IP地址段,其中,所述第一IP地址段为多个所述本地DNS服务器IP地址的集合;The first acquiring submodule is configured to acquire a plurality of first IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the first IP address segments are a plurality of the local DNS A collection of server IP addresses; 第一确定子模块,用于在所述多个第一IP地址段中,确定与所述本地DNS服务器IP地址对应的第一IP地址段为第一目标IP地址段;The first determining submodule is configured to determine, among the plurality of first IP address segments, that the first IP address segment corresponding to the IP address of the local DNS server is the first target IP address segment; 第一解析子模块,用于将所述预设私有映射表中、与所述第一目标IP地址段对应的域名解析信息,确定为与所述域名对应的域名解析信息。The first resolution submodule is configured to determine domain name resolution information corresponding to the first target IP address segment in the preset private mapping table as domain name resolution information corresponding to the domain name. 12.根据权利要求10所述的装置,其特征在于,所述预设私有映射表中还保存有多个第二IP地址段,所述解析模块,还包括:12. The device according to claim 10, wherein a plurality of second IP address segments are also stored in the preset private mapping table, and the parsing module further includes: 第二获取子模块,用于获取所述预设私有映射表中保存的与所述域名对应的多个第二IP地址段,其中,所述第二IP地址段为多个所述客户端IP地址的集合;The second acquiring submodule is configured to acquire multiple second IP address segments corresponding to the domain name stored in the preset private mapping table, wherein the second IP address segments are multiple client IPs a collection of addresses; 第二确定模块,用于在所述多个第二IP地址段中,确定与所述客户端IP地址对应的第二IP地址段为第二目标IP地址段;A second determining module, configured to, among the plurality of second IP address segments, determine that the second IP address segment corresponding to the client IP address is the second target IP address segment; 第二解析子模块,用于将所述预设私有映射表中,与所述第二目标IP地址段对应的域名解析信息,确定为与所述域名对应的域名解析信息。The second resolution submodule is configured to determine the domain name resolution information corresponding to the second target IP address segment in the preset private mapping table as domain name resolution information corresponding to the domain name. 13.根据权利要求9所述的装置,其特征在于,所述解析类型包括:地址记录、规范名记录、邮件交换记录或解析服务器记录;13. The device according to claim 9, wherein the resolution type includes: address record, canonical name record, mail exchange record or resolution server record; 所述解析值包括:网站服务器IP地址、邮件服务器IP地址或解析服务器IP地址。The resolution value includes: the IP address of the website server, the IP address of the mail server or the IP address of the resolution server. 14.根据权利要求9所述的装置,其特征在于,所述装置还包括:14. The device according to claim 9, further comprising: 预设私有映射表建立模块,用于获取域名、域名解析信息、多个第一IP地址段或多个第二IP地址段,建立所述域名与所述域名解析信息、所述多个第一IP地址段对应的预设私有映射表,或者建立所述域名与所述域名解析信息、所述多个第二IP地址段对应的预设私有映射表,其中,所述第一IP地址段为多个本地DNS服务器IP地址的集合,所述第二IP地址段为多个客户端IP地址的集合。The preset private mapping table establishment module is used to obtain domain names, domain name resolution information, multiple first IP address segments or multiple second IP address segments, and establish the domain name and the domain name resolution information, the multiple first IP address segments A preset private mapping table corresponding to the IP address segment, or establishing a preset private mapping table corresponding to the domain name, the domain name resolution information, and the plurality of second IP address segments, wherein the first IP address segment is A collection of multiple local DNS server IP addresses, and the second IP address segment is a collection of multiple client IP addresses. 15.一种电子设备,其特征在于,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器被所述机器可执行指令促使:实现权利要求1~8任一所述的方法步骤。15. An electronic device, characterized in that it includes a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is controlled by the The machine-executable instructions cause: implementing the method steps described in any one of claims 1-8. 16.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时,实现权利要求1~8任一项所述的方法步骤。16. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented step.
CN201710631292.2A 2017-07-28 2017-07-28 Domain name resolution method, device, electronic device and readable storage medium Pending CN108574744A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710631292.2A CN108574744A (en) 2017-07-28 2017-07-28 Domain name resolution method, device, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710631292.2A CN108574744A (en) 2017-07-28 2017-07-28 Domain name resolution method, device, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN108574744A true CN108574744A (en) 2018-09-25

Family

ID=63576146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710631292.2A Pending CN108574744A (en) 2017-07-28 2017-07-28 Domain name resolution method, device, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN108574744A (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347945A (en) * 2018-10-12 2019-02-15 北京天融信网络安全技术有限公司 A kind of method and apparatus of nslookup
CN109474712A (en) * 2018-11-06 2019-03-15 网宿科技股份有限公司 IP geographic information determining method, server and storage medium
CN109768980A (en) * 2019-01-16 2019-05-17 深圳市创维软件有限公司 Server access method, apparatus, mobile terminal and computer readable storage medium
CN109905239A (en) * 2019-03-07 2019-06-18 亚数信息科技(上海)有限公司 A kind of certificate management method and device
CN110535930A (en) * 2019-08-22 2019-12-03 网宿科技股份有限公司 A kind of dispatching method and system of edge C DN node
CN111277461A (en) * 2020-01-19 2020-06-12 杭州安恒信息技术股份有限公司 Method, system and equipment for identifying content distribution network node
CN111629079A (en) * 2020-04-29 2020-09-04 四川速宝网络科技有限公司 System and device for realizing network access acceleration
CN111885216A (en) * 2020-07-15 2020-11-03 北京青云科技股份有限公司 DNS query method, apparatus, device and storage medium
CN111885221A (en) * 2020-07-31 2020-11-03 北京微步在线科技有限公司 Internet exit IP (Internet protocol) acquisition method, server and system
CN111935270A (en) * 2020-08-04 2020-11-13 腾讯科技(深圳)有限公司 Communication method, device, medium and electronic equipment based on edge computing platform
CN112015910A (en) * 2020-08-20 2020-12-01 恒安嘉新(北京)科技股份公司 Method and device for generating domain name knowledge base, computer equipment and storage medium
CN112187965A (en) * 2020-09-04 2021-01-05 上海七牛信息技术有限公司 Domain name resolution method and system for hiding manufacturer information
CN112333299A (en) * 2021-01-04 2021-02-05 观脉科技(北京)有限公司 Domain name resolution method, configuration method and equipment
CN112769967A (en) * 2019-10-21 2021-05-07 阿里巴巴集团控股有限公司 Domain name resolution processing method and device and electronic equipment
CN113067909A (en) * 2020-01-02 2021-07-02 中国移动通信有限公司研究院 Edge node addressing method, device, device and storage medium
CN114500460A (en) * 2021-12-27 2022-05-13 天翼云科技有限公司 CDN network and automatic scheduling method for node return upper layer request thereof
CN114785753A (en) * 2022-05-05 2022-07-22 上海道客网络科技有限公司 Domain name resolution method, system, medium and electronic device of container cloud platform
CN115378906A (en) * 2022-08-16 2022-11-22 北京轻网科技股份有限公司 VPN framework-based local DNS proxy method, device, equipment and medium
CN115801729A (en) * 2022-11-15 2023-03-14 北京有竹居网络技术有限公司 DNS request processing method and device, electronic equipment and storage medium
CN116405460A (en) * 2023-05-09 2023-07-07 北京有竹居网络技术有限公司 Domain name resolution method, device, electronic device and storage medium for content distribution network
CN116489128A (en) * 2023-06-02 2023-07-25 北京云宽志业网络技术有限公司 Domain name resolution method and electronic device
CN115442329B (en) * 2021-06-04 2024-02-23 贵州白山云科技股份有限公司 Domain name information query method, system, device, equipment and storage medium
CN118018515A (en) * 2023-12-15 2024-05-10 中国移动通信集团有限公司 Domain name resolution record acquisition method, device and computer readable storage medium
CN119011380A (en) * 2024-10-24 2024-11-22 天翼视联科技有限公司 DNS analysis monitoring method and device, electronic device and storage medium
WO2024245073A1 (en) * 2023-06-02 2024-12-05 北京火山引擎科技有限公司 Content delivery network-based domain name resolution method and apparatus, device, and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101640684A (en) * 2009-08-21 2010-02-03 中国电信股份有限公司 Content delivering method, network system, GSLB device and domain name server
CN101764747A (en) * 2009-12-24 2010-06-30 北京世纪互联宽带数据中心有限公司 Intelligent dispatching method, device and system of content delivery network flow
CN101989951A (en) * 2010-10-28 2011-03-23 北京瑞汛世纪科技有限公司 Method, system and equipment for selecting service node
CN102025793A (en) * 2010-01-22 2011-04-20 中国移动通信集团北京有限公司 Domain name resolution method and system and DNS in IP network
CN104168340A (en) * 2014-07-24 2014-11-26 深圳市腾讯计算机系统有限公司 Domain name resolution method, server, terminal and system
CN104519146A (en) * 2013-09-29 2015-04-15 中国电信股份有限公司 Method and system for domain name service based on user position
CN105516385A (en) * 2015-12-02 2016-04-20 传线网络科技(上海)有限公司 Domain name resolution method, server and system
CN105681491A (en) * 2016-04-08 2016-06-15 网宿科技股份有限公司 DNS (Domain Name Resolution) acceleration method, system and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101640684A (en) * 2009-08-21 2010-02-03 中国电信股份有限公司 Content delivering method, network system, GSLB device and domain name server
CN101764747A (en) * 2009-12-24 2010-06-30 北京世纪互联宽带数据中心有限公司 Intelligent dispatching method, device and system of content delivery network flow
CN102025793A (en) * 2010-01-22 2011-04-20 中国移动通信集团北京有限公司 Domain name resolution method and system and DNS in IP network
CN101989951A (en) * 2010-10-28 2011-03-23 北京瑞汛世纪科技有限公司 Method, system and equipment for selecting service node
CN104519146A (en) * 2013-09-29 2015-04-15 中国电信股份有限公司 Method and system for domain name service based on user position
CN104168340A (en) * 2014-07-24 2014-11-26 深圳市腾讯计算机系统有限公司 Domain name resolution method, server, terminal and system
CN105516385A (en) * 2015-12-02 2016-04-20 传线网络科技(上海)有限公司 Domain name resolution method, server and system
CN105681491A (en) * 2016-04-08 2016-06-15 网宿科技股份有限公司 DNS (Domain Name Resolution) acceleration method, system and device

Cited By (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347945A (en) * 2018-10-12 2019-02-15 北京天融信网络安全技术有限公司 A kind of method and apparatus of nslookup
CN109474712A (en) * 2018-11-06 2019-03-15 网宿科技股份有限公司 IP geographic information determining method, server and storage medium
CN109768980A (en) * 2019-01-16 2019-05-17 深圳市创维软件有限公司 Server access method, apparatus, mobile terminal and computer readable storage medium
CN109768980B (en) * 2019-01-16 2020-12-29 深圳市创维软件有限公司 Server access method, device, mobile terminal and computer readable storage medium
CN109905239A (en) * 2019-03-07 2019-06-18 亚数信息科技(上海)有限公司 A kind of certificate management method and device
CN110535930A (en) * 2019-08-22 2019-12-03 网宿科技股份有限公司 A kind of dispatching method and system of edge C DN node
US11323411B2 (en) 2019-08-22 2022-05-03 Wangsu Science & Technology Co., Ltd. Method and system for scheduling edge CDN node
CN112769967A (en) * 2019-10-21 2021-05-07 阿里巴巴集团控股有限公司 Domain name resolution processing method and device and electronic equipment
CN113067909A (en) * 2020-01-02 2021-07-02 中国移动通信有限公司研究院 Edge node addressing method, device, device and storage medium
CN111277461A (en) * 2020-01-19 2020-06-12 杭州安恒信息技术股份有限公司 Method, system and equipment for identifying content distribution network node
CN111277461B (en) * 2020-01-19 2021-12-24 杭州安恒信息技术股份有限公司 Method, system and equipment for identifying content distribution network node
CN111629079A (en) * 2020-04-29 2020-09-04 四川速宝网络科技有限公司 System and device for realizing network access acceleration
CN111629079B (en) * 2020-04-29 2023-02-28 四川速宝网络科技有限公司 System and device for realizing network access acceleration
CN111885216A (en) * 2020-07-15 2020-11-03 北京青云科技股份有限公司 DNS query method, apparatus, device and storage medium
CN111885221A (en) * 2020-07-31 2020-11-03 北京微步在线科技有限公司 Internet exit IP (Internet protocol) acquisition method, server and system
CN111935270A (en) * 2020-08-04 2020-11-13 腾讯科技(深圳)有限公司 Communication method, device, medium and electronic equipment based on edge computing platform
CN111935270B (en) * 2020-08-04 2025-06-06 腾讯科技(深圳)有限公司 Communication method, device, medium and electronic equipment based on edge computing platform
CN112015910B (en) * 2020-08-20 2024-05-17 恒安嘉新(北京)科技股份公司 Domain name knowledge base generation method and device, computer equipment and storage medium
CN112015910A (en) * 2020-08-20 2020-12-01 恒安嘉新(北京)科技股份公司 Method and device for generating domain name knowledge base, computer equipment and storage medium
CN112187965A (en) * 2020-09-04 2021-01-05 上海七牛信息技术有限公司 Domain name resolution method and system for hiding manufacturer information
CN112187965B (en) * 2020-09-04 2023-05-09 上海七牛信息技术有限公司 Domain name resolution method and system for hiding manufacturer information
CN112333299A (en) * 2021-01-04 2021-02-05 观脉科技(北京)有限公司 Domain name resolution method, configuration method and equipment
CN112333299B (en) * 2021-01-04 2021-12-28 观脉科技(北京)有限公司 Domain name resolution method, configuration method and equipment
CN115442329B (en) * 2021-06-04 2024-02-23 贵州白山云科技股份有限公司 Domain name information query method, system, device, equipment and storage medium
CN114500460A (en) * 2021-12-27 2022-05-13 天翼云科技有限公司 CDN network and automatic scheduling method for node return upper layer request thereof
CN114500460B (en) * 2021-12-27 2024-04-26 天翼云科技有限公司 CDN (content delivery network) and automatic scheduling method for node return upper layer requests of CDN
CN114785753A (en) * 2022-05-05 2022-07-22 上海道客网络科技有限公司 Domain name resolution method, system, medium and electronic device of container cloud platform
CN114785753B (en) * 2022-05-05 2023-10-27 上海道客网络科技有限公司 Domain name resolution method, system, medium and electronic equipment of container cloud platform
CN115378906B (en) * 2022-08-16 2024-02-13 北京轻网科技股份有限公司 Local DNS proxy method, device, equipment and medium based on VPN framework
CN115378906A (en) * 2022-08-16 2022-11-22 北京轻网科技股份有限公司 VPN framework-based local DNS proxy method, device, equipment and medium
CN115801729A (en) * 2022-11-15 2023-03-14 北京有竹居网络技术有限公司 DNS request processing method and device, electronic equipment and storage medium
CN116405460A (en) * 2023-05-09 2023-07-07 北京有竹居网络技术有限公司 Domain name resolution method, device, electronic device and storage medium for content distribution network
CN116489128A (en) * 2023-06-02 2023-07-25 北京云宽志业网络技术有限公司 Domain name resolution method and electronic device
CN116489128B (en) * 2023-06-02 2024-06-07 北京云宽志业网络技术有限公司 Domain name resolution method and electronic device
WO2024245073A1 (en) * 2023-06-02 2024-12-05 北京火山引擎科技有限公司 Content delivery network-based domain name resolution method and apparatus, device, and medium
US12341746B2 (en) 2023-06-02 2025-06-24 Beijing Volcano Engine Technology Co., Ltd. Domain name resolution method, device, and medium based on content delivery network
CN118018515B (en) * 2023-12-15 2024-10-29 中国移动通信集团有限公司 Domain name resolution record acquisition method and device and computer readable storage medium
CN118018515A (en) * 2023-12-15 2024-05-10 中国移动通信集团有限公司 Domain name resolution record acquisition method, device and computer readable storage medium
CN119011380A (en) * 2024-10-24 2024-11-22 天翼视联科技有限公司 DNS analysis monitoring method and device, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN108574744A (en) Domain name resolution method, device, electronic device and readable storage medium
JP7045104B2 (en) How to process data, devices and computer programs, and zone files for hierarchical Domain Name System
EP2700208B1 (en) Global traffic management using modified hostname
US9961164B2 (en) DNS overriding-based methods of accelerating content delivery
US9444759B2 (en) Service provider registration by a content broker
US20180205697A1 (en) Managing content delivery network service providers by a content broker
WO2021120969A1 (en) Domain name resolution method, domain name resolution server, and terminal device
US9740708B2 (en) Systems and methods for distance and performance based load balancing
CN102216923B (en) Request routing and use customer location information to update routing information
US8886750B1 (en) Alias resource record sets
US9686229B2 (en) Identifying an efficient destination server
CN103281409B (en) Based on mobile Internet domain name analytic method and the dns server of Transmission Control Protocol
US11025584B2 (en) Client subnet efficiency by equivalence class aggregation
CN108494891A (en) A kind of domain name analytic method, server and system
CN110071986A (en) A system for domain name resolution
CN113037855B (en) Multimedia access system, method, device, terminal and medium
CN108848205B (en) CNAME domain name resolution method for distinguishing IPv4 and IPv6
WO2008122230A1 (en) A method, device for storing domain name system records and a domain name parsing method and device
JP2011527043A (en) Routing requests that use network computing components
JP2011517193A (en) Method and system for requesting routing
CN103428302A (en) Domain name resolution method, domain name resolution server and domain name resolution system
CN107786678B (en) Domain name resolution method, device and system
CN106161667A (en) A kind of domain name analytic method and device
CN104092785A (en) Method for domain name registration and resolution, and resource access method and resource access device based on domain name
CN113608877A (en) Load balancing scheduling method for IPV4 and IPV6 resource pools of content providers

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180925