A domain name resolution method
By generating and parsing messages containing identification information, the problem of complex domain name resolution methods is solved, enabling fast reverse resolution and real-time effect of pointer record changes, thus improving the efficiency of domain name resolution.
Patent Information
- Application Number
- CN202311181125.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-09-13
AI Technical Summary
In existing technologies, the domain name resolution query process is complex, and any changes to pointer records require a certain delay to take effect.
By generating and parsing messages containing identification information, reverse lookup requests can be quickly distinguished, the reverse lookup process can be optimized, response messages can be directly obtained, the process can be simplified, and record changes can be made effective in real time.
It simplifies the domain name resolution process, improves the efficiency of reverse lookup, and enables near real-time effect of pointer record changes.
Smart Images

Figure CN118827617B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a domain name resolution method. BACKGROUND
[0002] The domain name system (DNS) is an Internet service. As a distributed database that maps domain names and Internet Protocol (IP) addresses to each other, it enables people to access the Internet more conveniently.
[0003] The current mainstream domain name resolution scheme is distributed and cluster deployment of application layer software. By listening to a specific port (such as port 53), the local domain name server receives the domain name recursive resolution request sent by the request end, queries its cache space, and if there is no hit, it performs recursive resolution. The authoritative domain name server receives the domain name query request sent by the local domain name server by listening to port 53, and replies to the local domain name server with the query result. Subsequently, the local domain name server replies to the original request end with the result after completing the recursive query.
[0004] The DNS domain name resolution method includes reverse resolution, which requires adding corresponding PTR resolution records in the reverse resolution domain (in-addr.arpa). The reverse resolution request end must ask the local domain name server for the pointer record (PTR) of a certain IP. After completing the recursive query according to the above process, the final query result is obtained.
[0005] It can be seen that the domain name resolution method in the related art has a complex query process, and any change in the pointer record needs to go through a certain delay before it takes effect. SUMMARY
[0006] The present application provides a domain name resolution method, which solves the problem of complex query process of the domain name resolution method in the related art, and any change in the pointer record needs to go through a certain delay before it takes effect. According to the content indicated by the identification information, the corresponding reply packet is quickly obtained, which carries the processing result corresponding to the identification information, simplifies the process of domain name resolution, and improves the efficiency of reverse resolution.
[0007] The technical solution of the present application is as follows:
[0008] In a first aspect, the present application provides a domain name resolution method applied to a first network device, comprising:
[0009] generating a first packet; the first packet includes identification information, and the identification information is used to indicate whether the first packet is a reverse resolution request packet;
[0010] sending the first message to the second network device;
[0011] receiving a second message sent by the second network device; the second message is a response message of the first message based on the identification information.
[0012] In a second aspect, the application provides a domain name resolution method applied to a second network device, and the method comprises the following steps:
[0013] receiving a first message sent by a first network device; the first message comprises identification information, and the identification information is used for indicating whether the first message is a reverse resolution request message;
[0014] resolving the first message to obtain the identification information;
[0015] sending a second message to the first network device based on the identification information; the second message is a response message of the first message based on the identification information.
[0016] In a third aspect, the application provides a first domain name resolution device, which comprises:
[0017] a first processing unit, configured to generate a first message; the first message comprises identification information, and the identification information is used for indicating whether the first message is a reverse resolution request message;
[0018] a first sending unit, configured to send the first message to a second network device;
[0019] a first receiving unit, configured to receive a second message sent by the second network device; the second message is a response message of the first message based on the identification information.
[0020] In a fourth aspect, the application provides a second domain name resolution device, which comprises:
[0021] a second receiving unit, configured to receive a first message sent by a first network device; the first message comprises identification information, and the identification information is used for indicating whether the first message is a reverse resolution request message;
[0022] a second processing unit, configured to resolve the first message to obtain the identification information;
[0023] a second sending unit, configured to send a second message to the first network device based on the identification information; the second message is a response message of the first message based on the identification information.
[0024] In a fifth aspect, the present application provides a first network device, comprising: a first processor and a first memory, the first memory being configured to store a computer program, and the first processor being configured to invoke and run the computer program stored in the first memory to execute the steps of the domain name resolution method corresponding to the first aspect.
[0025] In a sixth aspect, the present application provides a second network device, comprising: a second processor and a second memory, the second memory being configured to store a computer program, and the second processor being configured to invoke and run the computer program stored in the second memory to execute the steps of the domain name resolution method corresponding to the second aspect.
[0026] A storage medium, the storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the domain name resolution method corresponding to the first aspect or the domain name resolution method corresponding to the second aspect.
[0027] The domain name resolution method provided by the embodiments of the present application is applied to a first network device, and the method comprises the following steps: generating a first message; the first message comprises identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message; sending the first message to a second network device; receiving a second message sent by the second network device; the second message is a response message of the first message obtained based on the identification information; the method solves the problem that in the related art, the query process of the domain name resolution mode is complex, and any change of a pointer record needs to experience a certain delay before taking effect; according to the content indicated by the identification information, a corresponding response message is quickly obtained, the response message carries a processing result corresponding to the identification information, the process of the domain name resolution is simplified, and the efficiency of the reverse resolution is improved. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 A flowchart of a domain name resolution method provided by the embodiments of the present application is shown in the figure;
[0029] Figure 2 A flowchart of another domain name resolution method provided by the embodiments of the present application is shown in the figure;
[0030] Figure 3 A flowchart of still another domain name resolution method provided by the embodiments of the present application is shown in the figure;
[0031] Figure 4 A schematic diagram of client-host interaction provided by the embodiments of the present application is shown in the figure;
[0032] Figure 5 A structural schematic diagram of a first domain name resolution device provided by the embodiments of the present application is shown in the figure;
[0033] Figure 6 A second domain name resolution device structure diagram provided by an embodiment of the present application is shown in FIG. 2.
[0034] Figure 7 A first network device structure diagram provided by an embodiment of the present application is shown in FIG. 3.
[0035] Figure 8 A second network device structure diagram provided by an embodiment of the present application is shown in FIG. 4. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.
[0037] It should be understood that the "embodiments of the present application" or "the foregoing embodiments" mentioned throughout the specification mean that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the foregoing embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be applied in one or more embodiments in any suitable manner. In various embodiments of the present application, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The serial number of the above-mentioned embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.
[0038] Referring to FIG. 1, Figure 1 The present application provides a domain name resolution method, which comprises the following steps:
[0039] Step 101, the first network device generates a first message.
[0040] The first message includes identification information, which is used to indicate whether the first message is a reverse resolution request message. Here, the identification information is used to distinguish the message type of the first message, and the message type can include a reverse resolution type and a non-reverse resolution type. It can be seen that the first message of the present application is a message assembled by a specific assembly method, and carries specific identification information.
[0041] In the embodiments of the present application, the first network device can be a request end, which is the initiator of domain name query.
[0042] In the embodiments of the present application, the first network device includes but is not limited to a terminal device, which can be a personal computer (PC) or a mobile terminal, and the mobile terminal can also be referred to as a user equipment (UE), an access terminal, a subscriber unit, a subscriber station, a mobile station, a mobile, a user terminal, a terminal, a wireless communication device, a user agent or a user device. The mobile terminal can be a smartphone, a cellular phone, a cordless phone, a tablet computer, a personal digital processing device, a handheld device with a wireless communication function or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, etc. In the embodiments of the present application, the terminal device has an interface for communicating with a cellular network and / or a wireless local area network (WLAN).
[0043] In step 102, the first network device sends a first message to a second network device.
[0044] In the embodiments of the present application, the second network device can be a target end, which is an object for interacting with a requesting end, i.e., the first network device, and receives the first message sent by the first network device.
[0045] In some embodiments of the present application, when the identification information is used to indicate that the first message is a reverse resolution request message, the second network device is a target end, which can be regarded as a searched end (including a searched host) at this time. The searched end is an object to be queried and has a target IP. The second network device communicates with the first network device as two ends of interaction, and the second network device can feed back a query result of the domain name query to the first network device.
[0046] Any host connected to the Internet has a unique hierarchical name, i.e., a domain name. Here, a "domain" is a division in a name space that can be managed. In terms of syntax, each domain name is composed of a sequence of labels, and the labels are separated by dots (decimal points).
[0047] In step 103, the first network device receives a second message sent by the second network device.
[0048] The second message is a response message of the first message based on the identification information.
[0049] In some embodiments of the present application, in the case where the identification information is used to indicate that the first message is a reverse resolution request message, the first network device can quickly obtain the second message, i.e., the response message fed back by the second network device for the first message, which carries the resolution result, i.e., the queried domain name. It can be seen that the message assembled by the specific assembly method optimizes the implementation process of the reverse resolution, and the reverse resolution can be completed without applying for a PTR record to a reverse resolution management organization, and there is no time to live (TTL) limitation, and any record change can be implemented in quasi-real time.
[0050] In some embodiments of the present application, in the case where the identification information is used to indicate that the first message is not a reverse resolution request message, the first network device can obtain the second message, i.e., the response message fed back by the second network device for the first message, which carries the processing result of the related service. It can be seen that the present application can obtain different response messages according to the content indicated by the identification information; for the reverse resolution type, the queried domain name can be obtained; for the non-reverse resolution type, the processing result is obtained by processing according to the related process or flexibly processing according to the needs of the related service.
[0051] The present application provides a domain name resolution method, which is applied to a first network device, generates a first message, the first message includes identification information, the identification information is used to indicate whether the first message is a reverse resolution request message, sends the first message to a second network device, receives a second message sent by the second network device, and the second message is a response message of the first message based on the identification information. That is, the first network device in the present application can quickly obtain the corresponding response message according to the content indicated by the identification information, and the response message carries the processing result corresponding to the identification information, thereby simplifying the process of domain name resolution and improving the efficiency of reverse resolution.
[0052] Referring to Figure 2 The present application provides a domain name resolution method, which includes the following steps:
[0053] Step 201, the second network device receives the first message sent by the first network device.
[0054] The first message includes identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message.
[0055] Step 202, the second network device resolves the first message to obtain the identification information.
[0056] In the embodiment of the present application, after receiving the first message, the second network device parses the first message to obtain the identification information, and then can distinguish the message type of the first message according to the identification information. The message type can include a reverse resolution type and a non-reverse resolution type. It can be seen that the first message of the present application is a message assembled by a specific assembly manner, and carries specific identification information.
[0057] In step 203, the second network device sends a second message to the first network device based on the identification information.
[0058] The second message is a response message of the first message based on the identification information.
[0059] In the embodiment of the present application, when the identification information is used to indicate that the first message is a reverse resolution request message, the second network device is the target end, which can be regarded as a to-be-searched end (including a to-be-searched host) at this time. At this time, the second network device queries its domain name, and assembles the query result into a response message according to a specific assembly manner to obtain the second message, and finally sends the second message to the query request end, that is, the initiating end.
[0060] The domain name resolution method provided by the present application is applied to a second network device, receives a first message sent by a first network device, the first message includes identification information, the identification information is used to indicate whether the first message is a reverse resolution request message, parses the first message to obtain the identification information, sends a second message to the first network device based on the identification information, and the second message is a response message of the first message based on the identification information. That is, the second network device in the present application can perform corresponding processing according to the content indicated by the identification information, so as to generate a response message containing the processing result, and quickly feed back the response message to the request end. The response message carries the processing result corresponding to the identification information, thereby simplifying the process of domain name resolution and improving the efficiency of reverse resolution.
[0061] In some embodiments of the present application, the first message is an Internet Protocol (IP) message, the Internet Protocol message includes a data area, and the identification information is in the data area. It can be seen that the present application uses the IP message, the query initiating end assembles the IP message, and marks the identification information in the data area, so that the reverse resolution query request can be received at the network layer, and the resolution result can be carried in the response message.
[0062] In some embodiments of the present application, the identification information in the data area includes a type field and a code field of the identification information in the data area.
[0063] Here, the IP protocol includes, but is not limited to, an Internet Control Message Protocol (ICMP). The ICMP is a sub-protocol of the Transmission Control Protocol / Internet Protocol (TCP / IP) protocol suite, and is used to pass control messages between IP hosts and routers.
[0064] It can be understood that the ICMP message is contained in an IP datagram, is a user of the IP, and an IP header is in front of the ICMP message, so an ICMP message includes an IP header, an ICMP header and an ICMP message, and a Protocol value of the IP header is 1, which indicates that the ICMP message is an ICMP message. A Type field in the ICMP header is used to indicate a function and a format of the ICMP message, and a Code field is used to specifically indicate a type of the ICMP message. All data is behind the ICMP header.
[0065] It should be noted that the application sets the above identification information in a Type field and a Code field of a data area. The Type field and the Code field are combined in the application, and are distinguished from existing protocol value agreements. In addition, the client and the host agree with each other.
[0066] Referring to FIG. 1, Figure 3 The application provides a domain name resolution method, and the method comprises the following steps:
[0067] In step 301, a first network device generates a first message.
[0068] The first message comprises identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message.
[0069] Here, the first message is an Internet interconnection protocol message, and the Internet interconnection protocol message comprises a data area. The identification information is in a Type field and a Code field of the data area.
[0070] For example, a client of the first network device is used as a query initiator, and assembles an ICMP message. ICMPType+Code is marked, and it is assumed that a target IP is an IP to be queried (1.1.1.1).
[0071] In some embodiments of the application, when a value in the Type field is a first value and a value in the Code field is a second value, the first message is a reverse resolution request message.
[0072] In some embodiments of the present application, when the value in the type field is a third value and the value in the code field is a fourth value, the first message is not a reverse resolution request message; the third value is different from the first value, and the fourth value is different from the second value.
[0073] In the embodiments of the present application, Type+Code is used to mark whether the message type is a reverse resolution type, and is distinguished from known type coding combinations. According to the description of the ICMP protocol, any one of 44-252 can be used as the identification (Type) of reverse resolution, and the Code is set to a certain value in 0-255.
[0074] For example, the present application selects 200 as the message type of reverse type, selects 0 as the request packet code, and selects 1 as the response packet code. Then, when the client initiates a reverse resolution request, the combination of Type+Code in the message is 200, 0; when the server responds, the combination of Type+Code in the message is 200, 1.
[0075] Step 302, the first network device sends a first message to the second network device.
[0076] For example, the client of the first network device sends the assembled first ICMP message to the IP to be checked (1.1.1.1), i.e., the second network device.
[0077] Step 303, the second network device receives the first message sent by the first network device.
[0078] For example, the IP host to be checked (1.1.1.1) configures its domain name in the configuration file ( / etc / hosts).
[0079] The IP host to be checked (1.1.1.1) receives the first ICMP message sent by the client of the first network device.
[0080] Step 304, the second network device parses the first message to obtain identification information.
[0081] For example, after receiving the first ICMP message, the IP host to be checked (1.1.1.1) judges the ICMP TYPE+CODE combination to identify whether it is a reverse resolution request.
[0082] Step 305, the second network device sends a second message to the first network device based on the identification information.
[0083] The second message is a response message of the first message obtained based on the identification information.
[0084] Step 306, the first network device receives the second message sent by the second network device.
[0085] For example, the IP host to be queried (1.1.1.1) generates a second message based on the ICMP TYPE+CODE combination and sends the second message to the first network device.
[0086] In some embodiments of the application, when the value in the type field is the first value and the value in the code field is the second value, the second message is a message obtained by encapsulating a domain name.
[0087] In some embodiments of the application, the second network device determines that the value in the type field is the first value and the value in the code field is the second value, and encapsulates a domain name to obtain the second message.
[0088] Here, the second network device encapsulates a domain name to obtain the second message, which can be achieved by the following steps: obtaining the domain name from the host name configuration file; and encapsulating the domain name in the data area of the Internet Protocol message to obtain the second message.
[0089] For example, the IP host to be queried (1.1.1.1) queries the domain name configuration file / etc / hosts and assembles the query result into an ICMP response to obtain a second ICMP message.
[0090] For example, in combination with Figure 4 As shown in FIG. 4, a query module is provided on the client 401 of the first network device, which is responsible for assembling and sending ICMP messages; and a resolution module is provided on the host 402 of the second network device, which is responsible for processing all ICMP resolution requests. The host 402 of the second network device adjusts the original ICMP processing logic by modifying the kernel protocol stack ICMP module or mounting a new kernel module. After receiving the ICMP message, the second network device judges the type of the ICMP message. For reverse resolution type, the response message is assembled according to the above process, otherwise, it is processed according to the normal process or flexibly processed according to business needs.
[0091] The TYPE and CODE combination marks whether the ICMP message is a reverse resolution query request. The TYPE and CODE combination is distinguished from the existing protocol value agreement, and the query module and the resolution module agree on the TYPE and CODE combination value.
[0092] As can be seen from the above, the application uses the ICMP protocol to receive a reverse resolution query request at the network layer and carries the resolution result in the ICMP response. In one implementable scenario, it is assumed that the domain name of IP: 1.1.1.1 is www.test.com, and a terminal needs to query the domain name of 1.1.1.1. The following steps are performed:
[0093] Step 1, the client (query initiator) assembles an ICMP message and marks the ICMP TYPE+CODE, and the target IP is the IP to be queried (1.1.1.1);
[0094] Step 2, the client sends the assembled ICMP message to the IP to be queried (1.1.1.1);
[0095] Step 3, the IP to be queried host (1.1.1.1) configures its domain name in a configuration file ( / etc / hosts);
[0096] Step 4, after receiving the ICMP message, the IP to be queried host (1.1.1.1) judges the ICMP TYPE+CODE combination and identifies the reverse resolution request;
[0097] Step 5, the IP to be queried host (1.1.1.1) queries the domain name configuration file / etc / hosts and assembles the query result into an ICMP response;
[0098] Step 6, the IP to be queried host (1.1.1.1) sends the response message to the query initiator.
[0099] From the above, it can be seen that the application performs forward / reverse domain name query through the ICMP protocol, solves the problem that in the related art, the domain name resolution mode query process is complex, and any pointer record change needs to go through a certain delay before it takes effect, according to the content indicated by the identification information, the corresponding response message is quickly obtained, the response message carries the processing result corresponding to the identification information, the process of domain name resolution is simplified, and the efficiency of reverse resolution is improved.
[0100] Embodiments of the application provide a first domain name resolution device, which can be applied to Figure 1 In a domain name resolution method provided by a corresponding embodiment, referring to Figure 5 As shown in the figure, the first domain name resolution device 500 includes:
[0101] The first processing unit 501 is configured to generate a first message; the first message includes identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message;
[0102] The first sending unit 502 is configured to send the first message to a second network device;
[0103] The first receiving unit 503 is configured to receive a second message sent by the second network device; the second message is a response message of the first message based on the identification information.
[0104] In some embodiments of the present application, the first message is an Internet Protocol message, and the Internet Protocol message includes a data field, and the identification information is in the data field.
[0105] In some embodiments of the present application, the identification information is in a type field and a code field of the data field.
[0106] In some embodiments of the present application, when the value in the type field is a first value and the value in the code field is a second value, the first message is a reverse resolution request message.
[0107] In some embodiments of the present application, when the value in the type field is a third value and the value in the code field is a fourth value, the first message is not a reverse resolution request message; the third value is different from the first value, and the fourth value is different from the second value.
[0108] The present application provides a first domain name resolution device, which generates a first message; the first message includes identification information, the identification information is used to indicate whether the first message is a reverse resolution request message; the first message is sent to a second network device; a second message sent by the second network device is received; the second message is a response message of the first message based on the identification information; the problem that in the related art, the domain name resolution mode query process is complex, and any pointer record change needs to be effective after a certain delay, is solved; according to the content indicated by the identification information, the corresponding response message is quickly obtained, the response message carries the processing result corresponding to the identification information, the process of domain name resolution is simplified, and the efficiency of reverse resolution is improved.
[0109] It should be noted that the same steps and the same content in the present embodiment and other embodiments are described with reference to the descriptions in other embodiments, and will not be described here.
[0110] Embodiments of the present application provide a second domain name resolution device, which can be applied to Figure 2 In a domain name resolution method provided by a corresponding embodiment, referring to Figure 6 As shown in the figure, the second domain name resolution device 600 includes:
[0111] A second receiving unit 601 is configured to receive a first message sent by a first network device; the first message includes identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message.
[0112] A second processing unit 602 is configured to parse the first message to obtain the identification information.
[0113] A second sending unit 603 is configured to send a second message to the first network device based on the identification information; the second message is a response message of the first message based on the identification information.
[0114] In some embodiments of the present application, the first message is an Internet Protocol message, and the Internet Protocol message includes a data field, and the identification information is in a type field and a code field of the data field.
[0115] In some embodiments of the present application, when the value in the type field is the first value and the value in the code field is the second value, the second message is a message obtained by encapsulating the domain name.
[0116] In some embodiments of the present application, the second processing unit 602 is configured to, if the value in the type field is the first value and the value in the code field is the second value, encapsulate the domain name to obtain the second message.
[0117] In some embodiments of the present application, the second processing unit 602 is configured to obtain the domain name from the host name configuration file, and encapsulate the domain name in the data field of the Internet Protocol message to obtain the second message.
[0118] The present application provides a second domain name resolution device, which receives a first message sent by a first network device; the first message includes identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message; the first message is resolved to obtain the identification information; and a second message is sent to the first network device based on the identification information; the second message is a response message of the first message based on the identification information, which solves the problem that in the related art, the query process of the domain name resolution mode is complex, and any change of a pointer record needs to experience a certain delay before taking effect, according to the content indicated by the identification information, the corresponding response message is quickly obtained, the response message carries a processing result corresponding to the identification information, the process of the domain name resolution is simplified, and the efficiency of the reverse resolution is improved.
[0119] Embodiments of the present application provide a first network device, which can be applied to Figure 1 A corresponding embodiment provides a domain name resolution method, which refers to Figure 7 As shown in the figure, the first network device 700 includes a first processor 701, a first memory 702, and a first communication bus 703, wherein the first communication bus 703 is used to realize the communication connection between the first processor 701 and the first memory 702.
[0120] The first processor 701 is used to execute a domain name resolution program stored in the first memory 702 to realize the following steps:
[0121] generate a first message; the first message includes identification information, and the identification information is used to indicate whether the first message is a reverse resolution request message;
[0122] send the first message to a second network device;
[0123] receive a second packet sent by the second network device; the second packet is a response packet of the first packet based on the identification information.
[0124] In some embodiments of the present application, the first packet is an Internet Protocol packet, and the Internet Protocol packet includes a data field, and the identification information is in the data field.
[0125] In some embodiments of the present application, the identification information is in a type field and a code field of the data field.
[0126] In some embodiments of the present application, when the value in the type field is a first value and the value in the code field is a second value, the first packet is a reverse resolution request packet.
[0127] In some embodiments of the present application, when the value in the type field is a third value and the value in the code field is a fourth value, the first packet is not a reverse resolution request packet; the third value is different from the first value, and the fourth value is different from the second value.
[0128] Therefore, in the present application, the first network device can send the first packet including the identification information to the second network device, so that the second network device sends a response packet of the first packet to the first network device after receiving the first packet. In the case that the identification information is used to indicate that the first packet is a reverse resolution request packet, the first network device can quickly obtain the queried domain name. In the case that the identification information is used to indicate that the first packet is not a reverse resolution request packet, the first network device can quickly obtain the related processing result (for example, processing according to the corresponding process or flexible processing according to the business needs).
[0129] It should be noted that the same steps and the same content in the present embodiment and other embodiments are described in other embodiments, and will not be described here.
[0130] Embodiments of the present application provide a second network device, which can be applied to Figure 1 In a domain name resolution method provided by the corresponding embodiments, refer to Figure 8 As shown in the figure, the second network device 800 includes a second processor 801, a second memory 802 and a second communication bus 803, wherein the second communication bus 803 is used to realize the communication connection between the second processor 801 and the second memory 802.
[0131] The second processor 801 is used to execute the domain name resolution program stored in the second memory 802, so as to realize the following steps:
[0132] receive a first packet sent by the first network device; the first packet includes identification information, and the identification information is used to indicate whether the first packet is a reverse resolution request packet;
[0133] parsing the first message to obtain the identification information;
[0134] sending, based on the identification information, a second message to the first network device; the second message is a response message of the first message based on the identification information.
[0135] In some embodiments of the present application, the first message is an Internet Protocol message, and the Internet Protocol message includes a data field, and the identification information is in a type field and a code field of the data field.
[0136] In some embodiments of the present application, when the value in the type field is the first value and the value in the code field is the second value, the second message is a message obtained by encapsulating the domain name.
[0137] In some embodiments of the present application, the second processor 801 is configured to execute the domain name resolution program stored in the second memory 802 to implement the following steps:
[0138] If the value in the type field is the first value and the value in the code field is the second value, the domain name is encapsulated to obtain the second message.
[0139] In some embodiments of the present application, the second processor 801 is configured to execute the domain name resolution program stored in the second memory 802 to implement the following steps:
[0140] obtaining the domain name from the host name configuration file;
[0141] encapsulating the domain name in the data field of the Internet Protocol message to obtain the second message.
[0142] The processor involved in the present application can be an integrated circuit chip with signal processing capability, such as a general purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., wherein the general purpose processor can be a microprocessor or any conventional processor.
[0143] It should be noted that the same steps and the same content in the present embodiment and other embodiments are described with reference to the description of other embodiments, and will not be described here.
[0144] Embodiments of the present application provide a computer storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps as shown in Figure 1 or Figure 2 .
[0145] It should be noted that the same steps and the same content in the embodiments need not be repeated here, and the description in other embodiments can be referred to.
[0146] It should be noted that the above computer storage medium / memory can be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Ferromagnetic Random Access Memory (FRAM), a Flash Memory, a magnetic surface memory, an optical disc, or a Compact Disc Read-Only Memory (CD-ROM), etc. storage memory; or can be various terminals including one or any combination of the above storage memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.
[0147] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling or direct coupling or communication connection between the various components shown or discussed can be through some interface, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or other forms.
[0148] The units described above as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units; part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0149] In addition, each function unit in each embodiment of the present application can be integrated in one processing module, or each unit can be separately taken as one unit, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function unit. Those skilled in the art can understand that all or part of the steps of the foregoing method embodiments can be completed by a program instructing related hardware, the foregoing program can be stored in a computer readable storage medium, and the program executes the steps of the foregoing method embodiments when executed; and the foregoing storage medium includes a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various media capable of storing program codes.
[0150] The methods disclosed in the several method embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0151] The features disclosed in the several product embodiments provided by the present application can be combined arbitrarily without conflict to obtain new product embodiments.
[0152] The features disclosed in the several method or device embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
[0153] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A domain name resolution method, characterized in that, Applied to a first network device, the method includes: Generate a first message; the first message includes identification information, which is used to indicate whether the first message is a reverse DNS lookup request message; Send the first message to the second network device; The system receives a second message sent by the second network device; the second message is a response message to the first message obtained based on the identification information, and the second message is a message obtained by encapsulating the domain name.
2. The method according to claim 1, characterized in that, The first message is an Internet Protocol (IP) message, which includes a data area, and the identification information is in the data area.
3. The method according to claim 2, characterized in that, The identification information is in the data area, including: the identification information is in the type field and the code field of the data area.
4. The method according to claim 3, characterized in that, When the value in the type field is the first value and the value in the code field is the second value, the first message is a reverse parsing request message.
5. The method according to claim 4, characterized in that, When the value in the type field is the third value and the value in the code field is the fourth value, the first message is not a reverse resolution request message; the third value is different from the first value, and the fourth value is different from the second value.
6. A domain name resolution method, characterized in that, Applied to a second network device, the method includes: Receive a first message sent by a first network device; the first message includes identification information, which is used to indicate whether the first message is a reverse DNS lookup request message; Parse the first message to obtain the identification information; Based on the identification information, a second message is sent to the first network device; the second message is a response message to the first message obtained based on the identification information, and the second message is a message obtained by encapsulating the domain name.
7. The method according to claim 6, characterized in that, The first message is an Internet Protocol (IP) message, which includes a data area, and the identification information is in the type field and code field of the data area.
8. The method according to claim 7, characterized in that, When the value in the type field is a first value and the value in the code field is a second value, the second message is a message obtained by encapsulating the domain name.
9. The method according to claim 7, characterized in that, The step of sending a second message to the first network device based on the identification information includes: If the value in the type field is a first value and the value in the code field is a second value, the domain name is encapsulated to obtain the second message, and the second message is sent to the first network device.
10. The method according to claim 9, characterized in that, The process of encapsulating the domain name to obtain the second message includes: Obtain the domain name from the hostname configuration file; The domain name is encapsulated in the data area of an Internet Protocol (IP) message to obtain the second message.
Citation Information
Patent Citations
DoH service identification method and device
CN113438332A
Domain name blocking method and device, equipment, medium and program product
CN114760267A