CN107613039B - IP address attribution inquiry method, device, system and storage medium - Google Patents

IP address attribution inquiry method, device, system and storage medium Download PDF

Info

Publication number
CN107613039B
CN107613039B CN201710851764.5A CN201710851764A CN107613039B CN 107613039 B CN107613039 B CN 107613039B CN 201710851764 A CN201710851764 A CN 201710851764A CN 107613039 B CN107613039 B CN 107613039B
Authority
CN
China
Prior art keywords
domain name
address
reference domain
attribution
query
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
CN201710851764.5A
Other languages
Chinese (zh)
Other versions
CN107613039A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710851764.5A priority Critical patent/CN107613039B/en
Publication of CN107613039A publication Critical patent/CN107613039A/en
Application granted granted Critical
Publication of CN107613039B publication Critical patent/CN107613039B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present disclosure provides a method, an apparatus, a system and a storage medium for inquiring an IP address home location, wherein the method comprises: converting the IP address of the user terminal into a target domain name; sending a query request carrying the target domain name to a DNS server, wherein the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used for identifying an IP address range to which the IP address belongs; receiving a reference domain name returned by a DNS server; and searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution. By applying the scheme disclosed by the invention, the query efficiency of the IP address attribution can be improved.

Description

IP address attribution inquiry method, device, system and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a system, and a storage medium for querying an IP address home location.
Background
The IP Address refers to an Internet Protocol Address (english: Internet Protocol Address, which is also translated into an Internet Protocol Address). The IP address is a uniform address format provided by the IP protocol, and it allocates a logical address to each network and each host on the internet, so as to mask the difference of physical addresses.
IP address home querying is a very common requirement to query which province, city or operator, etc. the IP address belongs to by the IP address in the user request. Generally, IP addresses are distributed in segments, and a set of IP addresses in a continuous range is distributed to a province, a city or an operator. For example, the IPs belonging to the IP address ranges 1.23.64.0-1.23.74.255 belong to region A, and the IPs belonging to the IP address ranges 1.23.75.0-1.23.79.255 belong to region B. It can be seen that the IP address 1.23.78.33 of the user falls within the IP address range of region B, indicating that the home location of the IP address is region B.
In the related art, the IP address range to which the IP address belongs is often queried from the database to determine the location of the IP address, and since the database is stored in the hard disk, data needs to be read from the hard disk when the IP address location is queried, the query efficiency is low.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method, apparatus, system, and storage medium for querying an IP address home.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for querying an IP address home, where the method is applied to a query server, and the method includes:
converting the IP address of the user terminal into a target domain name;
sending a query request carrying the target Domain Name to a Domain Name System (DNS) server, wherein the query request indicates the DNS server to query a reference Domain Name corresponding to the target Domain Name, and the reference Domain Name is used for identifying an IP address range to which the IP address belongs;
receiving a reference domain name returned by a DNS server;
and searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution.
In an optional implementation manner, the converting the IP address of the user terminal into the target domain name includes:
converting the IP address into a number;
and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
In an alternative implementation, the converting the IP address into a number may include:
converting the decimal number of each byte in the IP address into a hexadecimal number;
combining the hexadecimal numbers obtained by converting each byte according to the byte sequence in the IP address to obtain a hexadecimal number;
and converting the hexadecimal number obtained by combination into a decimal number to obtain a number corresponding to the IP address.
In an optional implementation manner, the reference domain name is obtained by performing domain name conversion based on an upper limit IP address in an IP address range to which the IP address belongs.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for querying an IP address home, where the method is applied to a DNS server, and the method includes:
receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to an IP address;
querying a reference domain name corresponding to the target domain name based on the query request, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and sending the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determining the found attribution as the attribution of the IP address, wherein the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
In an optional implementation manner, the querying a reference domain name corresponding to the target domain name based on the query request includes:
and querying a reference Domain Name corresponding to the target Domain Name from a zone file, wherein the zone file is obtained by signing the reference Domain Name in the DNS by utilizing a DNSSEC (Domain Name System Security Extensions) protocol, and the reference Domain Name is obtained by performing Domain Name conversion on an upper-limit IP address in an IP address range to which the IP address belongs.
In an optional implementation manner, the record sets of the reference domain names in the region file are sorted according to a preset policy, where the record sets at least include a Next security record (which may be referred to as a NESC record), and the NESC record records a name of the reference domain name of the Next record set;
the querying a reference domain name corresponding to the target domain name from the slave zone file includes:
inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending NESC records in a record set of the first reference domain name to the inquiry server;
the sent NESC record records the name of a second reference domain name, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name.
According to a third aspect of the embodiments of the present disclosure, there is provided an IP address attribution inquiring apparatus, the apparatus including:
an information conversion module configured to convert an IP address of a user terminal into a target domain name;
the information communication module is configured to send a query request carrying the target domain name to the DNS server and receive a reference domain name returned by the DNS server; the query request indicates a DNS server to query a reference domain name corresponding to the target domain name, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and the attribution determining module is configured to search an attribution corresponding to the reference domain name based on a preset corresponding relation, and determine the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is a pre-stored corresponding relation between the reference domain name and the attribution.
In an optional implementation manner, the information conversion module is specifically configured to:
converting the IP address into a number;
and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
In an optional implementation manner, the information conversion module is specifically configured to:
converting the decimal number of each byte in the IP address into a hexadecimal number;
combining the hexadecimal numbers obtained by converting each byte according to the byte sequence in the IP address to obtain a hexadecimal number;
and converting the hexadecimal number obtained by combination into a decimal number to obtain a number corresponding to the IP address.
In an optional implementation manner, the reference domain name is obtained by performing domain name conversion based on an upper limit IP address in an IP address range to which the IP address belongs.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an IP address attribution inquiring apparatus, the apparatus including:
the information communication module is configured to receive a query request sent by a query server, wherein the query request carries a target domain name corresponding to the IP address;
a domain name query module configured to query a reference domain name corresponding to the target domain name based on the query request, where the reference domain name is used to identify an IP address range to which the IP address belongs;
the information communication module is further configured to send the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determines the found attribution as the attribution of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
In an optional implementation manner, the domain name querying module is specifically configured to:
and querying a reference domain name corresponding to the target domain name from a zone file, wherein the zone file is obtained by signing the reference domain name in the DNS by utilizing a DNSSEC protocol, and the reference domain name is obtained by performing domain name conversion on the upper limit IP address in an IP address range to which the IP address belongs.
In an optional implementation manner, record sets of reference domain names in the zone file are sorted according to a preset policy, where the record sets at least include NESC records in which names of reference domain names of a next record set are recorded;
the domain name query module is specifically configured to:
inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending NESC records in a record set of the first reference domain name to the inquiry server;
the sent NESC record records the name of a second reference domain name, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name.
According to a fifth aspect of the embodiments of the present disclosure, there is provided an IP address home location query system, which includes a query server and a DNS server;
the query server converts the IP address of the user terminal into a target domain name, and sends a query request carrying the target domain name to the DNS server;
the DNS server queries a reference domain name corresponding to the target domain name based on the query request, and sends the reference domain name to the query server, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and the query server searches for the home location corresponding to the reference domain name based on a preset corresponding relationship, and determines the found home location as the home location of the IP address, wherein the preset corresponding relationship is the pre-stored corresponding relationship between the reference domain name and the home location.
According to a sixth aspect of the embodiments of the present disclosure, there is provided an IP address attribution inquiring apparatus, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:
converting the IP address of the user terminal into a target domain name;
sending a query request carrying the target domain name to a DNS server, wherein the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used for identifying an IP address range to which the IP address belongs;
receiving a reference domain name returned by a DNS server;
and searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution.
According to a seventh aspect of the embodiments of the present disclosure, there is provided an IP address attribution inquiring apparatus, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:
receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to an IP address;
querying a reference domain name corresponding to the target domain name based on the query request, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and sending the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determining the found attribution as the attribution of the IP address, wherein the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the above-mentioned IP address home querying method in the querying server.
According to a ninth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the above-mentioned IP address home querying method applied in the DNS server.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the method and the device, the IP address of the user terminal is converted into the target domain name through the query server, the target domain name is sent to the DNS server, the DNS server queries the reference domain name corresponding to the target domain name based on the query request, and the reference domain name is used for identifying the IP address range to which the IP address belongs, so that after the DNS server sends the reference domain name to the query server, the query server can search the attribution corresponding to the reference domain name based on the preset corresponding relation, the searched attribution is determined as the attribution of the IP address, and the IP address attribution is rapidly queried.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a network architecture diagram illustrating one type of IP address home lookup in accordance with an exemplary embodiment of the present disclosure.
Fig. 2 is a flow chart illustrating an IP address home querying method according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flow chart illustrating another IP address home lookup method according to an example embodiment of the present disclosure.
FIG. 4 is a flowchart illustrating a zone file generation process according to an exemplary embodiment of the present disclosure.
Fig. 5 is an interaction diagram illustrating an IP address home querying method according to an exemplary embodiment of the present disclosure.
Fig. 6 is a block diagram of an IP address home lookup system shown in accordance with an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram illustrating an IP address home querying device according to an example embodiment of the present disclosure.
Fig. 8 is a block diagram illustrating another IP address home querying device in accordance with an example embodiment of the present disclosure.
Fig. 9 is a block diagram illustrating an apparatus for IP address home querying according to an example embodiment.
Fig. 10 is a block diagram illustrating another apparatus for IP address home querying according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to better understand the method, device, system and storage medium for querying the home location of an IP address disclosed by the present invention, the DNS and DNSSEC protocols are introduced first. The Domain Name System (abbreviated DNS) is a distributed database on the internet that maps Domain names and IP addresses to each other. The DNS includes a series of records describing the name, IP address, and other information about the host. These databases reside in DNS servers. In the DNS system, common resource record types are:
host record (a record): RFC 1035 defines that an a record is an important record for name resolution that maps a particular host name to the IP address of the corresponding host. Among them, Request For Comments, abbreviated as RFC, may be a series of memos issued by the Internet Engineering Task Force (IETF).
Alias record (CNAME record) RFC 1035 defines that a CNAME record is used to point an alias to an a record, so that there is no need to create a new a record for a new name.
IPv6(Internet Protocol version 6, version 6 of the Internet communication Protocol) host records (AAAA records or IPv6IP address records): RFC 3596 defines, corresponding to an a record, for mapping a particular host name to a host's IPv6 address.
Service location record (SRV record): RFC 2782 defines the location of a server that provides a particular service, such as a host (hostname), port (port number), etc.
Name management pointer (NAPTR record): RFC 3403 defines that it provides a regular expression approach to mapping a domain name. One application where NAPTR records are very well known is for ENUM queries.
The Domain Name System Security Extensions (DNSSEC) protocol is a Security protocol based on the DNS protocol, and adds a Security barrier to the DNS by signing the zone file of the original DNS. On the basis of the existing Record types of the original DNS, such as A, AAAA, NS, CNAME and the like, new records of RRSIG (Resource Record Signature), DNSKEY (DNS Public Key ), DS (derivation Signature, representative Signer), NSEC (Next Secure Record) and the like are added, and each Record of the same domain forms a Record set of the domain. The zone file signed by DNSSEC may be a total record set in which the record sets are sorted according to a predetermined policy (e.g., alphabetical sorting), and each record set of a domain name has a corresponding NSEC record that identifies which types of records the domain name has and who the next domain name is. When the zone data is signed, the NSEC record is automatically generated. For example, NSEC records are inserted between vpn.test.net and xyz.test.net, and may include two items: the name of the next resource record after sorting (xyz.test.net.), and the resource record types (a, RRSIG, NSEC) of the name vpn.test.net. When a domain name requested by a user is between vpn and xyz, as in www.test.net., the DNS server will return that the domain name is not present and return the NSEC record for vpn.
In addition, application scenarios used in the embodiments of the present disclosure are also explained. As shown in fig. 1, fig. 1 is a network architecture diagram illustrating an IP address home lookup according to an exemplary embodiment of the present disclosure. The network architecture comprises a user terminal, a query server and a DNS server. The user terminal may be a smart phone, a tablet computer, a PDA (Personal Digital Assistant), an e-book reader, a multimedia player, etc. The query server may be a server that can query an IP address home, and the server may be a server, a server cluster, a cloud platform, or the like. For example, the query server may be a Web server. The DNS server is a server provided with a DNS, and the server may be a server, a server cluster, a cloud platform, or the like.
In the related art, the IP address range to which the IP address belongs is often queried from the database to determine the location of the IP address, and since the database is stored in the hard disk, data needs to be read from the hard disk when the IP address location is queried, the query efficiency is low.
In order to avoid the defect of low query efficiency in the related art, the present disclosure provides an IP address home query method, which can be applied to a network architecture as shown in fig. 1, and convert an IP address of a user terminal into a target domain name through a query server, and send the target domain name to a DNS server. The DNS server queries a reference domain name corresponding to the target domain name based on the query request. Because the reference domain name is used for identifying the IP address range to which the IP address belongs, and the IP address range corresponds to the home location, after the DNS server sends the reference domain name to the query server, the query server can search the home location corresponding to the reference domain name based on the preset corresponding relation, so that the found home location is determined as the home location of the IP address, and the IP address can be rapidly queried. The embodiments of the present disclosure are described below with reference to the accompanying drawings.
First, introduction is made from a query server, as shown in fig. 2, fig. 2 is a flowchart of an IP address home query method shown in the present disclosure according to an exemplary embodiment, where the method is applied to the query server, and the method includes:
in step 201, the IP address of the user terminal is converted into a target domain name. IP is an abbreviation for network protocol, and network protocol addresses are often abbreviated as IP addresses.
In step 202, a query request carrying the target domain name is sent to a DNS server, where the query request indicates that the DNS server queries a reference domain name corresponding to the target domain name, and the reference domain name is used to identify an IP address range to which the IP address belongs. The DNS is an abbreviation for a domain name system, and a domain name system server is often abbreviated as a DNS server.
In step 203, a reference domain name returned by the DNS server is received.
In step 204, a home location corresponding to the reference domain name is searched for based on a preset corresponding relationship, and the found home location is determined as the home location of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the home location.
Next, introducing from a DNS server, as shown in fig. 3, fig. 3 is a flowchart of another IP address home location query method shown in the present disclosure according to an exemplary embodiment, where the method is applied to the DNS server, and the method includes:
in step 301, an inquiry request sent by an inquiry server is received, where the inquiry request carries a target domain name corresponding to an IP address.
In step 302, a reference domain name corresponding to the target domain name is queried based on the query request, where the reference domain name is used to identify an IP address range to which the IP address belongs.
In step 303, the reference domain name is sent to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determines the found attribution as the attribution of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
In order to better understand the IP address home query method disclosed in the present invention, the embodiment of the present disclosure is exemplified by combining an embodiment applied to a query server and an embodiment applied to a DNS server.
The user terminal may send an HTTP (HyperText Transfer Protocol) request to the query server, where the HTTP request carries an IP address of the user terminal. In the query server, the IP address of the user terminal may be converted into the target domain name according to a preset conversion policy. The target domain name is a domain name, and in order to distinguish the target domain name from a subsequent reference domain name, a domain name obtained by performing domain name conversion on an IP address of the user terminal is called a target domain name.
In one embodiment, correspondence between different target domain names and IP addresses may be stored in advance, and after the IP address of the user terminal is obtained, the target domain name corresponding to the IP address of the user terminal may be queried from the correspondence between the domain name and the IP address, so as to convert the IP address of the user terminal into the target domain name, for example, convert the IP address (208.80.152.2) into the target domain name (www.
Because the number of the IP addresses is large, the information amount of the correspondence between the domain name and the IP address is large, and in order to improve the domain name conversion efficiency, in another embodiment, the IP address may be combined with a preset top-level domain to form a formal domain name. The preset top-level domain is a preset top-level domain name, and may be, for example,. com or,. cn, etc. The combination may be by adding the top-level domain name directly after the IP address. For example, the IP address (208.80.152.2) is converted to a target domain name (208.80.152.2. com).
Therefore, by directly adding the preset top-level domain name behind the IP address, the domain name conversion efficiency can be improved, and corresponding domain names do not need to be allocated to all the IP addresses in advance to establish the corresponding relation between the domain names and the IP addresses.
In another embodiment, the IP address is a 32-bit binary number, typically divided into 4 sets of "8-bit binary numbers" (i.e., 4 bytes). An IP address is usually expressed in the form of (a.b.c.d) "dotted decimal", where a, b, c, d are all decimal integers between 0 and 255, which is understood to include 4 decimal numbers. Example (c): the dotted decimal IP address (100.4.5.6), is actually a 32-bit binary number (01100100.00000100.00000101.00000110). Therefore, if the preset top-level domain name is directly added after the IP address, the domain name formed by the IP address and the top-level domain name needs to be searched in the subsequent domain name search.
In order to improve the domain name conversion efficiency and improve the search efficiency in subsequent domain name search, the converting the IP address of the user terminal into the target domain name includes:
converting the IP address into a number;
and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
It can be seen that the target domain name corresponding to the IP address is obtained by converting the decimal point expressed by the IP address into a number and combining the number with the preset top-level domain name, and the target domain name is a formal domain name. And when the subsequent domain name is searched, the numbers are compared, so that the searching efficiency can be improved.
Regarding the conversion of the IP address into the number, as one of the conversion manners, the converting the IP address into the number may include:
converting the decimal number of each byte in the IP address into a hexadecimal number;
combining the hexadecimal numbers obtained by converting each byte according to the byte sequence in the IP address to obtain a hexadecimal number;
and converting the hexadecimal number obtained by combination into a decimal number, namely converting the IP address into a number.
The decimal number of each byte is equivalent to each group of decimal numbers, namely, each group of decimal numbers in the IP address are converted into hexadecimal numbers, the hexadecimal numbers obtained by conversion of each group are combined according to the array sequence in the IP address, a hexadecimal number is obtained by combination, and the hexadecimal numbers obtained by combination are converted into decimal numbers, namely, the IP address is converted into numbers. Taking an example that the IP address (a.b.c.d) includes four groups (byte) of a, b, c, d, respectively converting decimal a, b, c, d into hexadecimal a ', b', c ', d', and combining a ', b', c ', d' according to the byte order in the IP address to obtain a hexadecimal number: a 'b' c'd', converting a 'b' c'd' obtained by combination into a decimal number, and obtaining a number corresponding to the IP address.
For example, for 1.23.74.255, the decimal number 1 of the first byte may be converted into a hexadecimal number 01, the decimal number 23 of the second byte may be converted into a hexadecimal number 17, the decimal data 74 of the third byte may be converted into a hexadecimal number 4A, the decimal number 255 of the fourth byte may be converted into a hexadecimal number FF, the obtained hexadecimal numbers are combined in byte order to obtain 1174AFF, and then the 1174AFF is converted into a decimal number to obtain a string of numbers 18303743, which is the number corresponding to 1.23.74.255.
For another example, for 1.23.75.8, the decimal number 1 of the first byte may be converted into a hexadecimal number 01, the decimal number 23 of the second byte may be converted into a hexadecimal number 17, the decimal data 75 of the third byte may be converted into a hexadecimal number 4B, the decimal number 8 of the fourth byte may be converted into a hexadecimal number 08, the obtained hexadecimal numbers are combined in byte order to obtain 1174B08, and the 1174B08 may be converted into a decimal number to obtain a string of numbers 18303752, which is the number corresponding to 1.23.75.8.
Regarding the preset Top level Domain, the Top level Domain (or Top level Domain name; english: Top-level Domain; english abbreviation: TLD) is the highest level Domain among the DNS levels of the internet, which is stored in the namespace of the DNS root Domain. COM, the top domain name is the last part of the domain name, e.g., in example. COM, the top domain is.
Regarding combining numbers with the preset top level domain, in one example, the numbers may be placed into the preset top level domain as a first level domain name. For example, assuming the top level domain is the com domain, the IP address translation gets a number of 18303743, the combination gets the target domain name: 18303743. com.
In the query server, after the IP address of the user terminal is converted into the target domain name, the query request carrying the target domain name can be sent to the DNS server. And the query request indicates a DNS server to query a reference domain name corresponding to the target domain name, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs.
In a DNS server, receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to an IP address; and querying a reference domain name corresponding to the target domain name based on the query request. Because the reference domain name is used for identifying the IP address range to which the IP address belongs, and the home location can be determined based on the IP address range, after the DNS server sends the reference domain name to the query server, the query server can search the home location corresponding to the reference domain name based on the preset corresponding relation, thereby realizing the query of the home location of the IP address.
Regarding querying a reference domain name corresponding to a target domain name based on a query request, in an example, the reference domain name corresponding to the target domain name may be queried from a zone file, where the zone file is obtained by signing a reference domain name in a DNS by using a DNSSEC protocol, and the reference domain name is obtained by performing domain name conversion based on an upper-limit IP address in an IP address range to which the IP address belongs.
Since the reference domain name is obtained by performing domain name conversion on the upper limit IP address in the IP address range to which the IP address belongs, an IP address range, which is the IP address range to which the IP address of the user terminal belongs, can be determined according to the reference domain name. Therefore, the IP address range to which the IP address belongs can be determined by inquiring the reference domain name corresponding to the target domain name, and the inquiry efficiency is improved.
In one embodiment, the zone file may be pre-generated at the DNS server. As shown in fig. 4, fig. 4 is a flowchart of a zone file generation process shown in the present disclosure according to an exemplary embodiment, and includes the following steps 401 and 402:
in step 401, domain name conversion is performed on the upper limit IP address in each IP address range to obtain a reference domain name.
Since the IP addresses are all distributed in segments, a set of IP addresses in a continuous range is distributed to a province, a city or an operator. For example, the IPs belonging to the IP address ranges 1.23.64.0-1.23.74.255 belong to region A, and the IPs belonging to the IP address ranges 1.23.75.0-1.23.79.255 belong to region B.
In the adjacent IP address range, the upper IP address of the preceding IP address range is consecutive to the lower IP address of the succeeding IP address range without any intervening IP addresses, so that the IP address range can be identified by the upper IP address or the lower IP address in the IP address range. As an implementation, the embodiment of the present disclosure may identify the IP address range by using an upper limit IP address in the IP address range.
The upper limit IP address is the maximum IP address in the IP address range. For example, when the IP address range is 1.23.64.0 ~ 1.23.74.255, the upper limit IP address is 1.23.74.255, the IP address range is: 1.23.75.0-1.23.79.255, the upper limit IP address is 1.23.79.255. The lower IP address is the smallest IP address in the IP address range. For example, when the IP address range is 1.23.64.0 ~ 1.23.74.255, the lower limit IP address is 1.23.64.0, and the IP address range is: 1.23.75.0-1.23.79.255, the lower IP address limit is 1.23.75.0.
The conversion strategy for converting the upper limit IP address into the domain name may adopt the above-mentioned conversion strategy for converting the IP address into the target domain name, and is not described herein in detail for saving space.
In step 402, the reference domain name is stored in the DNS, and the DNSSEC protocol is used to sign the reference domain name in the DNS to obtain the zone file.
When the reference domain name is stored in the DNS, an original zone file is generated, and after the original zone file in the DNS is signed by using the DNSSEC protocol, the zone file mentioned in the present disclosure can be obtained. The zone file mentioned in the present disclosure includes a record set of each reference domain name, and the record sets of each reference domain name are ordered according to a preset policy, that is, the record sets exist sequentially. In one example, the preset policies may be alphabetically ordered policies, or the like.
The DNS server can query a reference domain name corresponding to the target domain name from the zone file, and the reference domain name is obtained by performing domain name conversion on the basis of an upper limit IP address in an IP address range to which the IP address belongs, wherein the upper limit IP address is only part of IP addresses in all the IP addresses, so that the reference domain name recorded in the zone file is only part of the domain name, and the number of the reference domain names recorded in the zone file is less than that of the target domain names obtained by all the IP addresses. In view of this, when a reference domain name matching the target domain name exists in the zone file, the matched reference domain name may be used as the reference domain name corresponding to the target domain name; if the reference domain name matched with the target domain name does not exist in the zone file, the reference domain name associated with the target domain needs to be searched, and the associated reference domain name is used as the reference domain name corresponding to the target domain name, wherein the associated reference domain name identifies the IP address range to which the IP address corresponding to the target domain name belongs.
In an alternative implementation, the record set of the reference domain name includes at least a nesc (next secure) record, and the NSEC record is a record designed to respond to the absence of a record. The NESC record has the name of the reference domain name of the next record set recorded therein. Therefore, the querying the reference domain name corresponding to the target domain name from the zone file includes:
and querying the target domain name from the zone file, and sending NESC records in a record set of the first reference domain name to the query server side when the target domain name is between the first reference domain name and the second reference domain name.
The sent NESC record records the name of a second reference domain name, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name. The NESC record in the record set of the first reference domain name comprises the name of the second reference domain name. The IP address range identified by the first reference domain name and the IP address range identified by the second reference domain name are adjacent IP address ranges, that is, the upper limit IP address of the IP address range arranged in front is continuous with the lower limit IP address of the IP address range arranged in back, and there is no interval IP address.
As can be seen from the foregoing embodiments, in the present embodiment, since the result including the NESC record is sent to the query server, and the NESC record records the reference domain name of the next record set, the reference domain name corresponding to the target domain name is obtained, and it is further inferred that the IP address of the user terminal is within the IP address range in which the IP address corresponding to the second reference domain name (the reference domain name returned by the DNS server received by the query server) is the upper limit IP address, so that it is convenient to subsequently determine the home according to the IP address range.
The query server stores a corresponding relation between a reference domain name and a home location in advance. The corresponding relation is determined according to the relation between the reference domain name and the IP address range and the corresponding relation between the IP address range and the attribution. For example, the IP address ranges 1.23.64.0 to 1.23.74.255 correspond to a region a, and the IP address ranges 1.23.75.0 to 1.23.79.255 correspond to a region B, so that the reference domain names 18303743.com obtained by domain name conversion of the upper limit IP address (1.23.74.255) in the IP address ranges correspond to the IP address ranges 1.23.64.0 to 1.23.74.255, and the IP address ranges 1.23.64.0 to 1.23.74.255 correspond to the region a, the reference domain names 18303743.com correspond to the region a, and similarly, the reference domain names 18305018323. com (domain name converted by 1.23.79.255) correspond to the region B. The correspondence stored by the query server may exist in the form of a mapping table.
Therefore, when the query result includes the name of the reference domain name of the next record set, the home location corresponding to the reference domain name can be determined according to the name of the reference domain name and the corresponding relationship pre-stored in the query server, and the found home location is determined as the home location of the IP address.
It is understood that other types of records may be included in the record set, such as RRSIG, DNSKEY, DS, etc., which are not listed here.
The various technical features in the above embodiments can be arbitrarily combined, so long as there is no conflict or contradiction between the combinations of the features, but the combination is limited by the space and is not described one by one, and therefore, any combination of the various technical features in the above embodiments also belongs to the scope disclosed in the present specification. The following is illustrated with an interactive embodiment.
As shown in fig. 5, fig. 5 is an interaction diagram illustrating an IP address home querying method according to an exemplary embodiment of the present disclosure. In this diagram, the query server converts the IP address of the user terminal to a target domain name (step 501). The query server sends a query request carrying the target domain name to the DNS server, where the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used to identify an IP address range to which the IP address belongs (step 502). The DNS server queries a reference domain name corresponding to the target domain name from the zone file (step 503). The zone file is obtained by signing a reference domain name in a DNS by utilizing a DNSSEC protocol, and the reference domain name is obtained by performing domain name conversion on an upper limit IP address in an IP address range to which the IP address belongs. And sequencing the record sets of all the reference domain names in the zone file according to a preset strategy, wherein the record sets at least comprise NESC records, and the NESC records record the names of the reference domain names of the next record set. In one example, the querying the reference domain name corresponding to the target domain name from the zone file includes: and if the reference domain name matched with the target domain name exists in the zone file, taking the matched reference domain name as the reference domain name corresponding to the target domain name. In one example, the querying the reference domain name corresponding to the target domain name from the zone file includes: inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending NESC records in a record set of the first reference domain name to the inquiry server; the sent NESC record records the name of a second reference domain name, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name. The DNS server sends the reference domain name to the query server (step 504). The query server receives the reference domain name returned by the DNS server, searches for an attribution corresponding to the reference domain name based on a preset correspondence, and determines the found attribution as the attribution of the IP address, where the preset correspondence is a pre-stored correspondence between the reference domain name and the attribution (step 505).
A specific application example is shown below for explanation.
The IP address ranges 1.23.64.0-1.23.74.255 and the IP address ranges 1.23.75.0-1.23.79.255 are explained. Decimal conversion of dots expressed by segment tails (upper limit IP addresses) of all IP address ranges into corresponding numbers is placed under a certain top level domain to serve as a level one domain name, and if the numbers are placed under the com domain, 1.23.74.255 storage becomes 18303743.com, and 1.23.79.255 storage becomes 18305023. com.
The method comprises the steps that a DNSSEC protocol-based mode is used for inputting a reference domain name into a DNS, a signed zone file which is arranged in an alphabetical order is obtained after signature is completed, and the DNS loads the zone file into a memory and provides the zone file for a DNS server to inquire the domain name.
In the DNSSEC-signed zone file, these two records exist sequentially.
18303743.com.10800 IN A 1.23.74.255
172800 NSEC 18305023.com.A RRSIG NSEC
172800 RRSIG NSEC 5 5 172800 20160611031416(20160512031416 5271com.Ujw/aq….15dV5tF7XgWSR78=)
18305023.com.10800 IN A 1.23.79.255
As can be seen, the reference domain name 18305023.com for the next record set is recorded in NSEC of 18303743. com.
When the query server receives a request carrying an IP address, the IP address is converted into a number + com form, a domain name to be searched is obtained, and the domain name is sent to the DNS server. Assuming that the IP address is 1.23.75.8, the record actually checked is 18303752.com, and since this record does not exist in the zone file of the DNS, the return record does not exist, and the NSEC record of 18303743.com (i.e. the last record nearest to 18303752. com) is returned, i.e. the NSEC has a value of 18305023. com.
Since the corresponding relationship between the reference domain name and the home location is recorded in the query server, the home location corresponding to 18305023.com can be found to be the region B.
Therefore, the IP data of the original region information is converted into the format of the domain name and is recorded into the DNS, and DNSSEC signature is carried out on the region file of the DNS. The DNS is an internet basic protocol, is safe and reliable, naturally supports distributed deployment, can accelerate the query speed through the cooperation of a recursive server and an authoritative server, does not need a self-built third-party architecture, is a basic service and is low in cost.
Corresponding to the embodiment of the IP address attribution inquiring method, the disclosure also provides an IP address attribution inquiring device, a system, a storage medium and an embodiment of a server applied by the IP address attribution inquiring device and the system.
As shown in fig. 6, fig. 6 is a block diagram of an IP address home query system shown in the present disclosure according to an exemplary embodiment, and the system includes a query server 61 and a DNS server 62.
The query server 61 converts the IP address of the user terminal into a target domain name, and sends a query request carrying the target domain name to the DNS server 62.
The DNS server 62 queries a reference domain name corresponding to the target domain name based on the query request, and sends the reference domain name to the query server 61, where the reference domain name is used to identify an IP address range to which the IP address belongs.
The query server 61 searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determines the found attribution as the attribution of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
As can be seen from the above embodiments, the IP address of the user terminal is converted into the target domain name by the query server, and the target domain name is sent to the DNS server, the DNS server queries the reference domain name corresponding to the target domain name based on the query request, and because the reference domain name is used to identify the IP address range to which the IP address belongs, after the DNS server sends the reference domain name to the query server, the query server can search the home location corresponding to the reference domain name based on the preset correspondence, and thus determine the found home location as the home location of the IP address, and implement quick query of the home location of the IP address.
In an optional implementation manner, the converting the IP address of the user terminal into the target domain name includes: converting the IP address into a number; and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
In an alternative implementation, the converting the IP address into a number includes:
converting the decimal number of each byte in the IP address into a hexadecimal number;
combining the hexadecimal numbers obtained by converting each byte according to the byte sequence in the IP address to obtain a hexadecimal number;
and converting the hexadecimal number obtained by combination into a decimal number to obtain a number corresponding to the IP address.
In an optional implementation manner, the reference domain name is obtained by performing domain name conversion based on an upper limit IP address in an IP address range to which the IP address belongs.
In an optional implementation manner, the querying a reference domain name corresponding to the target domain name based on the query request includes: and querying a reference domain name corresponding to the target domain name from a zone file, wherein the zone file is obtained by signing the reference domain name in the DNS by utilizing a DNSSEC protocol, and the reference domain name is obtained by performing domain name conversion on the upper limit IP address in an IP address range to which the IP address belongs.
In an optional implementation manner, record sets of reference domain names in the zone file are sorted according to a preset policy, where the record sets at least include NESC records in which names of reference domain names of a next record set are recorded;
the querying a reference domain name corresponding to the target domain name from the slave zone file includes: inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending NESC records in a record set of the first reference domain name to the inquiry server;
the sent NESC record records the name of a second reference domain name, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name.
As shown in fig. 7, fig. 7 is a block diagram of an IP address attribution query device according to an exemplary embodiment, the device including: an information conversion module 710, an information communication module 720, and a home determination module 730.
An information conversion module 710 configured to convert an IP address of the user terminal into a target domain name.
The information communication module 720 is configured to send a query request carrying the target domain name to the DNS server, and receive a reference domain name returned by the DNS server; and the query request indicates a DNS server to query a reference domain name corresponding to the target domain name, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs.
The attribution determining module 730 is configured to search an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determine the searched attribution as the attribution of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
In an optional implementation manner, the information conversion module 710 is specifically configured to: converting the IP address into a number; and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
It can be seen from the above embodiments that the IP address is converted into a number, and the number is combined with the preset top-level domain, so as to convert the IP address of the user terminal into the target domain name, thereby improving the domain name conversion efficiency and the search efficiency in the subsequent domain name search.
In an optional implementation manner, the information conversion module 710 is specifically configured to:
converting the decimal number of each byte in the IP address into a hexadecimal number;
combining the hexadecimal numbers obtained by converting each byte according to the byte sequence in the IP address to obtain a hexadecimal number;
and converting the hexadecimal number obtained by combination into a decimal number to obtain a number corresponding to the IP address. In an optional implementation manner, the reference domain name is obtained by performing domain name conversion based on an upper limit IP address in an IP address range to which the IP address belongs.
As shown in fig. 8, fig. 8 is a block diagram of another IP address attribution query device shown in the present disclosure according to an example embodiment, the device including:
the information communication module 810 is configured to receive a query request sent by a query server, where the query request carries a target domain name corresponding to an IP address;
a domain name query module 820 configured to query a reference domain name corresponding to the target domain name based on the query request, where the reference domain name is used to identify an IP address range to which the IP address belongs;
the information communication module 810 is further configured to send the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determines the found attribution as the attribution of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
In an optional implementation manner, the domain name querying module 820 is specifically configured to:
and querying a reference domain name corresponding to the target domain name from a zone file, wherein the zone file is obtained by signing the reference domain name in the DNS by utilizing a DNSSEC protocol, and the reference domain name is obtained by performing domain name conversion on the upper limit IP address in an IP address range to which the IP address belongs.
As can be seen from the foregoing embodiments, since the reference domain name is obtained by performing domain name conversion based on the upper-limit IP address in the IP address range to which the IP address belongs, an IP address range can be determined according to the reference domain name, and the IP address range is the IP address range to which the IP address of the user terminal belongs. Therefore, the IP address range to which the IP address belongs can be determined by inquiring the reference domain name corresponding to the target domain name, and the inquiry efficiency is improved.
In an optional implementation manner, record sets of reference domain names in the zone file are sorted according to a preset policy, where the record sets at least include NESC records in which names of reference domain names of a next record set are recorded; the domain name querying module 820 is specifically configured to:
inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending NESC records in a record set of the first reference domain name to the inquiry server;
the sent NESC record records the name of a second reference domain name, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name.
As can be seen from the foregoing embodiment, the DNS server queries a target domain name from the zone file, and when the target domain name is between the first reference domain name and the second reference domain name, returns the NESC record in the record set of the first reference domain name to the query server, because the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged before the second reference domain name, the NESC record in the record set of the first reference domain name includes the name of the second reference domain name, so that the query server obtains the reference domain name corresponding to the target domain name, and can further infer that the IP address of the user terminal is within an IP address range in which the IP address corresponding to the second reference domain name is an upper limit IP address, thereby determining a home location of the IP address of the user terminal, and improving home location query efficiency.
Correspondingly, the disclosure also provides an IP address attribution inquiring device, which comprises a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:
converting the IP address of the user terminal into a target domain name;
sending a query request carrying the target domain name to a DNS server, wherein the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used for identifying an IP address range to which the IP address belongs;
receiving a reference domain name returned by a DNS server;
and searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution.
Correspondingly, the disclosure also provides an IP address attribution inquiring device, which comprises a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:
receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to an IP address;
querying a reference domain name corresponding to the target domain name based on the query request, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and sending the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determining the found attribution as the attribution of the IP address, wherein the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
The specific details of the implementation process of the functions and actions of each module in the device are referred to the implementation process of the corresponding step in the method, and are not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
Correspondingly, the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the IP address home location query method applied in the query service end.
Correspondingly, the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the above methods for querying the home location of the IP address in the DNS server.
The present disclosure may take the form of a computer program product embodied on one or more storage media including, but not limited to, disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, and the like, having program code embodied therein. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of the storage medium of the computer include, but are not limited to: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which may be used to store information that may be accessed by a computing device.
As shown in fig. 9, fig. 9 is a block diagram illustrating an apparatus 900 for IP address home querying in accordance with an example embodiment.
For example, the apparatus 900 may be provided as a server device. Referring to FIG. 9, system 900 includes a processing component 922, which further includes one or more processors and memory resources, represented by memory 932, for storing instructions, such as applications, that are executable by processing component 922. The application programs stored in memory 932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 922 is configured to execute instructions to perform the IP address homing query method described above.
The system 900 may also include a power component 926 configured to perform power management of the system 900, a wired or wireless network interface 950 configured to connect the system 900 to a network, and an input output (I/O) interface 958. The system 900 may operate based on an operating system stored in the memory 932.
Wherein the instructions in the memory 932, when executed by the processing component 922, enable the system 900 to perform a method of IP address homing query, comprising:
and converting the IP address of the user terminal into a target domain name.
And sending a query request carrying the target domain name to a DNS server, wherein the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used for identifying an IP address range to which the IP address belongs.
And receiving the reference domain name returned by the DNS server.
And searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution.
As shown in fig. 10, fig. 10 is a block diagram illustrating another apparatus 1000 for IP address home querying in accordance with an example embodiment.
For example, the apparatus 1000 may be provided as a server device. Referring to fig. 10, the system 1000 includes a processing component 1022 that further includes one or more processors and memory resources, represented by memory 1032, for storing instructions, such as applications, that are executable by the processing component 1022. The application programs stored in memory 1032 may include one or more modules that each correspond to a set of instructions. Further, processing component 1022 is configured to execute instructions to perform the IP address homing query method described above.
The system 1000 may also include a power supply component 1026 configured to perform power management for the system 1000, a wired or wireless network interface 1050 configured to connect the system 1000 to a network, and an input-output (I/O) interface 1058. The system 1000 may operate based on an operating system stored in the memory 1032.
Wherein the instructions in the memory 1032, when executed by the processing component 1022, enable the system 1000 to perform a method of IP address homing query, comprising:
and receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to the IP address.
And querying a reference domain name corresponding to the target domain name based on the query request, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs.
And sending the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determining the found attribution as the attribution of the IP address, wherein the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (17)

1. An IP address home location query method is applied to a query server side, and comprises the following steps:
converting the IP address of the user terminal into a target domain name;
sending a query request carrying the target domain name to a Domain Name System (DNS) server, wherein the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used for identifying an IP address range to which the IP address belongs;
receiving a reference domain name returned by the DNS server;
and searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution.
2. The method of claim 1, wherein the converting the IP address of the user terminal to the target domain name comprises:
converting the IP address into a number;
and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
3. The method of claim 2, wherein converting the IP address to a number comprises:
converting the decimal number of each byte in the IP address into a hexadecimal number;
combining the hexadecimal numbers obtained by converting each byte according to the byte sequence in the IP address to obtain a hexadecimal number;
and converting the hexadecimal number obtained by combination into a decimal number to obtain a number corresponding to the IP address.
4. The method according to any one of claims 1 to 3, wherein the reference domain name is obtained by performing domain name conversion based on an upper-limit IP address in an IP address range to which the IP address belongs.
5. An IP address home inquiring method is applied to a DNS server, and the method comprises the following steps:
receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to an IP address;
querying a reference domain name corresponding to the target domain name based on the query request, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and sending the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determines the found attribution as the attribution of the IP address, wherein the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
6. The method of claim 5, wherein querying the reference domain name corresponding to the target domain name based on the query request comprises:
and querying a reference domain name corresponding to the target domain name from a zone file, wherein the zone file is obtained by signing the reference domain name in the DNS by using a domain name system security extension protocol, and the reference domain name is obtained by performing domain name conversion on an upper limit IP address in an IP address range to which the IP address belongs.
7. The method according to claim 6, wherein the record sets of the reference domain names in the zone file are sorted according to a preset policy, and the record sets at least include a next security record, and the next security record records the name of the reference domain name of the next record set;
the querying a reference domain name corresponding to the target domain name from the slave zone file includes:
inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending the next safety record in the record set of the first reference domain name to the inquiry server;
and the name of a second reference domain name is recorded in the next sent safety record, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name.
8. An IP address home querying device, the device comprising:
an information conversion module configured to convert an IP address of a user terminal into a target domain name;
the information communication module is configured to send a query request carrying the target domain name to the DNS server and receive a reference domain name returned by the DNS server; the query request indicates a DNS server to query a reference domain name corresponding to the target domain name, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and the attribution determining module is configured to search an attribution corresponding to the reference domain name based on a preset corresponding relation, and determine the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is a pre-stored corresponding relation between the reference domain name and the attribution.
9. The apparatus of claim 8, wherein the information transformation module is specifically configured to:
converting the IP address into a number;
and combining the number with a preset top level domain to obtain a target domain name corresponding to the IP address.
10. An IP address home querying device, the device comprising:
the information communication module is configured to receive a query request sent by a query server, wherein the query request carries a target domain name corresponding to the IP address;
a domain name query module configured to query a reference domain name corresponding to the target domain name based on the query request, where the reference domain name is used to identify an IP address range to which the IP address belongs;
the information communication module is further configured to send the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determines the found attribution as the attribution of the IP address, where the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
11. The apparatus according to claim 10, wherein the domain name querying module is specifically configured to:
and querying a reference domain name corresponding to the target domain name from a zone file, wherein the zone file is obtained by signing the reference domain name in the DNS by using a domain name system security extension protocol, and the reference domain name is obtained by performing domain name conversion on an upper limit IP address in an IP address range to which the IP address belongs.
12. The apparatus according to claim 11, wherein the record set of each reference domain name in the zone file is sorted according to a preset policy, and the record set at least includes a next security record, and the next security record records a name of the reference domain name of the next record set;
the domain name query module is specifically configured to:
inquiring the target domain name from the zone file, and when the target domain name is between a first reference domain name and a second reference domain name, sending the next safety record in the record set of the first reference domain name to the inquiry server;
and the name of a second reference domain name is recorded in the next sent safety record, the first reference domain name and the second reference domain name are adjacent reference domain names in the zone file, and the first reference domain name is arranged in front of the second reference domain name.
13. An IP address home inquiry system is characterized in that the system comprises an inquiry server and a DNS server,
the query server converts the IP address of the user terminal into a target domain name, and sends a query request carrying the target domain name to the DNS server;
the DNS server queries a reference domain name corresponding to the target domain name based on the query request, and sends the reference domain name to the query server, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and the query server searches for the home location corresponding to the reference domain name based on a preset corresponding relationship, and determines the found home location as the home location of the IP address, wherein the preset corresponding relationship is the pre-stored corresponding relationship between the reference domain name and the home location.
14. An IP address home location inquiring apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
converting the IP address of the user terminal into a target domain name;
sending a query request carrying the target domain name to a DNS server, wherein the query request indicates the DNS server to query a reference domain name corresponding to the target domain name, and the reference domain name is used for identifying an IP address range to which the IP address belongs;
receiving a reference domain name returned by a DNS server;
and searching the attribution corresponding to the reference domain name based on a preset corresponding relation, and determining the searched attribution as the attribution of the IP address, wherein the preset corresponding relation is the prestored corresponding relation between the reference domain name and the attribution.
15. An IP address home location inquiring apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a query request sent by a query server, wherein the query request carries a target domain name corresponding to an IP address;
querying a reference domain name corresponding to the target domain name based on the query request, wherein the reference domain name is used for identifying an IP address range to which the IP address belongs;
and sending the reference domain name to the query server, so that the query server searches for an attribution corresponding to the reference domain name based on a preset corresponding relationship, and determining the found attribution as the attribution of the IP address, wherein the preset corresponding relationship is a pre-stored corresponding relationship between the reference domain name and the attribution.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
17. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 5 to 7.
CN201710851764.5A 2017-09-19 2017-09-19 IP address attribution inquiry method, device, system and storage medium Active CN107613039B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710851764.5A CN107613039B (en) 2017-09-19 2017-09-19 IP address attribution inquiry method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710851764.5A CN107613039B (en) 2017-09-19 2017-09-19 IP address attribution inquiry method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN107613039A CN107613039A (en) 2018-01-19
CN107613039B true CN107613039B (en) 2020-11-20

Family

ID=61061377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710851764.5A Active CN107613039B (en) 2017-09-19 2017-09-19 IP address attribution inquiry method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN107613039B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108494891A (en) * 2018-02-28 2018-09-04 网宿科技股份有限公司 A kind of domain name analytic method, server and system
CN108985759B (en) * 2018-06-15 2020-10-23 杭州复杂美科技有限公司 Address generating method, system, equipment and storage medium for cryptocurrency
CN109684303B (en) * 2018-12-10 2020-10-27 世纪龙信息网络有限责任公司 Communication code attribution inquiry method and device, computer equipment and storage medium
CN109558387B (en) * 2018-12-11 2020-10-30 北京锐安科技有限公司 Method and device for processing identity card number, storage medium and terminal
CN112532414B (en) * 2019-09-18 2023-05-02 中国移动通信集团河北有限公司 Method, device, equipment and computer storage medium for determining ISP attribution

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242426B (en) * 2007-02-06 2010-12-08 华为技术有限公司 Method, system and device for establishing secure connection at transmission layer
CN101902442B (en) * 2009-05-25 2014-03-05 中国科学院计算机网络信息中心 Method, system and position information server for acquiring IP geographic position information
WO2013123392A1 (en) * 2012-02-16 2013-08-22 San Diego State University Research Foundation Method and apparatus for visualizing geospatial fingerprints on web information landscapes

Also Published As

Publication number Publication date
CN107613039A (en) 2018-01-19

Similar Documents

Publication Publication Date Title
CN107613039B (en) IP address attribution inquiry method, device, system and storage medium
US9231903B2 (en) System and method for resolving a DNS request using metadata
CN105959433B (en) A kind of domain name analytic method and its domain name analysis system
US9525749B2 (en) DNS server arrangement and method
US6249813B1 (en) Automated method of and apparatus for internet address management
US11816161B2 (en) Asset search and discovery system using graph data structures
CN108848205B (en) CNAME domain name resolution method for distinguishing IPv4 and IPv6
KR20020082461A (en) Network address server
CN107786678B (en) Domain name resolution method, device and system
US20190007371A1 (en) MAPPING IPv4 KNOWLEDGE TO IPv6
CN112347377B (en) IP address field searching method, service scheduling method, device and electronic equipment
CN102546854A (en) Domain name analysis method for building hyper text transport protocol (HTTP) connection for domain name and server
JP2012530971A (en) Characterization of unregistered domain names
US20070002778A1 (en) Method for query of domain names of telephone numbers
CN111416880A (en) IP address addressing method and device, computer storage medium and electronic equipment
Blanchet Finding the Authoritative Registration Data (RDAP) Service
KR100452944B1 (en) Telephone Number Mapping system and method for employing as the same
US20150106494A1 (en) Characterization of domain names based on changes of authoritative name servers
CN104079682A (en) Address translation method and device based on domain name system (DNS)
CN107807976B (en) IP home location query method and device
CN114301874A (en) IPv6 address positioning method based on IPv4 address geographical position information and electronic equipment
CN109933710A (en) A kind of data query method, apparatus and storage medium, program product
EP3340582A1 (en) Determining a top level domain from a domain name
CN115037720A (en) Method and device for processing domain name resolution request, electronic equipment and storage medium
CN112995353B (en) IPv6 address survivability scanning system and method based on flow analysis

Legal Events

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