CN105391811B - domain name resolution method, access method of application server and terminal thereof - Google Patents

domain name resolution method, access method of application server and terminal thereof Download PDF

Info

Publication number
CN105391811B
CN105391811B CN201410438738.6A CN201410438738A CN105391811B CN 105391811 B CN105391811 B CN 105391811B CN 201410438738 A CN201410438738 A CN 201410438738A CN 105391811 B CN105391811 B CN 105391811B
Authority
CN
China
Prior art keywords
terminal
address
domain name
network environment
application server
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
CN201410438738.6A
Other languages
Chinese (zh)
Other versions
CN105391811A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410438738.6A priority Critical patent/CN105391811B/en
Publication of CN105391811A publication Critical patent/CN105391811A/en
Application granted granted Critical
Publication of CN105391811B publication Critical patent/CN105391811B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

the invention discloses a domain name resolution method, an access method of an application server and a terminal thereof. The domain name resolution method comprises the following steps: a domain name system server receives a request message sent by a terminal, wherein the request message carries an IP address of the terminal in a connected network and a domain name of an application server requested to be accessed by the terminal; the domain name system server searches DNS mapping information under a preselected network environment corresponding to the IP address to obtain the IP address of the application server under the network environment, wherein the DNS mapping information records a first mapping relation between the domain name of the application server under the network environment and the IP address of the application server; and the domain name system server sends the IP address of the application server in the network environment to the terminal. The invention solves the technical problem of high complexity when the terminal is tested, and further achieves the technical effect of reducing the complexity of the terminal in testing.

Description

domain name resolution method, access method of application server and terminal thereof
Technical Field
The invention relates to the field of application programs, in particular to a domain name resolution method, an access method of an application server and a terminal thereof.
background
before the application client of the terminal is used online, a test is required to ensure that the application client of the terminal is operated safely and stably in the using process. From development to online, an application client of the terminal needs to go through different network environments for application client testing, for example, in a development stage, a development environment is needed for testing, in a testing stage, a network environment is needed for testing, and in an experience stage, an experience environment is needed for testing.
And the terminal is required to switch different network environments for testing at different stages of the application client. Currently, the switching of the network environment is mainly performed in the following two ways:
1) The IP address of an application server needing to be accessed is modified in an application client code of the terminal, a hard coding mode is adopted, or a hidden operation entrance mode is opened in the application client of the terminal, the testing domain name and the IP address are written into application clients of different versions, and the application client of the terminal can directly access the application server through the testing domain name and the IP address written into the application client. Because the application servers in different network environments have different IP addresses, the codes in the application client side need to be rewritten each time the test is performed, and the process of writing the codes is complex;
2) The method comprises the steps of configuring a database of the website domain name and the corresponding IP address on the terminal, and supporting the terminal to access different network environments by continuously modifying the content in the database. However, the configuration of the database on the terminal can be completed only by complex operations, testing and experiencing personnel often do not have the skills or tools, and professional personnel are required to perform complex database construction on each terminal, so that not only is the labor cost increased, but also the testing efficiency is reduced, and the whole testing process is complex.
The method has the main problems that the application clients with different versions are required to be packaged in different network environments, the application clients with network environment information are very easy to release, and the application clients cannot be normally used. In addition, the process of configuring data on a terminal is complicated, and since the configured data is distributed over a plurality of terminals, it is very difficult to maintain.
It can be seen that, in the current scheme, corresponding network environment information is configured on the terminal for different network environments, and the process of configuring the network environment information is relatively complex, which may cause a problem that the terminal is relatively complex and relatively high when testing. However, no effective solution has been proposed to the above technical problems.
disclosure of Invention
the embodiment of the invention provides a domain name resolution method, an access method of an application server and a terminal thereof, which at least solve the technical problem of higher complexity when the terminal is tested.
according to an aspect of an embodiment of the present invention, there is provided a domain name resolution method, including: a domain name system server receives a request message sent by a terminal, wherein the request message carries an IP address of the terminal in a connected network and a domain name of an application server requested to be accessed by the terminal; the domain name system server searches DNS mapping information under a preselected network environment corresponding to the IP address to obtain the IP address of the application server under the network environment, wherein the DNS mapping information records a first mapping relation between the domain name of the application server under the network environment and the IP address of the application server; and the domain name system server sends the IP address of the application server to the terminal under the network environment.
according to another aspect of the embodiments of the present invention, there is also provided an access method for an application server, including: a terminal sends an IP address of the terminal in a connected network and an identifier of a network environment selected by the terminal to a domain name system server; the terminal sends a request message to the domain name system server, wherein the request message carries the IP address and the domain name of the application server which the terminal requests to access; the terminal receives the IP address of the application server in the network environment, which is sent by the domain name system server responding to the request message; and the terminal accesses the application server through the IP address of the application server.
According to still another aspect of the embodiments of the present invention, there is also provided a domain name system server, including: a first receiving unit, configured to receive a request message sent by a terminal, where the request message carries an IP address of the terminal in a network to which the terminal is connected and a domain name of an application server to which the terminal requests to access; the searching unit is used for searching DNS mapping information under a preselected network environment corresponding to the IP address to obtain the IP address of the application server under the network environment, wherein the DNS mapping information records a first mapping relation between a domain name of the application server under the network environment and the IP address of the application server; and the sending unit is used for sending the IP address of the application server to the terminal under the network environment.
According to another aspect of the embodiments of the present invention, there is also provided a terminal, including: a sending unit, configured to send, to a domain name system server, an IP address of the terminal in a network to which the terminal is connected and an identifier of a network environment selected by the terminal; a request unit, configured to send a request message to the domain name system server, where the request message carries the IP address and a domain name of an application server requested to be accessed by the terminal; a receiving unit, configured to receive an IP address of the application server in the network environment, where the domain name system server responds to the request message; and the access unit is used for accessing the application server through the IP address of the application server.
in the embodiment of the invention, the terminal selects the network environment, informs the network environment selected by the domain name system server and the domain name of the accessed application server, converts the domain name of the application server into the IP address through the DNS mapping information on the domain name system server, and can access the application server according to the IP address sent by the domain name system server, thereby solving the technical problem of high complexity when the terminal tests, and further achieving the technical effect of reducing the complexity of the terminal testing.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of a network environment according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a domain name resolution method according to an embodiment of the invention;
fig. 3 is an interaction diagram of a domain name system server and a terminal according to an embodiment of the present invention;
fig. 4 is a flowchart of an access method of an application server according to an embodiment of the present invention;
FIG. 5 is an interaction diagram of a terminal, a domain name system server and an application server according to an embodiment of the present invention;
FIG. 6 is an interface diagram for selecting a network environment according to an embodiment of the invention;
FIG. 7 is a schematic diagram of a domain name system server according to an embodiment of the present invention;
Fig. 8 is a schematic diagram of a terminal according to an embodiment of the present invention;
Fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
Fig. 10 is an interaction diagram of an access method of an application server according to an embodiment of the present invention; and
Fig. 11 is a schematic structural diagram of a domain name system server according to an embodiment of the present invention.
Detailed Description
in order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
it should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
the noun explains:
a domain name system server: the (Domain Name System or Domain Name Service, DNS for short) server is composed of a Domain Name resolver and a Domain Name server. The DNS server is a server that stores domain names and corresponding IP addresses of all hosts in the network, and has a function of converting domain names into IP addresses. The process of mapping a domain name to an IP address is known as "domain name resolution".
A terminal: the embodiment of the invention mainly relates to equipment such as a smart phone, a tablet computer, a notebook computer and the like.
Domain name: a Domain Name (Domain Name) is the Name of a computer or group of computers on the internet that consists of a string of names separated by dots, and is used to identify the electronic location of the computer during data transmission, and may correspond to one or more IP addresses, etc. The purpose of a domain name is to facilitate remembering and communicating the addresses of a set of servers.
and (3) testing environment: the network environment in the embodiment of the invention can refer to a local area network environment or a wide area network environment, and the local area network environment or the wide area network environment can also comprise one or more of a testing environment, a development environment, an experience environment and a formal environment
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a method that may be performed by an embodiment of the apparatus of the present application, it being noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here. According to an embodiment of the present invention, a domain name resolution method is provided.
Alternatively, in this embodiment, the domain name resolution method described above may be applied to a hardware environment formed by the terminal 101, the DNS server 102, and the application server 103 shown in fig. 1. As shown in fig. 1, a terminal 101 is connected to a DNS server 102 via a network, the DNS server 102 transmits a domain name resolution result to the terminal 101, and the terminal 101 accesses an application server 103 according to the resolved domain name provided by the DNS server 102. Such networks include, but are not limited to: one or more local area networks, the terminal 101 including but not limited to a cell phone, a PC, a notebook, or a tablet.
The domain name resolution method provided by the embodiment of the invention is shown in fig. 2. The domain name resolution method shown in fig. 2 includes the following steps S202 to S206.
step S202, the domain name system server 102 receives a request message sent by the terminal 101, wherein the request message carries an IP address of the terminal 101 in a connected network and a domain name of the application server 103 requested to be accessed by the terminal 101;
Step S204, the domain name system server 102 searches DNS mapping information under a preselected network environment corresponding to the IP address to obtain the IP address of the application server 103 under the network environment, wherein the DNS mapping information records a first mapping relation between the domain name of the application server 103 under the network environment and the IP address of the application server 103;
In step S206, the domain name system server 102 transmits the IP address of the application server 103 in the network environment to the terminal 101.
The terminal 101 is connected to different networks and has different IP addresses, and in order to enable the domain name system server 102 to determine an object for receiving information, the request information of the terminal 101 carries the IP address of the terminal in the connected network; the request information further includes the domain name of the application server that the terminal 101 requests to access, so that the domain name system server 102 can perform domain name resolution. The domain name of the application server carried in the request information of the terminal 101 is the domain name in the column of the domain name of the application server in table 1.
Table 1 structure diagram of configuration information of network environment
and the preselected network environment is reported to the domain name system server by the terminal. The preselected network environments are the test environment and the development environment in table 1, and the running environment of the application client on the terminal is simulated in different network environments to test the corresponding functions. Table 1 shows DNS mapping information in a preselected network environment.
The DNS mapping information is a mapping relationship between a domain name of the application server and an IP address of the application server in a predetermined network environment, and as shown in table 1, when the environment name is a test environment, the domain name imgcache.qq.com of the application server and the IP address 10.130.24.31 of the application server have a mapping relationship, that is, a first mapping relationship. When the environment name is the development environment, the mapping relationship between the domain name i.gtimg.cn of the application server and the IP address 10.185.20.211 of the application server is the first mapping relationship. Of course, the mapping relationship between the domain names of the other application servers and the IP addresses of the application servers shown in table 1 is also included in the first mapping relationship, and it should be understood that the first mapping relationship includes not only the mapping relationship between the domain names of the application servers shown in table 1, but also the mapping relationship between the domain names of the other application servers not shown in table 1.
the domain name system server 102 resolves the domain name of the application server carried in the request information of the terminal 101 into the IP address of the application server according to the first mapping relation in table 1, and sends the resolved IP address back to the terminal. For example, if the domain name of the application server to which the terminal 101 requests access is p.qq.com and the network environment to which access is requested is a development environment, the domain name system server 102 resolves that IP address of the application server is 10.130.25.95 and sends back the IP address 10.130.25.95 to the terminal 101.
as shown in fig. 3, the terminal 101 sends the domain name of the application server requesting access to the domain name system server 102, the domain name system server 102 searches for the first mapping relationship, and maps the domain name of the application server to the IP address of the application server according to the first mapping relationship, and the domain name system server sends the IP address obtained by mapping.
Through the embodiment, the domain name system server receives the IP address of the terminal and the domain name of the application server requesting access sent by the terminal, searches the DNS mapping information in the preselected network environment according to the preselected network environment of the terminal, maps the domain name of the application server requested by the terminal into the IP address of the application server in the network environment, and sends the IP address of the application server obtained through mapping back to the terminal. The terminal selects the network environment and informs the network environment selected by the domain name system server and the domain name of the accessed application server, the domain name system server sends the IP address of the application server to the terminal, the IP address or the domain name of the application server does not need to be configured by a code on the terminal, the domain name of the application server is converted into the IP address through the DNS mapping information on the domain name system server, the terminal can access the application server according to the IP address sent by the domain name system server, namely, the DNS mapping information is configured on the domain name system server, no matter how many application servers the terminal needs to access, the IP address of the application server which requires to be accessed can be resolved by utilizing the configured DNS mapping information as long as the network environment is pre-selected, the IP address or the domain name of the application server which needs to be accessed does not need to be configured for each terminal, the problem of higher complexity caused by the fact that the application server address under the network environment is configured on each terminal in the prior art is solved, the effect of repeatedly using DNS mapping information configured once is achieved, and the complexity of configuring the address of the application server is reduced.
Optionally, before the domain name system server 102 receives the request message sent by the terminal 101, the domain name system server 102 receives an IP address of the terminal 101 in the connected network and an identifier of the network environment selected by the terminal; the domain name system server 102 configures DNS mapping information in the network environment for the network environment indicated by the identifier; the domain name system server 102 stores a second mapping relationship between the IP address of the terminal 101 in the connected network and the DNS mapping information under the configured network environment.
The domain name system server 102 configures DNS mapping information for the network environment indicated by the terminal 101, and the domain name system server 102 stores a second mapping relationship between the IP address of the terminal 101 and the DNS mapping information in the network environment as shown in table 2.
TABLE 2 mapping relationship of terminal IP address, network environment identifier and DNS mapping information
As shown in table 2, the IP address of the terminal 101 in the connected network is 172.25.32.202, and the value 123 or 456 is used as the network environment identifier, where 123 represents the network environment where the application server 103 is located as the test environment. 456 represents a development environment as a network environment in which the application server 103 is located. It should be noted that the numerical values 123 and 456 are only used as an illustration of the network environment identifier, and may also be a combination of words, letters, or symbols, and combinations thereof.
the present embodiment is described below with reference to table 2. In this embodiment, the domain name system server 102 receives that the IP address of the terminal 101 in the connected network is 172.25.32.202, the network environment selected in advance by the terminal 101 is the test environment, the network environment identifier corresponding to the test environment in the domain name system server 102 is 123, the domain name of the application server requested to be accessed by the terminal 101 is p.qq.com, the domain name system server 102 finds that the IP address corresponding to the domain name p.qq.com is 10.12.23.155 according to the network environment identifier, the domain name system server 102 sends the IP address 10.12.23.155 of the application server back to the terminal 101 according to the IP address of the terminal 101 in the connected network, and the terminal 101 can access the application server with the domain name p.qq.com according to the IP address 10.12.23.155. Through the embodiment, the domain name system server 102 can configure DNS mapping information in a network environment for the network environment indicated by the identifier of the network environment, and store the second mapping relationship between the IP address of the terminal 101 and the DNS mapping information in the network environment, and when the terminal 101 accesses different application servers in the same network environment, the IP address of the application server in the corresponding network environment can be found according to the IP address of the terminal 101, so that the efficiency of the domain name system server in mapping a domain name to an IP address is improved.
Further, before the domain name system server receives the request message sent by the terminal, and after the domain name system server stores the mapping relationship between the IP address of the terminal in the connected network and the DNS mapping information under the configured network environment, the method further includes: a domain name system server receives an updated IP address sent by a terminal; the domain name system server replaces the IP address corresponding to the DNS mapping information in the second mapping relation with the updated IP address; and the IP address carried in the request message is the updated IP address.
Before the domain name system server 102 receives the request message sent by the terminal 101, the terminal 101 sends the MAC address of the terminal 101 to the domain name system server 102 to indicate that the domain name system server 102 has the terminal 101 connected to it. Due to the global uniqueness of the MAC address, the domain name system server 102 is able to identify the unique terminal 101 from the MAC address.
The domain name server 102 also stores the mapping relationships as shown in table 3.
TABLE 3 mapping relationship between MAC address of terminal, IP address of terminal and DNS mapping information in network environment
as shown in table 3, the MAC address of the terminal is 00-23-5A-15-99-42, but the IP address of the terminal 101 is different due to the different networks to which the terminal 101 is connected, and in this embodiment, the IP addresses of the terminal 101 in the three networks are 172.25.32.202, 171.25.32.202, and 170.25.32.202, respectively.
since the IP address of the terminal 101 is caused by different networks connected to the terminal 101, and the terminal 101 itself does not change, the mapping relationship between the terminal 101 and the DNS mapping information in the network environment does not change due to the change of the network connected to the terminal 101. For example, in this embodiment, the terminal 101 may have different IP addresses in the connected networks, such as 172.25.32.202 or 171.25.32.202, and the item of the test and the network environment identifier that the same terminal 101 needs to perform do not change due to the change of the IP address of the terminal 101, so when the terminal 101 is connected to different networks to access the domain name system server 102, the IP address of the terminal 101 connected to different networks and the DNS mapping information under the network environment identifier may be used as the second mapping relationship according to the MAC address of the terminal 101.
through the embodiment, when the IP address of the terminal 101 changes due to a change in the network to which the terminal 101 is connected, the mapping relationship between the IP address of the terminal 101 and the DNS mapping information in the network is established, so that when the IP address of the terminal 101 changes, the second mapping relationship between the IP address of the terminal and the DNS mapping information in the network environment does not need to be established again, and only the updated IP address of the terminal 101 needs to be replaced by the updated IP address, thereby saving resources of the domain name system server. Of course, an updated IP address may also be added, as shown in table 3. After updating the IP address of the terminal 101, the updated IP address is sent to the domain name system server, so that the domain name system server 102 accurately sends the IP address of the application server to the terminal 101 according to the updated IP address.
Example 2
There is also provided, in accordance with an embodiment of the present invention, an embodiment of a method that may be performed by an embodiment of the apparatus of the present application, it being noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here. According to an embodiment of the invention, an access method of an application server is provided.
Alternatively, in this embodiment, the access method of the application server may be applied to a hardware environment formed by the terminal 101, the DNS server 102, and the application server 103 shown in fig. 1.
fig. 4 is a flowchart of an access method of an application server according to an embodiment of the present invention. As shown in the figure, the access method of the application server includes the following steps S402 to S408.
Step S402, the terminal 101 sends the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal to the domain name system server 102;
Step S404, the terminal 101 sends a request message to the domain name system server 102, wherein the request message carries an IP address and a domain name of the application server 103 which the terminal requests to access;
Step S406, the terminal 101 receives the IP address of the application server 103 in the network environment sent by the domain name system server 102 in response to the request message;
In step S408, the terminal 101 accesses the application server through the IP address of the application server 103.
As shown in fig. 5, the terminal 101 transmits the IP address of the terminal and the identification of the network environment selected by the terminal to the domain name system server 102 to inform the domain name system server 102 that the terminal 101 has access. The terminal 101 sends the domain name of the application server 103 requesting access to the domain name system server 102. After the domain name system server 102 resolves the domain name into the IP address, the terminal 101 receives the IP address of the application server, and the terminal 101 accesses the application server 103 through the received IP address of the application server 103.
The network environment is identified in this embodiment as 172.25.32.202. The following describes the technical solution of the present example with reference to table 4.
Table 4 structure diagram of configuration information with identification of network environment
the identifier of the network environment selected by the terminal 101 may be T or K shown in table 4, and is used to indicate that the network environment in which the application server 103 is located is a test environment and a development environment, respectively. The domain name of the application server 103 carried in the request message sent by the terminal 101 may be imgcache.qq.com, i.gtimg.cn, and p.qq.com shown in table 4, or may be a domain name of another application server not shown in table 4. In the test environment, the IP address of the application server mapped by the domain name imgcache. qq. com of the application server is 10.130.24.31, and the mapping relationship between the domain name and the IP address in the network environment is shown in table 4, which is not described in detail herein. After the terminal 101 transmits the domain name requested for access, it receives the IP address of the application server from the domain name system server 102 in response to the request information, and accesses the application server according to the IP address.
through the above embodiment, the terminal 101 selects the network environment where the accessed application server is located, and sends the identifier of the selected network environment to the domain name system server 102, and the domain name system server 102 maps the domain name of the application server to the IP address of the application server according to the identifier of the network environment sent by the terminal 101, in this process, the domain name system server does not need to encode the terminal and the application client to be tested on the terminal, and the domain name system server can convert the domain name to the IP address, the terminal only needs to send the identifier of the network environment where the application server is located to the domain name system server, and does not need to configure the IP address or the domain name of the application server to be accessed for each terminal, thereby solving the problem of high complexity caused by configuring the address of the application server in the network environment on each terminal in the prior art, the effect of configuring DNS mapping information for multiple times is achieved, and therefore the complexity of configuring the address of the application server is reduced.
Optionally, the terminal sends the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal to the domain name system server: the terminal receives the identification of the network environment currently existing; the terminal displays the identification of the network environment currently existing, and selects the identification of one network environment from the identification of the network environment currently existing according to the received operation instruction; and the terminal sends the identification of the selected one network environment and the IP address of the terminal in the connected network to the domain name system server.
the identification of the network environment currently existing for the terminal 101 may be a test environment or a T-experience environment in the interface diagram shown in fig. 6. Displaying the identifiers of the currently existing network environments on the terminal 101, and selecting an identifier of one network environment from the identifiers of the network environments displayed in the terminal 101 according to the received operation instruction, for example, the identifier of the selected network environment in fig. 6 is a T experience environment. The terminal 101 sends the identifier of the network environment selected by the operation instruction to the domain name system server 102, so that the domain name system server 102 maps the domain name of the application server to the IP address of the application server according to the network environment selected by the terminal 101.
The terminal sends the selected network environment identifier and receives the IP address of the application server obtained by analyzing the domain name of the application server by the domain name system server so as to access the application server, the application client capable of accessing different application servers does not need to be packaged in the process, the application server does not need to be accessed by encoding the application client to be tested, and the mapping process from the domain name to the IP address is completed by the domain name system server, so that the problem of higher complexity caused by the fact that the application server address under the network environment is configured on each terminal in the prior art is solved, the test under different network environments can be carried out by carrying out simple network environment selection work on the terminal, and the test efficiency of the application client on the terminal is improved.
Optionally, after the terminal sends the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal to the domain name system server, the method further includes: the domain name system server configures DNS mapping information under a network environment for the network environment indicated by the identifier, wherein the DNS mapping information records a first mapping relation between a domain name of an application server under the network environment and an IP address of the application server; the domain name system server stores a second mapping relation between the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal;
After the terminal sends the request message to the domain name system server, the method further comprises: and the domain name system server acquires the identifier of the network environment selected by the terminal corresponding to the IP address of the terminal in the network connected with the terminal according to the second mapping relation, acquires the IP address of the application server in the network environment corresponding to the domain name of the application server according to the first mapping relation recorded in the DNS mapping information in the network environment indicated by the identifier, and sends the IP address of the application server in the network environment to the terminal.
The content recorded in the DNS mapping information may be as shown in tables 1 to 3, where a first mapping relationship between a domain name of an application server in a network environment and an IP address of the application server is recorded in tables 1 to 3, and a second mapping relationship between an IP address of the terminal 101 in a connected network and an identifier of a selected network environment is also recorded in tables 2 and 3, for example, the mapping relationship between the IP address 172.25.32.202 of the terminal and a test environment is the second mapping relationship in table 2.
Based on the IP address 172.25.32.202 of the terminal 101, the domain name system server 102 determines that the network environment selected by the terminal 101 is a test environment. In this embodiment, the domain name of the application server requested to be accessed by the terminal 101 is imgcache. qq.com, and the IP address of the application server corresponding to the domain name is found from the first mapping relationship and is 10.130.24.31.
When the terminal 101 receives that the IP address of the application server sent by the domain name system server 102 is 10.130.24.31, the terminal 101 accesses the application server according to the IP address to perform a test.
Further, after the domain name system server 102 stores the second mapping relationship between the IP address of the terminal 101 in the connected network and the identification of the network environment selected by the terminal 101, the method further includes: the domain name system server 102 receives the updated IP address sent by the terminal 101; the domain name system server 102 determines that the updated IP address is sent by the terminal 101 according to the MAC address of the terminal 101 received in advance, and replaces the IP address corresponding to the DNS mapping information in the second mapping relationship with the updated IP address.
TABLE 5 mapping relationship between MAC address of terminal, IP address of terminal, and DNS mapping information in network environment
table 5 shows a mapping relationship between the MAC address of the terminal, the IP address of the terminal, and DNS mapping information in the network environment. Before the terminal 101 sends request information to the domain name system server 102, the terminal 101 sends the MAC address of the terminal to the domain name system server 102 for registration, and the domain name system server 102 knows which terminal is connected to the domain name system server according to the MAC address of the terminal 101.
When the IP address of the terminal 101 changes, because the first mapping relationship does not change with the IP address of the terminal 101, after the terminal 101 reports its IP address, the dns server 102 determines that the new IP address belongs to the same MAC address, and the MAC address has global uniqueness, finds the original IP address corresponding to the MAC address and updates the original IP address, and the updated IP address has the second mapping relationship with the network environment identifier, and can also perform domain name to IP address conversion by using the original mapping relationship.
for example, if the new IP address of the terminal 101 is 170.25.32.202, the IP address 172.25.32.202 of the terminal in table 5 is updated to 170.25.32.202, and the domain name system server 102 receives the network environment identifier sent by the terminal with IP address 170.25.32.202, and searches for the IP address of the application server corresponding to the domain name i.gtimg.cn of the application server requesting access to be 10.130.24.31 under the network environment identifier.
and updating the IP address of the terminal in the mapping relation configured in the domain name server according to the MAC of the terminal, and corresponding the updated IP address with the network environment identifier under the condition of not changing the first mapping relation, thereby avoiding reconfiguring the first mapping relation and the second mapping relation in the domain name server and facilitating the maintenance of the mapping relation in the domain name server.
Optionally, the accessing, by the terminal 101, the application server 103 through the IP address of the application server 103 includes: the terminal 101 interacts with the application server 103 through the IP address of the application server 103 for data used for testing an application client installed on the terminal 101.
After the terminal 101 receives the IP address of the application server 103 sent by the domain name system server 102, the terminal 101 accesses the application server according to the IP address of the application server 103, and since the application server is in a preselected network environment, the application client installed on the terminal interacts with the application server 103 in test data, so as to achieve the purpose of testing in the predetermined network environment.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 3
According to the embodiment of the present invention, a domain name system server for implementing the domain name resolution method is further provided, where the domain name system server is mainly used for executing the domain name resolution method provided in the embodiment of the present invention, and the domain name system server provided in the embodiment of the present invention is specifically described below:
Fig. 7 is a schematic diagram of a domain name system server according to an embodiment of the present invention. As shown, the domain name system server includes: a first receiving unit 10, a searching unit 30 and a transmitting unit 50.
The first receiving unit 10 is configured to receive a request message sent by a terminal, where the request message carries an IP address of the terminal in a network to which the terminal is connected and a domain name of an application server to which the terminal requests to access;
The searching unit 30 is configured to search DNS mapping information in a preselected network environment corresponding to the IP address to obtain the IP address of the application server in the network environment, where the DNS mapping information records a first mapping relationship between a domain name of the application server in the network environment and the IP address of the application server;
the sending unit 50 is configured to send the IP address of the application server in the network environment to the terminal.
The terminal 101 is connected to different networks and has different IP addresses, and in order to enable the domain name system server 102 to determine an object for receiving information, the request information of the terminal 101 carries the IP address of the terminal in the connected network; the request information further includes the domain name of the application server that the terminal 101 requests to access, so that the domain name system server 102 can perform domain name resolution. The domain name of the application server carried in the request information of the terminal 101 is the domain name in the column of the domain name of the application server in table 1.
And the preselected network environment is reported to the domain name system server by the terminal. The preselected network environments are the test environment and the development environment in table 1, and the running environment of the application client on the terminal is simulated in different network environments to test the corresponding functions. Table 1 shows DNS mapping information in a preselected network environment.
the DNS mapping information is a mapping relationship between a domain name of the application server and an IP address of the application server in a predetermined network environment, and as shown in table 1, when the environment name is a test environment, the domain name imgcache.qq.com of the application server and the IP address 10.130.24.31 of the application server have a mapping relationship, that is, a first mapping relationship. When the environment name is the development environment, the mapping relationship between the domain name i.gtimg.cn of the application server and the IP address 10.185.20.211 of the application server is the first mapping relationship. Of course, the mapping relationship between the domain names of the other application servers and the IP addresses of the application servers shown in table 1 is also included in the first mapping relationship, and it should be understood that the first mapping relationship includes not only the mapping relationship between the domain names of the application servers shown in table 1, but also the mapping relationship between the domain names of the other application servers not shown in table 1.
The domain name system server 102 resolves the domain name of the application server carried in the request information of the terminal 101 into the IP address of the application server according to the first mapping relation in table 1, and sends the resolved IP address back to the terminal. For example, if the domain name of the application server to which the terminal 101 requests access is p.qq.com and the network environment to which access is requested is a development environment, the domain name system server 102 resolves that IP address of the application server is 10.130.25.95 and sends back the IP address 10.130.25.95 to the terminal 101.
As shown in fig. 3, the terminal 101 sends the domain name of the application server requesting access to the domain name system server 102, the domain name system server 102 searches for the first mapping relationship, and maps the domain name of the application server to the IP address of the application server according to the first mapping relationship, and the domain name system server sends the IP address obtained by mapping.
Through the embodiment, the domain name system server receives the IP address of the terminal and the domain name of the application server requesting access sent by the terminal, searches the DNS mapping information in the preselected network environment according to the preselected network environment of the terminal, maps the domain name of the application server requested by the terminal into the IP address of the application server in the network environment, and sends the IP address of the application server obtained through mapping back to the terminal. The terminal selects the network environment and informs the network environment selected by the domain name system server and the domain name of the accessed application server, the domain name system server sends the IP address of the application server to the terminal, the IP address or the domain name of the application server does not need to be configured by a code on the terminal, the domain name of the application server is converted into the IP address through the DNS mapping information on the domain name system server, the terminal can access the application server according to the IP address sent by the domain name system server, namely, the DNS mapping information is configured on the domain name system server, no matter how many application servers the terminal needs to access, the IP address of the application server which requires to be accessed can be resolved by utilizing the configured DNS mapping information as long as the network environment is pre-selected, the IP address or the domain name of the application server which needs to be accessed does not need to be configured for each terminal, the problem of higher complexity caused by the fact that the application server address under the network environment is configured on each terminal in the prior art is solved, the effect of repeatedly using DNS mapping information configured once is achieved, and the complexity of configuring the address of the application server is reduced.
optionally, the domain name system server further comprises: a second receiving unit, configured to receive, before the domain name system server receives the request message sent by the terminal, an IP address of the terminal in a connected network and an identifier of a network environment selected by the terminal; a configuration unit, configured to configure DNS mapping information in a network environment for the network environment indicated by the identifier; and the storage unit is used for storing a second mapping relation between the IP address of the terminal in the connected network and the DNS mapping information under the configured network environment.
The domain name system server 102 configures DNS mapping information for the network environment indicated by the terminal 101, and the domain name system server 102 stores a second mapping relationship between the IP address of the terminal 101 and the DNS mapping information in the network environment as shown in table 2.
As shown in table 2, the IP address of the terminal 101 in the connected network is 172.25.32.202, and the value 123 or 456 is used as the network environment identifier, where 123 represents the network environment where the application server 103 is located as the test environment. 456 represents a development environment as a network environment in which the application server 103 is located. It should be noted that the numerical values 123 and 456 are only used as an illustration of the network environment identifier, and may also be a combination of words, letters, or symbols, and combinations thereof.
The present embodiment is described below with reference to table 2. In this embodiment, the domain name system server 102 receives that the IP address of the terminal 101 in the connected network is 172.25.32.202, the network environment selected in advance by the terminal 101 is the test environment, the network environment identifier corresponding to the test environment in the domain name system server 102 is 123, the domain name of the application server requested to be accessed by the terminal 101 is p.qq.com, the domain name system server 102 finds that the IP address corresponding to the domain name p.qq.com is 10.12.23.155 according to the network environment identifier, the domain name system server 102 sends the IP address 10.12.23.155 of the application server back to the terminal 101 according to the IP address of the terminal 101 in the connected network, and the terminal 101 can access the application server with the domain name p.qq.com according to the IP address 10.12.23.155. Through the embodiment, the domain name system server 102 can configure DNS mapping information in a network environment for the network environment indicated by the identifier of the network environment, and store the second mapping relationship between the IP address of the terminal 101 and the DNS mapping information in the network environment, and when the terminal 101 accesses different application servers in the same network environment, the IP address of the application server in the corresponding network environment can be found according to the IP address of the terminal 101, so that the efficiency of the domain name system server in mapping a domain name to an IP address is improved.
Further, the domain name system server further comprises: a third receiving unit, configured to receive an updated IP address sent by the terminal before the first receiving unit receives the request message sent by the terminal and after the storage unit stores a second mapping relationship between the IP address of the terminal in the connected network and the DNS mapping information in the configured network environment; a replacing unit, configured to replace the IP address corresponding to the DNS mapping information in the second mapping relationship with the updated IP address; and the IP address carried in the request message is the updated IP address.
Before the domain name system server 102 receives the request message sent by the terminal 101, the terminal 101 sends the MAC address of the terminal 101 to the domain name system server 102 to indicate that the domain name system server 102 has the terminal 101 connected to it. Due to the global uniqueness of the MAC address, the domain name system server 102 is able to identify the unique terminal 101 from the MAC address.
The domain name server 102 also stores the mapping relationships as shown in table 3.
As shown in table 3, the MAC address of the terminal is 00-23-5A-15-99-42, but the IP address of the terminal 101 is different due to the different networks to which the terminal 101 is connected, and in this embodiment, the IP addresses of the terminal 101 in the three networks are 172.25.32.202, 171.25.32.202, and 170.25.32.202, respectively.
Since the IP address of the terminal 101 is caused by different networks connected to the terminal 101, and the terminal 101 itself does not change, the mapping relationship between the terminal 101 and the DNS mapping information in the network environment does not change due to the change of the network connected to the terminal 101. For example, in this embodiment, the terminal 101 may have different IP addresses in the connected networks, such as 172.25.32.202 or 171.25.32.202, and the item of the test and the network environment identifier that the same terminal 101 needs to perform do not change due to the change of the IP address of the terminal 101, so when the terminal 101 is connected to different networks to access the domain name system server 102, the IP address of the terminal 101 connected to different networks and the DNS mapping information under the network environment identifier may be used as the second mapping relationship according to the MAC address of the terminal 101.
Through the embodiment, when the IP address of the terminal 101 changes due to a change in the network to which the terminal 101 is connected, the mapping relationship between the IP address of the terminal 101 and the DNS mapping information in the network is established, so that when the IP address of the terminal 101 changes, the second mapping relationship between the IP address of the terminal and the DNS mapping information in the network environment does not need to be established again, and only the updated IP address of the terminal 101 needs to be replaced by the updated IP address, thereby saving resources of the domain name system server. Of course, an updated IP address may also be added, as shown in table 3. After updating the IP address of the terminal 101, the updated IP address is sent to the domain name system server, so that the domain name system server 102 accurately sends the IP address of the application server to the terminal 101 according to the updated IP address.
Example 4
According to an embodiment of the present invention, there is also provided a terminal for implementing the access method for the application server, where the terminal is mainly used to execute the access method for the application server provided in the foregoing content of the embodiment of the present invention, and the following specifically introduces the terminal provided in the embodiment of the present invention:
Fig. 8 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown, the terminal includes: a sending unit 82, a requesting unit 84, a receiving unit 86 and an accessing unit 88.
The sending unit 82 is configured to send, to the domain name system server, an IP address of the terminal in the connected network and an identifier of the network environment selected by the terminal;
The request unit 84 is configured to send a request message to the domain name system server, where the request message carries an IP address and a domain name of an application server requested to be accessed by the terminal;
The receiving unit 86 is configured to receive an IP address of an application server in a network environment, where the domain name system server responds to the request message;
the accessing unit 88 is used for accessing the application server through the IP address of the application server.
As shown in fig. 5, the terminal 101 transmits the IP address of the terminal and the identification of the network environment selected by the terminal to the domain name system server 102 to inform the domain name system server 102 that the terminal 101 has access. The terminal 101 sends the domain name of the application server 103 requesting access to the domain name system server 102. After the domain name system server 102 resolves the domain name into the IP address, the terminal 101 receives the IP address of the application server, and the terminal 101 accesses the application server 103 through the received IP address of the application server 103.
the network environment is identified in this embodiment as 172.25.32.202. The following describes the technical solution of the present example with reference to table 4.
The identifier of the network environment selected by the terminal 101 may be T or K shown in table 4, and is used to indicate that the network environment in which the application server 103 is located is a test environment and a development environment, respectively. The domain name of the application server 103 carried in the request message sent by the terminal 101 may be imgcache.qq.com, i.gtimg.cn, and p.qq.com shown in table 4, or may be a domain name of another application server not shown in table 4. In the test environment, the IP address of the application server mapped by the domain name imgcache. qq. com of the application server is 10.130.24.31, and the mapping relationship between the domain name and the IP address in the network environment is shown in table 4, which is not described in detail herein. After the terminal 101 transmits the domain name requested for access, it receives the IP address of the application server from the domain name system server 102 in response to the request information, and accesses the application server according to the IP address.
Through the above embodiment, the terminal 101 selects the network environment where the accessed application server is located, and sends the identifier of the selected network environment to the domain name system server 102, and the domain name system server 102 maps the domain name of the application server to the IP address of the application server according to the identifier of the network environment sent by the terminal 101, in this process, the domain name system server does not need to encode the terminal and the application client to be tested on the terminal, and the domain name system server can convert the domain name to the IP address, the terminal only needs to send the identifier of the network environment where the application server is located to the domain name system server, and does not need to configure the IP address or the domain name of the application server to be accessed for each terminal, thereby solving the problem of high complexity caused by configuring the address of the application server in the network environment on each terminal in the prior art, the effect of configuring DNS mapping information for multiple times is achieved, and therefore the complexity of configuring the address of the application server is reduced.
Optionally, the sending unit includes: the receiving module is used for receiving the identification of the network environment which exists currently; the selection module is used for displaying the identification of the currently existing network environment and selecting the identification of one network environment from the identification of the currently existing network environment according to the received operation instruction; and a sending module, configured to send the identifier of the selected network environment and the IP address of the terminal in the connected network to the domain name system server.
The identification of the network environment currently existing for the terminal 101 may be a test environment or a T-experience environment in the interface diagram shown in fig. 6. Displaying the identifiers of the currently existing network environments on the terminal 101, and selecting an identifier of one network environment from the identifiers of the network environments displayed in the terminal 101 according to the received operation instruction, for example, the identifier of the selected network environment in fig. 6 is a T experience environment. The terminal 101 sends the identifier of the network environment selected by the operation instruction to the domain name system server 102, so that the domain name system server 102 maps the domain name of the application server to the IP address of the application server according to the network environment selected by the terminal 101.
The terminal sends the selected network environment identifier and receives the IP address of the application server obtained by analyzing the domain name of the application server by the domain name system server so as to access the application server, the application client capable of accessing different application servers does not need to be packaged in the process, the application server does not need to be accessed by encoding the application client to be tested, and the mapping process from the domain name to the IP address is completed by the domain name system server, so that the problem of higher complexity caused by the fact that the application server address under the network environment is configured on each terminal in the prior art is solved, the test under different network environments can be carried out by carrying out simple network environment selection work on the terminal, and the test efficiency of the application client on the terminal is improved.
Optionally, the access unit comprises: and the interaction module is used for interacting data for testing the application client installed on the terminal with the application server through the IP address of the application server.
After the terminal 101 receives the IP address of the application server 103 sent by the domain name system server 102, the terminal 101 accesses the application server according to the IP address of the application server 103, and since the application server is in a preselected network environment, the application client installed on the terminal interacts with the application server 103 in test data, so as to achieve the purpose of testing in the predetermined network environment.
Example 5
According to an embodiment of the present invention, there is also provided a terminal for implementing the access method of the application server, as shown in fig. 9, the terminal mainly includes:
A processor 601, a user interface 602, a display 603, a microphone 604, a speaker 605, a memory 606, a network port 607, a coupler 608, and an antenna 609.
the memory 606 is mainly used for storing the program codes of the access methods of the application servers described above.
The user interface 602 is used to connect the processor 601 with a display 603, a microphone 604 and a speaker 605.
The display 603 is primarily used to take the entered user password and display the randomly generated first character.
The network port 607 can be an ethernet port and a wireless network port, the network port 607 is connected to a coupler 608, the coupler 608 is connected to an antenna 609, and the antenna 609 is used for receiving signals.
The processor 601 is mainly configured to perform the following operations: sending the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal to a domain name system server; a terminal sends a request message to a domain name system server, wherein the request message carries an IP address and a domain name of an application server which the terminal requests to access; the terminal receives the IP address of the application server in the network environment sent by the domain name system server response request message; the terminal accesses the application server through the IP address of the application server.
Processor 601 is further configured to receive an identification of a currently existing network environment; the terminal displays the identification of the network environment currently existing, and selects the identification of one network environment from the identification of the network environment currently existing according to the received operation instruction; and the terminal sends the identification of the selected one network environment and the IP address of the terminal in the connected network to the domain name system server.
The processor 601 is further configured to interact with the application server through the IP address of the application server for data used for testing the application client installed on the terminal.
The above method is explained below with reference to fig. 10.
And the terminal is provided with hostpifi and is connected with the domain name system server.
the hostapp on the terminal is started.
And the terminal sends the mac address to the domain name system server, namely, the mac is registered.
The terminal acquires current environment information.
and the terminal sends a request for switching the environment to the domain name system server, namely sends a network environment identifier to the domain name system server.
The terminal sends the IP address of the terminal to a domain name system server, and determines the mapping relation between the IP address of the terminal and the IP address of an application server and the domain name of the application server under the network environment.
The terminal sends request information with a domain name of an application server requesting access, wherein the domain name system server resolves the domain name into an IP address.
and the terminal receives the IP address obtained by the resolution from the domain name system server.
The terminal accesses the application server through the IP address sent by the domain name system server.
optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
Example 6
according to an embodiment of the present invention, there is also provided a domain name system server for implementing the domain name resolution method, as shown in fig. 11, the domain name system server mainly includes:
a processor 801, a device interface 802, a network interface 803, and a memory 804.
The device interface 802 is used for connecting the terminal 101, the network interface 803 is used for connecting the application server 103, and the memory 604 is used for storing program codes for executing the above-described domain name resolution method.
The processor 801 is configured to receive a request message sent by a terminal, where the request message carries an IP address of the terminal in a network to which the terminal is connected and a domain name of an application server to which the terminal requests to access; searching DNS mapping information under a preselected network environment corresponding to the IP address to obtain the IP address of an application server under the network environment, wherein the DNS mapping information records a first mapping relation between a domain name of the application server under the network environment and the IP address of the application server; and sending the IP address of the application server in the network environment to the terminal.
The processor 801 is further configured to receive an IP address of the terminal in the connected network and an identification of a network environment selected by the terminal; configuring DNS mapping information under the network environment for the network environment indicated by the identification; and storing a second mapping relation between the IP address of the terminal in the connected network and the DNS mapping information under the configured network environment.
the processor 801 is further configured to receive an updated IP address sent by the terminal; replacing the IP address corresponding to the DNS mapping information in the second mapping relation with the updated IP address; and the IP address carried in the request message is the updated IP address.
Example 7
the embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be used to store the domain name resolution method and the access method of the application server provided by the embodiment of the present invention.
Optionally, in this embodiment, the storage medium may be located in at least one of a plurality of network devices in a network of a wide area network, a metropolitan area network, or a local area network.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
S1, the domain name system server receives a request message sent by the terminal, wherein the request message carries the IP address of the terminal in the connected network and the domain name of the application server requested to be accessed by the terminal;
s2, the domain name system server searches DNS mapping information under the preselected network environment corresponding to the IP address to obtain the IP address of the application server under the network environment, wherein the DNS mapping information records a first mapping relation between the domain name of the application server under the network environment and the IP address of the application server;
and S3, the domain name system server sends the IP address of the application server in the network environment to the terminal.
Optionally, the storage medium is further arranged to store program code for performing the steps of: before the domain name system server receives the request message sent by the terminal, the method comprises the following steps: a domain name system server receives an IP address of a terminal in a connected network and an identifier of a network environment selected by the terminal; the domain name system server configures DNS mapping information under a network environment for the network environment indicated by the identifier; the domain name system server stores a second mapping relationship between the IP address of the terminal in the connected network and DNS mapping information under the configured network environment.
Optionally, the storage medium is further arranged to store program code for performing the steps of: before the domain name system server receives the request message sent by the terminal, and after the domain name system server stores the mapping relationship between the IP address of the terminal in the connected network and the DNS mapping information under the configured network environment, the method further includes: receiving an updated IP address sent by a terminal by a domain name system server; the domain name system server replaces the IP address corresponding to the DNS mapping information in the second mapping relation with the updated IP address; and the IP address carried in the request message is the updated IP address.
Optionally, in this embodiment, the storage medium is configured to store program codes for performing the following steps of the access method of the application server: the terminal sends the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal to a domain name system server; a terminal sends a request message to a domain name system server, wherein the request message carries an IP address and a domain name of an application server which the terminal requests to access; the terminal receives the IP address of the application server in the network environment sent by the domain name system server response request message; the terminal accesses the application server through the IP address of the application server.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the terminal receives the identification of the network environment currently existing; the terminal displays the identification of the network environment currently existing, and selects the identification of one network environment from the identification of the network environment currently existing according to the received operation instruction; and the terminal sends the identification of the selected one network environment and the IP address of the terminal in the connected network to the domain name system server.
optionally, the storage medium is further arranged to store program code for performing the steps of: after the terminal sends the IP address of the terminal in the connected network and the identification of the network environment selected by the terminal to the domain name system server, the method further includes: the domain name system server configures DNS mapping information under a network environment for the network environment indicated by the identifier, wherein the DNS mapping information records a first mapping relation between a domain name of an application server under the network environment and an IP address of the application server; the domain name system server stores a second mapping relation between the IP address of the terminal in the connected network and the identifier of the network environment selected by the terminal; after the terminal sends the request message to the domain name system server, the method further comprises: and the domain name system server acquires the identifier of the network environment selected by the terminal corresponding to the IP address of the terminal in the network connected with the terminal according to the second mapping relation, acquires the IP address of the application server in the network environment corresponding to the domain name of the application server according to the first mapping relation recorded in the DNS mapping information in the network environment indicated by the identifier, and sends the IP address of the application server in the network environment to the terminal.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the domain name system server receives an updated IP address sent by the terminal; and the domain name system server judges that the updated IP address is sent by the terminal according to the MAC address of the terminal received in advance, and replaces the IP address corresponding to the DNS mapping information in the second mapping relation with the updated IP address.
Optionally, the storage medium is further arranged to store program code for performing the steps of: and the terminal interacts with the application server through the IP address of the application server to obtain data for testing the application client installed on the terminal.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
the above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
in addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
the foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. A domain name resolution method is characterized by comprising the following steps:
A domain name system server receives a request message sent by a terminal, wherein the request message carries an IP address of the terminal in a connected network and a domain name of an application server requested to be accessed by the terminal;
the domain name system server searches DNS mapping information under a preselected network environment corresponding to the IP address according to a second mapping relation to obtain the IP address of the application server under the network environment, wherein the DNS mapping information records a first mapping relation between a domain name of the application server under the network environment and the IP address of the application server, and the second mapping relation is a mapping relation between the IP address of the terminal stored in the domain name system server in a connected network and the configured DNS mapping information under the network environment;
and the domain name system server sends the IP address of the application server to the terminal under the network environment.
2. The method according to claim 1, before the domain name system server receives the request message sent by the terminal, comprising:
The domain name system server receives an IP address of the terminal in a connected network and an identifier of the network environment selected by the terminal;
And the domain name system server configures DNS mapping information under the network environment for the network environment indicated by the identification.
3. The method according to claim 1, further comprising, before the domain name system server receives the request message sent by the terminal and after the domain name system server stores the mapping relationship between the IP address of the terminal in the connected network and the DNS mapping information under the configured network environment:
The domain name system server receives the updated IP address sent by the terminal;
The domain name system server replaces the IP address corresponding to the DNS mapping information in the second mapping relation with the updated IP address;
And the IP address carried in the request message is the updated IP address.
4. An access method for an application server, comprising:
a terminal sends an IP address of the terminal in a connected network and an identifier of a network environment selected by the terminal to a domain name system server;
The terminal sends a request message to the domain name system server, wherein the request message carries the IP address and the domain name of the application server which the terminal requests to access;
The terminal receives an IP address of the application server in the network environment, which is sent by the domain name system server in response to the request message, wherein the IP address of the application server is obtained by the domain name system server searching DNS mapping information in the pre-selected network environment corresponding to the IP address according to a second mapping relationship, the second mapping relationship is a mapping relationship between the IP address of the terminal stored in the domain name system server in the connected network and the configured DNS mapping information in the network environment, and the DNS mapping information records a first mapping relationship between the domain name of the application server in the network environment and the IP address of the application server;
And the terminal accesses the application server through the IP address of the application server.
5. the method according to claim 4, wherein the terminal sending the IP address of the terminal in the connected network and the identification of the network environment selected by the terminal to a domain name system server comprises:
The terminal receives the identifier of the network environment which exists currently;
The terminal displays the identification of the currently existing network environment and selects one identification of the network environment from the identification of the currently existing network environment according to the received operation instruction; and
And the terminal sends the selected identifier of the network environment and the IP address of the terminal in the connected network to the domain name system server.
6. the method of claim 4,
After the terminal sends the IP address of the terminal in the connected network and the identification of the network environment selected by the terminal to a domain name system server, the method further includes: the domain name system server configures DNS mapping information under the network environment for the network environment indicated by the identification;
After the terminal sends the request message to the domain name system server, the method further includes: the domain name system server acquires an identifier of a network environment selected by the terminal corresponding to an IP address of the terminal in a network connected with the terminal according to the second mapping relation, acquires an IP address of the application server in the network environment corresponding to the domain name of the application server according to the first mapping relation recorded in the DNS mapping information in the network environment indicated by the identifier, and sends the IP address of the application server in the network environment to the terminal.
7. The method according to claim 6, wherein after the domain name system server stores the second mapping relationship between the IP address of the terminal in the connected network and the identity of the network environment selected by the terminal, the method further comprises:
the domain name system server receives the updated IP address sent by the terminal;
And the domain name system server judges that the updated IP address is sent by the terminal according to the MAC address of the terminal received in advance, and replaces the IP address corresponding to the DNS mapping information in the second mapping relation with the updated IP address.
8. the method of claim 4, wherein the terminal accessing the application server through the IP address of the application server comprises:
And the terminal interacts with the application server through the IP address of the application server to obtain data for testing the application client installed on the terminal.
9. A domain name system server, comprising:
A first receiving unit, configured to receive a request message sent by a terminal, where the request message carries an IP address of the terminal in a network to which the terminal is connected and a domain name of an application server to which the terminal requests to access;
a searching unit, configured to search, according to a second mapping relationship, DNS mapping information in a preselected network environment corresponding to the IP address to obtain the IP address of the application server in the network environment, where the DNS mapping information records a first mapping relationship between a domain name of the application server in the network environment and the IP address of the application server, and the second mapping relationship is a mapping relationship between an IP address of the terminal stored in the domain name system server in a connected network and the configured DNS mapping information in the network environment;
And the sending unit is used for sending the IP address of the application server to the terminal under the network environment.
10. The domain name system server according to claim 9, further comprising:
A second receiving unit, configured to receive, before the first receiving unit receives the request message sent by the terminal, an IP address of the terminal in a connected network and an identifier of the network environment selected by the terminal;
A configuration unit, configured to configure DNS mapping information in the network environment for the network environment indicated by the identifier.
11. The domain name system server according to claim 10, further comprising:
A third receiving unit, configured to receive an updated IP address sent by the terminal before the first receiving unit receives the request message sent by the terminal and after the storage unit stores the second mapping relationship between the IP address of the terminal in the connected network and the DNS mapping information in the configured network environment;
a replacing unit, configured to replace the IP address corresponding to the DNS mapping information in the second mapping relationship with the updated IP address;
and the IP address carried in the request message is the updated IP address.
12. A terminal, comprising:
a sending unit, configured to send, to a domain name system server, an IP address of the terminal in a network to which the terminal is connected and an identifier of a network environment selected by the terminal;
A request unit, configured to send a request message to the domain name system server, where the request message carries the IP address and a domain name of an application server requested to be accessed by the terminal;
a receiving unit, configured to receive an IP address of the application server in the network environment sent by the domain name system server in response to the request message, where the IP address of the application server is obtained by the domain name system server searching DNS mapping information in the network environment that is pre-selected and corresponds to the IP address according to a second mapping relationship, where the second mapping relationship is a mapping relationship between an IP address of the terminal stored in the domain name system server in a connected network and configured DNS mapping information in the network environment, and the DNS mapping information records a first mapping relationship between a domain name of the application server in the network environment and the IP address of the application server in the network environment;
And the access unit is used for accessing the application server through the IP address of the application server.
13. The terminal according to claim 12, wherein the transmitting unit comprises:
The receiving module is used for receiving the identification of the network environment which exists currently;
The selection module is used for displaying the identification of the currently existing network environment and selecting one identification of the network environment from the identification of the currently existing network environment according to the received operation instruction; and
And the sending module is used for sending the selected identifier of the network environment and the IP address of the terminal in the connected network to the domain name system server.
14. The terminal of claim 12, wherein the access unit comprises:
And the interaction module is used for interacting data used for testing the application client installed on the terminal with the application server through the IP address of the application server.
15. a computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 8.
CN201410438738.6A 2014-08-29 2014-08-29 domain name resolution method, access method of application server and terminal thereof Active CN105391811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410438738.6A CN105391811B (en) 2014-08-29 2014-08-29 domain name resolution method, access method of application server and terminal thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410438738.6A CN105391811B (en) 2014-08-29 2014-08-29 domain name resolution method, access method of application server and terminal thereof

Publications (2)

Publication Number Publication Date
CN105391811A CN105391811A (en) 2016-03-09
CN105391811B true CN105391811B (en) 2019-12-06

Family

ID=55423640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410438738.6A Active CN105391811B (en) 2014-08-29 2014-08-29 domain name resolution method, access method of application server and terminal thereof

Country Status (1)

Country Link
CN (1) CN105391811B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4171086A4 (en) * 2020-07-06 2023-12-20 Huawei Technologies Co., Ltd. Method and apparatus for sending domain name system request

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402880B (en) * 2016-05-20 2020-10-16 腾讯科技(北京)有限公司 Test method and electronic equipment
CN105991798A (en) * 2016-07-01 2016-10-05 北京奇虎科技有限公司 Method and device for network access by mobile terminal
CN107040617B (en) * 2016-10-11 2020-07-31 阿里巴巴集团控股有限公司 Data processing method and device
CN107154976A (en) * 2017-05-10 2017-09-12 北京微影时代科技有限公司 Website testing method, device and system
CN107566211B (en) * 2017-08-23 2020-10-09 北京小米移动软件有限公司 Method, device and system for accessing test equipment
CN107819893A (en) * 2017-10-27 2018-03-20 中航信移动科技有限公司 Network address Dynamic Configuration and mobile terminal
CN107995059B (en) * 2017-11-27 2020-11-03 北京酷我科技有限公司 iOS network test strategy
CN110113370A (en) * 2018-02-01 2019-08-09 北京视联动力国际信息技术有限公司 A kind of communication connection method for building up and device based on view networking
CN111124426B (en) * 2018-10-31 2023-07-04 北京国双科技有限公司 Data information acquisition method and device
CN110149423B (en) * 2019-07-04 2022-07-22 深圳市珍爱捷云信息技术有限公司 Domain name processing method and device, readable storage medium and electronic equipment
CN112565318A (en) * 2019-09-25 2021-03-26 中兴通讯股份有限公司 Server security defense method and system, communication equipment and storage medium
CN111200668B (en) * 2019-12-30 2022-07-26 论客科技(广州)有限公司 Method, system and storage medium for replacing server
CN111221572B (en) * 2020-01-13 2023-09-01 北京字节跳动网络技术有限公司 Method, device, medium and equipment for automatically adapting to running environment
CN111343294A (en) * 2020-02-14 2020-06-26 京东数字科技控股有限公司 Network environment switching method, device, equipment and computer readable storage medium
CN111556374B (en) * 2020-03-18 2023-09-05 视联动力信息技术股份有限公司 Method and device for accessing application server and video networking system
CN111447299A (en) * 2020-03-25 2020-07-24 中国工商银行股份有限公司 DNS analysis method and system based on test environment standing book
CN111491033A (en) * 2020-04-27 2020-08-04 湖南快乐阳光互动娱乐传媒有限公司 Connection establishing method and device
CN111641728A (en) * 2020-05-16 2020-09-08 中信银行股份有限公司 Calling method and device based on distributed system
CN113965543B (en) * 2020-07-03 2024-01-16 深圳市腾讯网域计算机网络有限公司 Access method, device and storage medium of application server
CN114040025B (en) * 2020-07-21 2023-10-10 深圳市腾讯网域计算机网络有限公司 Method and device for controlling switching network environment and electronic equipment
CN112532473B (en) * 2020-11-12 2023-09-01 苏宁金融科技(南京)有限公司 DNS-based multi-environment test access method and device
CN113377678B (en) * 2021-07-13 2023-05-16 挂号网(杭州)科技有限公司 Test environment switching method and device, electronic equipment and storage medium
CN115314465A (en) * 2022-07-26 2022-11-08 中国第一汽车股份有限公司 Domain name filtering method, filtering system and private DNS server thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631133A (en) * 2008-07-15 2010-01-20 华为技术有限公司 Domain name analyzing system, equipment and method
US9485214B2 (en) * 2012-05-31 2016-11-01 Red Hat, Inc. Use of reversed DNS records for distributed mapping of asymmetric cryptographic keys to custom data
CN102833364A (en) * 2012-08-22 2012-12-19 深圳市共进电子股份有限公司 Domain name resolution agent method and gateway device
CN104010051B (en) * 2014-06-05 2017-12-08 胡汉强 A kind of method and management server for accessing network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4171086A4 (en) * 2020-07-06 2023-12-20 Huawei Technologies Co., Ltd. Method and apparatus for sending domain name system request

Also Published As

Publication number Publication date
CN105391811A (en) 2016-03-09

Similar Documents

Publication Publication Date Title
CN105391811B (en) domain name resolution method, access method of application server and terminal thereof
CN105376107B (en) Terminal testing method and proxy server
CN105430108B (en) Test environment access method and proxy server
CN111176976B (en) Test data generation method and device, storage medium and electronic device
CN102752389B (en) Configuration method of wireless router based on mobile data network and system thereof
CN105338011B (en) A kind of ' In System Reconfiguration Method based on cloud service, device and Cloud Server
CN104092555B (en) A kind of methods, devices and systems of undated parameter value
CN108183838B (en) Method and device for testing source NAT function
US11244153B2 (en) Method and apparatus for processing information
CN103067373A (en) User registration method
US20190018657A1 (en) Techniques to configure a web-based application for bot configuration
CN104391687A (en) Method and system for realizing internet APP (application) public platform of enterprise and association
CN104899134B (en) Domain name registration service device automatization test system and method
CN104270204A (en) Testing method and testing equipment for wireless communication module
CN105094506A (en) Screen unlocking method for intelligent terminal, intelligent terminal and operating platform
CN107800781A (en) A kind of configuration data processing method and device
CN103595759A (en) Desktop presenting method based on cloud
CN105516744B (en) Smart television access method and smart television access system
CN111353136B (en) Method and device for processing operation request
CN106028311B (en) A kind of terminal registration method and device
CN108768807B (en) Virtual-real interconnection method and device for cloud platform
CN106777144A (en) A kind of server switching method and device
CN108737350B (en) Information processing method and client
CN106330979B (en) Router login method and device
CN108614844B (en) Multimedia file generation method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant