[go: up one dir, main page]

CN106470252B - Method for querying IP address by application program and communication terminal - Google Patents

Method for querying IP address by application program and communication terminal Download PDF

Info

Publication number
CN106470252B
CN106470252B CN201610871265.8A CN201610871265A CN106470252B CN 106470252 B CN106470252 B CN 106470252B CN 201610871265 A CN201610871265 A CN 201610871265A CN 106470252 B CN106470252 B CN 106470252B
Authority
CN
China
Prior art keywords
address
response packet
dns
truncated
dns response
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.)
Active
Application number
CN201610871265.8A
Other languages
Chinese (zh)
Other versions
CN106470252A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610871265.8A priority Critical patent/CN106470252B/en
Publication of CN106470252A publication Critical patent/CN106470252A/en
Application granted granted Critical
Publication of CN106470252B publication Critical patent/CN106470252B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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]

Landscapes

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

Abstract

The invention provides a method for inquiring an IP address by an application program and a communication terminal. The method for inquiring the IP address by the application program comprises the following steps: the application program sends inquiry information to a DNS (domain name server) by using UDP (user Datagram protocol) to inquire the IP address of the host name of the website; receiving a DNS response packet sent by the DNS server in response to the query information; judging whether the DNS response packet is truncated or not; when the DNS reply packet is truncated, attempting to connect to the DNS server using TCP; judging whether the DNS server is successfully connected by using TCP; attempting to access a secondary DNS server using UDP when connecting the DNS server using the TCP fails; determining whether accessing the secondary DNS server using UDP is successful; and returning the IP address to the application program when the auxiliary DNS server is successfully accessed by using UDP. The invention improves the success probability of IP address query.

Description

应用程序查询IP地址的方法及通信终端Method for querying IP address by application program and communication terminal

技术领域technical field

本发明涉及通信领域,具体涉及一种应用程序查询IP地址的方法及通信终端。The invention relates to the field of communications, in particular to a method for querying an IP address by an application program and a communication terminal.

背景技术Background technique

域名系统(Domain Name System,DNS)默认使用用户数据报协议(User DatagramProtocol,UDP)来传输。现在各个网站为了负载均衡,往往使用多个服务器,此网站的主机名(Hostname)对应多个IP地址。当DNS客户端(比如,Android手机)上安装的某应用程序需要查询网站主机名的IP地址时,通常采用递归查询的方式。此时,DNS服务器响应所述递归查询发出的DNS应答(answer)包偏大,从而比较容易超出UDP的承载能力。当DNS应答包超过512字节时,超出的部分就会被截断。当DNS客户端接收到被截断的DNS应答包时,则会尝试用传输控制协议(Transmission Control Protocol,TCP)连接DNS服务器。通过TCP连接DNS服务器时,则不会受到应答包大小的限制。但是,现有技术中,很多DNS服务器会拒绝TCP连接。当使用UDP和TCP从DNS服务器中均未获得IP地址的情况下,DNS客户端的所述应用程序则会通过TCP查询辅助DNS服务器以求获得所述IP地址,而现有技术中,通过TCP查询辅助DNS服务器不会查询成功,进而无法获得所述IP地址。The Domain Name System (DNS) uses the User Datagram Protocol (UDP) for transmission by default. Nowadays, various websites often use multiple servers for load balancing, and the hostname of this website corresponds to multiple IP addresses. When an application installed on a DNS client (for example, an Android phone) needs to query the IP address of a website hostname, a recursive query is usually used. At this time, the DNS response (answer) packet sent by the DNS server in response to the recursive query is too large, so it is easy to exceed the carrying capacity of the UDP. When the DNS reply packet exceeds 512 bytes, the excess part will be truncated. When the DNS client receives the truncated DNS response packet, it will try to connect to the DNS server using Transmission Control Protocol (TCP). When connecting to the DNS server through TCP, it is not limited by the size of the response packet. However, in the prior art, many DNS servers will refuse the TCP connection. When neither UDP nor TCP is used to obtain the IP address from the DNS server, the application program of the DNS client will query the secondary DNS server through TCP to obtain the IP address, while in the prior art, the application program of the DNS client will query the secondary DNS server through TCP. The secondary DNS server will not be successfully queried, and the IP address will not be obtained.

发明内容SUMMARY OF THE INVENTION

本发明提供了一种应用程序查询IP地址的方法,所述应用程序查询IP地址的方法包括:The present invention provides a method for an application program to query an IP address, and the method for an application program to query an IP address includes:

应用程序使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址;The application uses UDP to send query information to the DNS server to look up the IP address of the website hostname;

接收所述DNS服务器响应所述查询信息发出的DNS应答包;receiving a DNS response packet sent by the DNS server in response to the query information;

判断所述DNS应答包是否被截断;Determine whether the DNS response packet is truncated;

当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器;When the DNS response packet is truncated, use TCP to try to connect to the DNS server;

判断使用TCP连接所述DNS服务器是否成功;Determine whether using TCP to connect to the DNS server is successful;

当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器;When using the TCP to connect to the DNS server fails, use UDP to try to access the secondary DNS server;

判断使用UDP访问所述辅助DNS服务器是否成功;及determining whether access to the secondary DNS server using UDP was successful; and

当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给所述应用程序。When accessing the secondary DNS server using UDP is successful, the IP address is returned to the application.

其中,所述应用程序查询IP地址的方法还包括:Wherein, the method for the application to query the IP address further includes:

当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器;When using UDP to access the auxiliary DNS server is unsuccessful, use UDP to try to access the DNS server according to the truncated DNS response packet;

判断被截断的DNS应答包中是否含有IP地址;Determine whether the truncated DNS response packet contains an IP address;

当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。When the truncated DNS response packet contains an IP address, the IP address is obtained from the truncated DNS response packet, and the IP address is returned to the application.

其中,所述应用程序查询IP地址的方法还包括:Wherein, the method for the application to query the IP address further includes:

当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。When the truncated DNS response packet does not contain an IP address, the application program is prompted to fail to query the IP address.

其中,所述应用程序查询IP地址的方法包括:Wherein, the method for the application to query the IP address includes:

当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。When the DNS response packet is not truncated, the IP address is obtained from the DNS response packet, and the IP address is returned to the application.

其中,所述步骤“判断所述DNS应答包是否被截断”包括:Wherein, the step "judging whether the DNS response packet is truncated" includes:

读取所述DNS应答包中标志位的数字;Read the number of the flag bit in the DNS response packet;

判断所述DNS应答包中标志位的数字是否为1;及Determine whether the number of the flag bit in the DNS response packet is 1; and

当所述DNS应答包中标志位的数字为1时,所述DNS应答包被截断;否则,所述DNS应答包未被截断。When the number of the flag bit in the DNS response packet is 1, the DNS response packet is truncated; otherwise, the DNS response packet is not truncated.

相较于现有技术,本发明的应用程序查询IP地址的方法通过所述TCP连接所述DNS服务器失败时,采用UDP的方式尝试访问辅助DNS服务器。而现有技术中,在通过所述TCP连接所述DNS服务器失败时转用TCP的方式查询辅助DNS服务器。而,使用TCP的方式查询DNS辅助服务器和所述DNS辅助服务器所支持的协议冲突,加大了所述IP地址查询失败的概率。所述DNS辅助服务器默认支持的协议为UDP,即,所述DNS辅助服务器是支持UDP方式查询的。因此,本发明在通过所述TCP连接所述DNS服务器失败时,采用UDP的方式尝试访问辅助DNS服务器,提高了所述IP地址查询成功的概率。Compared with the prior art, when the method for querying the IP address of an application program of the present invention fails to connect to the DNS server through the TCP, the method of UDP is used to try to access the auxiliary DNS server. In the prior art, when the connection to the DNS server through the TCP fails, the auxiliary DNS server is queried by switching to the TCP. However, using the TCP method to query the DNS auxiliary server conflicts with the protocols supported by the DNS auxiliary server, which increases the probability of failure of the IP address query. The default protocol supported by the DNS auxiliary server is UDP, that is, the DNS auxiliary server supports query in UDP mode. Therefore, in the present invention, when the connection to the DNS server through the TCP fails, the UDP method is used to try to access the auxiliary DNS server, which improves the probability of the IP address query being successful.

本发明还提供了一种通信终端,所述通信终端包括:The present invention also provides a communication terminal, the communication terminal includes:

查询模块,用于使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址;The query module is used to send query information to the DNS server using UDP to query the IP address of the website host name;

接收模块,接收所述DNS服务器响应所述查询信息发出的DNS应答包;a receiving module, receiving a DNS response packet sent by the DNS server in response to the query information;

第一判断模块,用于判断所述DNS应答包是否被截断;The first judgment module is used for judging whether the DNS response packet is truncated;

连接模块,用于当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器;a connection module, used for trying to connect to the DNS server using TCP when the DNS response packet is truncated;

第二判断模块,用于判断使用TCP连接所述DNS服务器是否成功;The second judging module is used for judging whether the use of TCP to connect the DNS server is successful;

第一访问模块,用于当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器;The first access module is used to use UDP to try to access the secondary DNS server when the connection to the DNS server using the TCP fails;

第三判断模块,用于判断使用UDP访问所述辅助DNS服务器是否成功;及A third judging module for judging whether using UDP to access the auxiliary DNS server is successful; and

地址返回模块,用于当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给所述应用程序。The address returning module is configured to return the IP address to the application when the auxiliary DNS server is accessed successfully by using UDP.

其中,所述通信终端还包括:Wherein, the communication terminal further includes:

第二访问模块,用于当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器;及A second access module, configured to use UDP to attempt to access the DNS server according to the truncated DNS response packet when accessing the secondary DNS server using UDP is unsuccessful; and

第四判断模块,用于判断被截断的DNS应答包中是否含有IP地址;The fourth judgment module is used for judging whether the truncated DNS response packet contains an IP address;

其中,所述地址返回模块还用于当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。Wherein, the address returning module is further configured to obtain the IP address from the truncated DNS response packet when the truncated DNS response packet contains an IP address, and return the IP address to the application program.

其中,所述通信终端还包括:Wherein, the communication terminal further includes:

地址查询失败模块,用于当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。The address query failure module is used to prompt the application program to fail to query the IP address when the truncated DNS response packet does not contain an IP address.

其中,所述地址返回模块还用于当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。Wherein, the address return module is further configured to obtain an IP address from the DNS response packet when the DNS response packet is not truncated, and return the IP address to the application program.

其中,所述第一判断模块还包括:Wherein, the first judgment module further includes:

读取子模块,用于读取所述DNS应答包中标志位的数字;A reading submodule is used to read the number of the flag bit in the DNS response packet;

判断子模块,用于判断所述DNS应答包中标志位的数字是否为1;及Judging submodule for judging whether the number of the flag bit in the DNS response packet is 1; and

判定子模块,用于当所述DNS应答包中标志位的数字为1时,判定所述DNS应答包被截断;否则,判断所述DNS应答包未被截断。The determining submodule is configured to determine that the DNS response packet is truncated when the number of the flag bit in the DNS response packet is 1; otherwise, determine that the DNS response packet is not truncated.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying 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. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明一较佳实施方式中的应用程序查询IP地址的方法的流程图。FIG. 1 is a flowchart of a method for an application to query an IP address in a preferred embodiment of the present invention.

图2为本发明一较佳实施方式中的通信终端的结构示意图。FIG. 2 is a schematic structural diagram of a communication terminal in a preferred embodiment of the present invention.

图3为本发明另一较佳实施方式中的通信终端的结构示意图。FIG. 3 is a schematic structural diagram of a communication terminal in another preferred embodiment of the present invention.

具体实施方式Detailed ways

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

需要说明的是,在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。It should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. As used in the embodiments of the present invention and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

所述应用程序查询IP地址的方法应用于通信终端,用于查询网站主机名对应的IP地址。所述通信终端可以为但不限于具有通信功能的Android智能手机、互联网设备(Mobile Internet Device,MID),电子书,便携式播放站(Play Station Portable,PSP)或者个人数字助理(Personal Digital Assistant,PDA)等便携式电子设备。所述应用程序查询IP地址的方法包括但不仅限于以下步骤。The method for querying an IP address by an application program is applied to a communication terminal, and is used for querying the IP address corresponding to the hostname of a website. The communication terminal can be, but is not limited to, an Android smart phone with a communication function, an Internet device (Mobile Internet Device, MID), an e-book, a portable playback station (Play Station Portable, PSP) or a Personal Digital Assistant (Personal Digital Assistant, PDA) ) and other portable electronic devices. The method for the application to query the IP address includes but is not limited to the following steps.

步骤S101,应用程序使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址。其中,所述应用程序为安装在所述通信终端的应用程序。Step S101, the application sends query information to the DNS server by using UDP to query the IP address of the website host name. Wherein, the application program is an application program installed on the communication terminal.

步骤S102,接收所述DNS服务器响应所述查询信息发出的DNS应答包。当所述应用程序使用UDP向所述DNS服务器发出查询信息时,所述DNS服务器会响应所述查询信息并发出DNS应答包。Step S102: Receive a DNS response packet sent by the DNS server in response to the query information. When the application uses UDP to send query information to the DNS server, the DNS server will respond to the query information and send out a DNS response packet.

步骤S103,判断所述DNS应答包是否被截断。由于DNS服务器相应所述查询信息时是采用递归查询的方式,采用递归查询的方式会造成所述DNS应答包偏大,从而比较容易超过UDP的承载能力。当DNS应答包超过512字节时,超出的部分会被截断。当所述DNS应答包被截断时,进入步骤S104;当所述DNS应答包未被截断时,进入步骤S113。Step S103, judging whether the DNS response packet is truncated. Since the DNS server uses a recursive query method to correspond to the query information, the use of the recursive query method will cause the DNS response packet to be too large, thus easily exceeding the carrying capacity of the UDP. When the DNS reply packet exceeds 512 bytes, the excess part will be truncated. When the DNS response packet is truncated, go to step S104; when the DNS response packet is not truncated, go to step S113.

具体地,在本实施方式中,所述步骤S103包括如下步骤。Specifically, in this embodiment, the step S103 includes the following steps.

步骤I,读取所述DNS应答包中标志位的数字。Step 1, read the number of the flag bit in the DNS response packet.

步骤II,判断所述DNS应答包中标志位的数字是否为1。Step II, judging whether the number of the flag bit in the DNS response packet is 1.

步骤III,当所述DNS应答包中标志位的数字为1时,所述DNS应答包被截断;否则,所述DNS应答包未被截断。Step III, when the number of the flag bit in the DNS response packet is 1, the DNS response packet is truncated; otherwise, the DNS response packet is not truncated.

当所述DNS应答包被截断时,则所述DNS应答包中的标志位会被标志为1,以标识所述DNS应答包被截断。因此,可以通过所述DNS应答包中标志位的数字来判断所述DNS应答包是否被截断。When the DNS response packet is truncated, the flag bit in the DNS response packet will be marked as 1 to indicate that the DNS response packet is truncated. Therefore, whether the DNS response packet is truncated can be judged by the number of the flag bit in the DNS response packet.

步骤S104,当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器。在此步骤中,当所述DNS应答包被截断时,采用TCP尝试连接所述DNS服务器。通过TCP尝试连接所述DNS服务器时,所述DNS服务器针对采用TCP方式的查询信息做出反应产生的应答包则没有大小的限制。Step S104, when the DNS response packet is truncated, use TCP to try to connect to the DNS server. In this step, when the DNS response packet is truncated, TCP is used to try to connect to the DNS server. When trying to connect to the DNS server through TCP, the response packet generated by the DNS server in response to the query information in the TCP mode has no size limit.

步骤S105,判断使用TCP连接所述DNS服务器是否成功。当使用TCP连接所述DNS服务器失败时,则进入步骤S106;当使用TCP连接所述DNS服务器成功时,则进入步骤S114。Step S105, it is judged whether the connection to the DNS server using TCP is successful. When the connection to the DNS server using TCP fails, the process proceeds to step S106; when the connection to the DNS server using TCP is successful, the process proceeds to step S114.

步骤S106,当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器。此步骤中在通过所述TCP连接所述DNS服务器失败时,采用UDP的方式尝试访问辅助DNS服务器。而现有技术中,在通过所述TCP连接所述DNS服务器失败时转用TCP的方式查询辅助DNS服务器。而,使用TCP的方式查询DNS辅助服务器和所述DNS辅助服务器所支持的协议冲突,加大了所述IP地址查询失败的概率。所述DNS辅助服务器默认支持的协议为UDP,即,所述DNS辅助服务器是支持UDP方式查询的。因此,此步骤中在通过所述TCP连接所述DNS服务器失败时,采用UDP的方式尝试访问辅助DNS服务器,提高了所述IP地址查询成功的概率。Step S106, when using the TCP to connect to the DNS server fails, use UDP to try to access the secondary DNS server. In this step, when the connection to the DNS server through the TCP fails, an attempt is made to access the secondary DNS server in a UDP manner. In the prior art, when the connection to the DNS server through the TCP fails, the auxiliary DNS server is queried by switching to the TCP. However, using the TCP method to query the DNS auxiliary server conflicts with the protocols supported by the DNS auxiliary server, which increases the probability of failure of the IP address query. The default protocol supported by the DNS auxiliary server is UDP, that is, the DNS auxiliary server supports query in UDP mode. Therefore, in this step, when the connection to the DNS server through the TCP fails, an attempt is made to access the auxiliary DNS server by means of UDP, which increases the probability of the IP address query being successful.

步骤S107,判断使用UDP访问所述辅助DNS服务器是否成功。当使用UDP访问所述辅助DNS服务器成功时,进入步骤S108;当使用UDP访问所述辅助DNS服务器不成功时,进入步骤S109。Step S107, judging whether using UDP to access the auxiliary DNS server is successful. When using UDP to access the auxiliary DNS server is successful, go to step S108; when using UDP to access the auxiliary DNS server is unsuccessful, go to step S109.

步骤S108,当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给所述应用程序。Step S108, when using UDP to access the secondary DNS server successfully, return the IP address to the application.

步骤S109,当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器。Step S109, when using UDP to access the secondary DNS server is unsuccessful, try to access the DNS server by using UDP according to the truncated DNS response packet.

步骤S110,判断被截断的DNS应答包中是否含有IP地址。当被截断的DNS应答包中含有IP地址时,则进入步骤S111;当当被截断的DNS应答包中不含有IP地址时,则进入步骤S112。Step S110, judging whether the truncated DNS response packet contains an IP address. When the truncated DNS response packet contains an IP address, the process proceeds to step S111; when the truncated DNS response packet does not contain an IP address, the process proceeds to step S112.

步骤S111,当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。Step S111, when the truncated DNS response packet contains an IP address, obtain the IP address from the truncated DNS response packet, and return the IP address to the application.

虽然被截断的DNS应答包中的IP地址是被截断的,是不全面的,但是被截断的DNS应答包中仍然包括部分IP地址的,现有技术中当DNS客户端接收到被截断的DNS应答包时,会忽略被截断的DNS应答包中的IP地址,转由尝试用TCP连接DNS服务器,进而大大降低了DNS服务器被访问成功的概率。而本发明中,在根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器,可提高DNS服务器被访问成功的概率。Although the IP address in the truncated DNS response packet is truncated and incomplete, the truncated DNS response packet still includes some IP addresses. In the prior art, when the DNS client receives the truncated DNS When responding to the packet, the IP address in the truncated DNS response packet will be ignored, and instead it will try to connect to the DNS server using TCP, which greatly reduces the probability of the DNS server being successfully accessed. In the present invention, when the DNS server is attempted to be accessed using UDP according to the truncated DNS response packet, the probability of the DNS server being accessed successfully can be improved.

步骤S112,当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。Step S112, when the truncated DNS response packet does not contain an IP address, prompt the application program to fail in querying the IP address.

步骤S113,当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。Step S113, when the DNS response packet is not truncated, obtain an IP address from the DNS response packet, and return the IP address to the application.

步骤S114,当使用TCP连接所述DNS服务器成功时,将所述IP地址返回给所述应用程序。Step S114, when the connection to the DNS server using TCP is successful, the IP address is returned to the application.

下面结合本发明对应用程序查询IP地址的方法的介绍对本发明的通信终端进行介绍如下。请参阅图2,图2为本发明一较佳实施方式中的通信终端的结构示意图。所述通信终端可以为但不限于具有通信功能的Android智能手机、互联网设备,电子书,便携式播放站或者个人数字助理等便携式电子设备。所述通信终端10安装有应用程序,所述应用程序可以查询网站主机名对应的IP地址。所述通信终端10包括但不仅限于查询模块101、接收模块102、第一判断模块103、连接模块104、第二判断模块105、第一访问模块106、第三判断模块107及地址返回模块108。各个模块的功能详细介绍如下。The communication terminal of the present invention is described below in conjunction with the description of the method for querying an IP address by an application program of the present invention. Please refer to FIG. 2 , which is a schematic structural diagram of a communication terminal in a preferred embodiment of the present invention. The communication terminal may be, but is not limited to, a portable electronic device such as an Android smart phone with a communication function, an Internet device, an e-book, a portable playback station, or a personal digital assistant. The communication terminal 10 is installed with an application program, and the application program can query the IP address corresponding to the host name of the website. The communication terminal 10 includes but is not limited to a query module 101 , a receiving module 102 , a first judgment module 103 , a connection module 104 , a second judgment module 105 , a first access module 106 , a third judgment module 107 and an address return module 108 . The functions of each module are described in detail as follows.

所述查询模块101,用于使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址。The query module 101 is configured to use UDP to send query information to the DNS server to query the IP address of the website host name.

所述接收模块102,接收所述DNS服务器响应所述查询信息发出的DNS应答包。The receiving module 102 receives a DNS response packet sent by the DNS server in response to the query information.

所述第一判断模块103,用于判断所述DNS应答包是否被截断。The first judging module 103 is configured to judge whether the DNS response packet is truncated.

在本实施方式中,所述第一判断模块103还包括读取子模块1031、判断子模块1032及判定子模块1033。各个子模块的具体功能介绍如下。In this embodiment, the first determination module 103 further includes a reading sub-module 1031 , a determination sub-module 1032 and a determination sub-module 1033 . The specific functions of each sub-module are introduced as follows.

读取子模块1031,用于读取所述DNS应答包中标志位的数字。The reading sub-module 1031 is used to read the number of the flag bit in the DNS response packet.

判断子模块1032,用于判断所述DNS应答包中标志位的数字是否为1。The judging submodule 1032 is configured to judge whether the number of the flag bit in the DNS response packet is 1.

判定子模块1033,用于当所述DNS应答包中标志位的数字为1时,判定所述DNS应答包被截断;否则,判断所述DNS应答包未被截断。The determination sub-module 1033 is configured to determine that the DNS response packet is truncated when the number of the flag bit in the DNS response packet is 1; otherwise, determine that the DNS response packet is not truncated.

所述连接模块104,用于当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器。The connection module 104 is configured to use TCP to attempt to connect to the DNS server when the DNS response packet is truncated.

所述第二判断模块105,用于判断使用TCP连接所述DNS服务器是否成功。The second judging module 105 is used for judging whether the connection to the DNS server using TCP is successful.

所述第一访问模块106,用于当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器。The first access module 106 is configured to use UDP to attempt to access the secondary DNS server when the connection to the DNS server using the TCP fails.

所述第三判断模块107,用于判断使用UDP访问所述辅助DNS服务器是否成功。The third judging module 107 is used for judging whether using UDP to access the auxiliary DNS server is successful.

所述地址返回模块108,用于当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给所述应用程序。The address returning module 108 is configured to return the IP address to the application program when using UDP to access the secondary DNS server successfully.

在本实施方式中,所述通信终端10还包括第二访问模块109及第四判断模块110。所述第二访问模块109,用于当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器;及In this embodiment, the communication terminal 10 further includes a second access module 109 and a fourth judgment module 110 . The second access module 109 is configured to use UDP to attempt to access the DNS server according to the truncated DNS response packet when accessing the secondary DNS server using UDP is unsuccessful; and

所述第四判断模块110,用于判断被截断的DNS应答包中是否含有IP地址。The fourth judging module 110 is used for judging whether the truncated DNS response packet contains an IP address.

其中,所述地址返回模块108还用于当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。The address returning module 108 is further configured to obtain the IP address from the truncated DNS response packet when the truncated DNS response packet contains an IP address, and return the IP address to the application program.

在本实施方式中,所述通信终端10还包括地址查询失败模块111。In this embodiment, the communication terminal 10 further includes an address query failure module 111 .

所述地址查询失败模块111,用于当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。The address query failure module 111 is configured to prompt the application program to fail to query the IP address when the truncated DNS response packet does not contain an IP address.

在本实施方式中,所述地址返回模块108还用于当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。In this embodiment, the address returning module 108 is further configured to obtain an IP address from the DNS response packet when the DNS response packet is not truncated, and return the IP address to the application program.

请参阅图3,图3为本发明另一较佳实施方式中的通信终端的结构示意图。所述移动终端70安装有应用程序,所述应用程序可以查询网站主机名对应的IP地址。所述移动终端70可以包括:至少一个处理器701,例如中央处理器(central processing unit,CPU),至少一个网络接口704,用户接口703,存储器705,至少一个通信总线702以及显示屏706。其中,通信总线702用于实现这些组件之间的连接通信。其中,用户接口703可以包括显示屏(Display)706,可选用户接口703还可以包括标准的有线接口、无线接口。通信接口704可选的可以包括标准的有线接口(如数据线接口、网线接口等)、无线接口(如WI-FI接口、蓝牙接口、近场通讯接口)。存储器705可以是高速随机存取存储器(random access memory,RAM),也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器705可选的还可以是至少一个位于远离前述处理器701的存储装置。如图3所示,作为一种计算机存储介质的存储器705中可以包括操作系统、网络通信模块、用户接口模块以及查询IP地址方法的程序。Please refer to FIG. 3 , which is a schematic structural diagram of a communication terminal in another preferred embodiment of the present invention. The mobile terminal 70 is installed with an application program, and the application program can query the IP address corresponding to the host name of the website. The mobile terminal 70 may include: at least one processor 701 , such as a central processing unit (CPU), at least one network interface 704 , user interface 703 , memory 705 , at least one communication bus 702 and display screen 706 . Among them, the communication bus 702 is used to realize the connection and communication between these components. The user interface 703 may include a display screen (Display) 706, and the optional user interface 703 may also include a standard wired interface and a wireless interface. Optionally, the communication interface 704 may include a standard wired interface (eg, a data cable interface, a network cable interface, etc.), a wireless interface (eg, a WI-FI interface, a Bluetooth interface, a near field communication interface). The memory 705 may be a high-speed random access memory (RAM), or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 705 can optionally also be at least one storage device located away from the aforementioned processor 701 . As shown in FIG. 3 , the memory 705 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a program for a method of querying an IP address.

在图3所示的移动终端70中,处理器701可以用于调用存储器705中存储的查询IP地址的程序,并执行以下操作:In the mobile terminal 70 shown in FIG. 3, the processor 701 can be used to call the program for querying the IP address stored in the memory 705, and perform the following operations:

应用程序使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址。The application uses UDP to send query information to the DNS server to look up the IP address of the website hostname.

接收所述DNS服务器响应所述查询信息发出的DNS应答包。判断所述DNS应答包是否被截断。A DNS response packet sent by the DNS server in response to the query information is received. Determine whether the DNS response packet is truncated.

当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器。When the DNS reply packet is truncated, try to connect to the DNS server using TCP.

判断使用TCP连接所述DNS服务器是否成功。Determine whether the connection to the DNS server using TCP is successful.

当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器。When the connection to the DNS server using the TCP fails, an attempt is made to access the secondary DNS server using UDP.

判断使用UDP访问所述辅助DNS服务器是否成功。Determine whether accessing the secondary DNS server using UDP is successful.

当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给所述应用程序。When accessing the secondary DNS server using UDP is successful, the IP address is returned to the application.

当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器。When accessing the secondary DNS server using UDP is unsuccessful, using UDP attempts to access the DNS server according to the truncated DNS response packet.

判断被截断的DNS应答包中是否含有IP地址。Determine whether the truncated DNS response packet contains an IP address.

当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。When the truncated DNS response packet contains an IP address, the IP address is obtained from the truncated DNS response packet, and the IP address is returned to the application.

当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。When the truncated DNS response packet does not contain an IP address, the application program is prompted to fail to query the IP address.

当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。When the DNS response packet is not truncated, the IP address is obtained from the DNS response packet, and the IP address is returned to the application.

当使用TCP连接所述DNS服务器成功时,将所述IP地址返回给所述应用程序。When the connection to the DNS server using TCP is successful, the IP address is returned to the application.

具体地,在本实施方式中,处理器701调用存储器705中存储的查询IP方法的程序,并执行判断所述DNS应答包是否被截断的操作具体包括:Specifically, in this embodiment, the processor 701 invokes the program of the query IP method stored in the memory 705, and performs the operation of judging whether the DNS response packet is truncated, including:

读取所述DNS应答包中标志位的数字;Read the number of the flag bit in the DNS response packet;

判断所述DNS应答包中标志位的数字是否为1;Determine whether the number of the flag bit in the DNS response packet is 1;

当所述DNS应答包中标志位的数字为1时,所述DNS应答包被截断;否则,所述DNS应答包未被截断。When the number of the flag bit in the DNS response packet is 1, the DNS response packet is truncated; otherwise, the DNS response packet is not truncated.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,飞行模式开启程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random AccessMemory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing the relevant hardware through a computer program. The flight mode enabling program can be stored in a computer-readable storage medium. During execution, the processes of the embodiments of the above-mentioned methods may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.

以上所揭露的仅为本发明一种或多种较佳实施例而已,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The above disclosures are only one or more preferred embodiments of the present invention. The principles and implementations of the present invention are described by specific examples herein. The descriptions of the above embodiments are only used to help understand the present invention. method and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. Invention limitations.

Claims (12)

1.一种应用程序查询IP地址的方法,其特征在于,所述应用程序查询IP地址的方法包括:1. a method for querying an IP address by an application program, wherein the method for querying an IP address by the application program comprises: 应用程序使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址;The application uses UDP to send query information to the DNS server to look up the IP address of the website hostname; 接收所述DNS服务器响应所述查询信息发出的DNS应答包;receiving a DNS response packet sent by the DNS server in response to the query information; 判断所述DNS应答包是否被截断;Determine whether the DNS response packet is truncated; 当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器;When the DNS response packet is truncated, use TCP to try to connect to the DNS server; 判断使用TCP连接所述DNS服务器是否成功;Determine whether using TCP to connect to the DNS server is successful; 当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器;When using the TCP to connect to the DNS server fails, use UDP to try to access the secondary DNS server; 判断使用UDP访问所述辅助DNS服务器是否成功;及determining whether access to the secondary DNS server using UDP was successful; and 当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给所述应用程序。When accessing the secondary DNS server using UDP is successful, the IP address is returned to the application. 2.如权利要求1所述的应用程序查询IP地址的方法,其特征在于,所述应用程序查询IP地址的方法还包括:2. The method for querying an IP address by an application program as claimed in claim 1, wherein the method for querying an IP address by the application program further comprises: 当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器;When using UDP to access the auxiliary DNS server is unsuccessful, use UDP to try to access the DNS server according to the truncated DNS response packet; 判断被截断的DNS应答包中是否含有IP地址;Determine whether the truncated DNS response packet contains an IP address; 当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。When the truncated DNS response packet contains an IP address, obtain the IP address from the truncated DNS response packet, and return the IP address to the application. 3.如权利要求2所述的应用程序查询IP地址的方法,其特征在于,所述应用程序查询IP地址的方法还包括:3. The method for querying an IP address by an application program as claimed in claim 2, wherein the method for querying an IP address by the application program further comprises: 当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。When the truncated DNS response packet does not contain an IP address, the application program is prompted to fail to query the IP address. 4.如权利要求1所述的应用程序查询IP地址的方法,其特征在于,所述应用程序查询IP地址的方法包括:4. The method for querying an IP address by an application program as claimed in claim 1, wherein the method for querying an IP address by the application program comprises: 当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。When the DNS response packet is not truncated, the IP address is obtained from the DNS response packet, and the IP address is returned to the application. 5.如权利要求1所述的应用程序查询IP地址的方法,其特征在于,所述步骤“判断所述DNS应答包是否被截断”包括:5. The method for querying an IP address by an application program as claimed in claim 1, wherein the step "judging whether the DNS response packet is truncated" comprises: 读取所述DNS应答包中标志位的数字;Read the number of the flag bit in the DNS response packet; 判断所述DNS应答包中标志位的数字是否为1;及Determine whether the number of the flag bit in the DNS response packet is 1; and 当所述DNS应答包中标志位的数字为1时,所述DNS应答包被截断;否则,所述DNS应答包未被截断。When the number of the flag bit in the DNS response packet is 1, the DNS response packet is truncated; otherwise, the DNS response packet is not truncated. 6.一种通信终端,其特征在于,所述通信终端包括:6. A communication terminal, wherein the communication terminal comprises: 查询模块,用于使用UDP向DNS服务器发出查询信息以查询网站主机名的IP地址;The query module is used to send query information to the DNS server using UDP to query the IP address of the website host name; 接收模块,接收所述DNS服务器响应所述查询信息发出的DNS应答包;a receiving module, receiving a DNS response packet sent by the DNS server in response to the query information; 第一判断模块,用于判断所述DNS应答包是否被截断;The first judgment module is used for judging whether the DNS response packet is truncated; 连接模块,用于当所述DNS应答包被截断时,使用TCP尝试连接所述DNS服务器;a connection module, used for trying to connect to the DNS server using TCP when the DNS response packet is truncated; 第二判断模块,用于判断使用TCP连接所述DNS服务器是否成功;The second judging module is used for judging whether the use of TCP to connect the DNS server is successful; 第一访问模块,用于当使用所述TCP连接所述DNS服务器失败时,使用UDP尝试访问辅助DNS服务器;The first access module is used to use UDP to try to access the secondary DNS server when the connection to the DNS server using the TCP fails; 第三判断模块,用于判断使用UDP访问所述辅助DNS服务器是否成功;及A third judging module for judging whether using UDP to access the auxiliary DNS server is successful; and 地址返回模块,用于当使用UDP访问所述辅助DNS服务器成功时,将所述IP地址返回给应用程序。The address returning module is configured to return the IP address to the application when the auxiliary DNS server is successfully accessed by using UDP. 7.如权利要求6所述的通信终端,其特征在于,所述通信终端还包括:7. The communication terminal according to claim 6, wherein the communication terminal further comprises: 第二访问模块,用于当使用UDP访问所述辅助DNS服务器不成功时,根据被截断的DNS应答包使用UDP尝试访问所述DNS服务器;及a second access module, configured to use UDP to attempt to access the DNS server according to the truncated DNS response packet when accessing the secondary DNS server using UDP is unsuccessful; and 第四判断模块,用于判断被截断的DNS应答包中是否含有IP地址;The fourth judgment module is used for judging whether the truncated DNS response packet contains an IP address; 其中,所述地址返回模块还用于当被截断的DNS应答包中含有IP地址时,从被截断的DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。Wherein, the address returning module is further configured to obtain the IP address from the truncated DNS response packet when the truncated DNS response packet contains an IP address, and return the IP address to the application program. 8.如权利要求7所述的通信终端,其特征在于,所述通信终端还包括:8. The communication terminal according to claim 7, wherein the communication terminal further comprises: 地址查询失败模块,用于当被截断的DNS应答包中不含有IP地址时,提示所述应用程序查询IP地址失败。The address query failure module is used to prompt the application program to fail to query the IP address when the truncated DNS response packet does not contain an IP address. 9.如权利要求6所述的通信终端,其特征在于,所述地址返回模块还用于当所述DNS应答包未被截断时,从所述DNS应答包中获取IP地址,并将所述IP地址返回给所述应用程序。9. The communication terminal according to claim 6, wherein the address return module is further configured to obtain an IP address from the DNS response packet when the DNS response packet is not truncated, and return the DNS response packet to the The IP address is returned to the application. 10.如权利要求6所述的通信终端,其特征在于,所述第一判断模块还包括:10. The communication terminal according to claim 6, wherein the first judgment module further comprises: 读取子模块,用于读取所述DNS应答包中标志位的数字;A reading submodule is used to read the number of the flag bit in the DNS response packet; 判断子模块,用于判断所述DNS应答包中标志位的数字是否为1;及Judging submodule for judging whether the number of the flag bit in the DNS response packet is 1; and 判定子模块,用于当所述DNS应答包中标志位的数字为1时,判定所述DNS应答包被截断;否则,判断所述DNS应答包未被截断。A determination sub-module, configured to determine that the DNS response packet is truncated when the number of the flag bit in the DNS response packet is 1; otherwise, determine that the DNS response packet is not truncated. 11.一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质存储有计算机程序,所述计算机程序用于指令相关的硬件,来完成权利要求1至5任意一项所述的方法。11. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, and the computer program is used to instruct relevant hardware to complete any one of claims 1 to 5. method described. 12.一种移动终端,其特征在于,包括:存储器和至少一个处理器;处理器用于调用存储器中存储的查询IP地址的程序,以执行权利要求1至5任意一项所述的方法。12. A mobile terminal, comprising: a memory and at least one processor; the processor is configured to invoke a program for querying an IP address stored in the memory to execute the method of any one of claims 1 to 5.
CN201610871265.8A 2016-09-29 2016-09-29 Method for querying IP address by application program and communication terminal Active CN106470252B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610871265.8A CN106470252B (en) 2016-09-29 2016-09-29 Method for querying IP address by application program and communication terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610871265.8A CN106470252B (en) 2016-09-29 2016-09-29 Method for querying IP address by application program and communication terminal

Publications (2)

Publication Number Publication Date
CN106470252A CN106470252A (en) 2017-03-01
CN106470252B true CN106470252B (en) 2019-10-01

Family

ID=58230848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610871265.8A Active CN106470252B (en) 2016-09-29 2016-09-29 Method for querying IP address by application program and communication terminal

Country Status (1)

Country Link
CN (1) CN106470252B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707683B (en) * 2017-05-22 2018-06-08 贵州白山云科技有限公司 A kind of method and apparatus for reducing DNS message lengths
CN107438115A (en) * 2017-09-11 2017-12-05 深圳市茁壮网络股份有限公司 A kind of domain name analytic method, apparatus and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102480477A (en) * 2010-11-30 2012-05-30 中国移动通信集团北京有限公司 Method, device and system for accessing service by client
CN105229996A (en) * 2013-05-15 2016-01-06 思杰系统有限公司 For reducing the system and method for the Denial of Service attack to next safety records dynamically generated

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102480477A (en) * 2010-11-30 2012-05-30 中国移动通信集团北京有限公司 Method, device and system for accessing service by client
CN105229996A (en) * 2013-05-15 2016-01-06 思杰系统有限公司 For reducing the system and method for the Denial of Service attack to next safety records dynamically generated

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Self-adapting load balancing for DNS";Jung J 等;《Performance Evaluation of Computer and Telecommunication Systems (SPECTS 2014), International Symposium on》;20140615;第564-571页 *

Also Published As

Publication number Publication date
CN106470252A (en) 2017-03-01

Similar Documents

Publication Publication Date Title
JP6726426B2 (en) Login-free method and device between terminals
US8972580B2 (en) DNS outage avoidance method for recursive DNS servers
US9913143B1 (en) Auto-provisioning device
CN113366815B (en) Network resource request method, apparatus, electronic device, and storage medium
CN109314723B (en) A method, device and terminal for realizing data service
WO2013131472A1 (en) Message processing method, device and system
CN103109517B (en) Method, terminal and system for dual-stack terminal accessing server
US9565161B2 (en) Automatically replacing localhost as hostname in URL with fully qualified domain name or IP address
CN106713522B (en) Wireless fidelity Wi-Fi connection method and mobile terminal
US20170289243A1 (en) Domain name resolution method and electronic device
CN105229994A (en) Parallel interface is selected
CN102368789A (en) Method and system for connecting dual-stack terminal to network
CN105959188B (en) Method and device for controlling user terminal to go online
CN105991640A (en) Method for processing HTTP (hypertext transfer protocol) request and apparatus for processing HTTP (hypertext transfer protocol) request
CN106470252B (en) Method for querying IP address by application program and communication terminal
CN104426816B (en) A kind of virtual machine communication method and device
WO2017166038A1 (en) Communication method and terminal
US20130148572A1 (en) Communication system and method
CN107534859B (en) A network authentication method, client, terminal device and platform
TWI546688B (en) Method for processing url and associated server and non-transitory computer readable storage medium
CN103139205B (en) Message processing method, device and the webserver
CN106028469B (en) Communication connection establishment method and device and mobile terminal
CN112565481B (en) Electronic equipment, domain name query method and related product
CN110661895A (en) A network address mapping method for a server and a network address mapping device
CN102904743A (en) Electronic device and method for processing multiple device management server addresses

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant