CN115858590A - Domain name query request processing method, computer device, apparatus, medium, and product - Google Patents

Domain name query request processing method, computer device, apparatus, medium, and product Download PDF

Info

Publication number
CN115858590A
CN115858590A CN202211605478.8A CN202211605478A CN115858590A CN 115858590 A CN115858590 A CN 115858590A CN 202211605478 A CN202211605478 A CN 202211605478A CN 115858590 A CN115858590 A CN 115858590A
Authority
CN
China
Prior art keywords
target
domain name
record
reference table
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211605478.8A
Other languages
Chinese (zh)
Inventor
周祥为
秦文劭
张培承
王一丹
张
万化
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank 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 Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202211605478.8A priority Critical patent/CN115858590A/en
Publication of CN115858590A publication Critical patent/CN115858590A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a domain name query request processing method, a computer device, equipment, a medium and a product, wherein after receiving a domain name query request, a target reference table matched with a target domain name is queried from a domain name data cache library, a target position number corresponding to a target protocol address type in the target reference table and an address stored at a target position indicated by the target position number in the target reference table are obtained, query is carried out according to the obtained address to obtain a target record linked list, if a cache record of the target protocol address type exists in the target record linked list, the cache record is fed back, the cache record of the target protocol address type requested by the domain name query request can be accurately queried, and cache pollution is avoided.

Description

Domain name query request processing method, computer device, apparatus, medium, and product
Technical Field
The present application relates to the field of domain name server query technologies, and in particular, to a method, a computer device, an apparatus, a medium, and a product for processing a domain name query request.
Background
A Domain Name System (DNS) server may be divided by a cache server and an authority server: the authoritative server represents an authoritative owner of DNS record data in one region and maintains the DNS authoritative record result; the cache server can inquire and obtain DNS record data from the authoritative server in a recursive mode, cache for a certain time, and within the cache validity period, the client inquiry request can directly obtain the response of the DNS request from the cache record in the cache server.
In the conventional method, when performing DNS query, a common way is that a cache server queries a cache first, and if the cache is hit, the cache is directly returned to a requester, and if the cache is not hit, recursive query is continued to a next level. Generally speaking, the returned records have many types, and when a certain type of record is included in the cache record, the type of the record received by the request is directly returned, and the query is not performed outwards recursively, and if the type of the record requested by the request is different from the type of the record, an error occurs in local resolution.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a domain name query request processing method, a computer device, an apparatus, a medium, and a product, which can accurately obtain a cache record corresponding to a domain name query request type.
In a first aspect, the present application provides a method for processing a domain name query request, including:
receiving a domain name query request; the domain name query request carries a target domain name and a target protocol address type;
inquiring a target reference table matched with a target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions;
acquiring a target position number corresponding to the target protocol address type in a target reference table;
acquiring an address stored at a target position indicated by the target position number in the target reference table, and inquiring according to the acquired address to obtain a target record linked list;
and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record.
In one embodiment, the step of querying the domain name data cache library for a target reference table matching the target domain name comprises:
acquiring a pre-constructed domain name data cache library, and determining domain names corresponding to all reference tables in the domain name data cache library respectively;
judging whether a domain name matched with the target domain name exists in the domain names;
and if the domain name matched with the target domain name exists in the domain names, acquiring a reference table corresponding to the matched domain name as a target reference table.
In one embodiment, if there is no domain name matching the target domain name in the domain names, the method includes:
initiating recursive query of the target domain name outwards to obtain a recursive result of the target domain name;
and extracting a cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
In one embodiment, the step of creating a new target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name includes:
initializing a reference table;
adding a cache record corresponding to the target domain name into a record linked list under the corresponding domain name;
determining a target position number corresponding to the target protocol address in the initialized reference table;
and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
In one embodiment, the step of obtaining the target location number corresponding to the target protocol address type in the target reference table includes:
acquiring the corresponding relation between each position number in the target reference table and the protocol address type;
and screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
In one embodiment, if no cache record of the target protocol address type exists in the target record linked list, the method includes:
initiating recursive query of the cache record of the target protocol address type outwards to obtain a recursive result of the cache record;
and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in a target record linked list.
In a second aspect, the present application further provides a device for processing a domain name query request, where the device includes:
the request receiving module is used for receiving a domain name inquiry request; the domain name query request carries a target domain name and a target protocol address type;
the reference table acquisition module is used for inquiring a target reference table matched with a target domain name from the domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions;
the number acquisition module is used for acquiring a target position number corresponding to the target protocol address type in the target reference table;
the linked list acquisition module is used for acquiring the address stored at the target position indicated by the target position number in the target reference table and inquiring according to the acquired address to obtain a target record linked list;
and the record feedback module is used for feeding back the cache record if the cache record of the target protocol address type exists in the target record linked list.
In a third aspect, the present application further provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the method steps of any one of the first aspect when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method steps of any of the first aspects.
In a fifth aspect, the present application also provides a computer program product comprising a computer program that, when executed by a processor, performs the method steps of any one of the first aspect.
According to the domain name query request processing method, the computer device, the equipment, the medium and the product, after a domain name query request is received, a target reference table matched with a target domain name is queried from a domain name data cache library, a target position number corresponding to a target protocol address type in the target reference table and an address stored at a target position indicated by the target position number in the target reference table are obtained, query is performed according to the obtained address to obtain a target record linked list, if a cache record of the target protocol address type exists in the target record linked list, the cache record is fed back, the cache record of the target protocol address type requested by the domain name query request can be accurately queried, and cache pollution is avoided.
Drawings
FIG. 1 is a diagram of an application environment of a method for processing a domain name query request in one embodiment;
FIG. 2 is a flowchart illustrating a method for processing a domain name query request according to an embodiment;
FIG. 3 is a flowchart illustrating the steps of creating a target reference table in one embodiment;
FIG. 4 is a flowchart illustrating a method for preventing a DNS mutual exclusion record cache conflict in an embodiment;
FIG. 5 is a diagram of a cache reference pointing relationship in one embodiment;
FIG. 6 is a block diagram showing the structure of a domain name query request processing apparatus according to one embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The domain name query request processing method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the cache server 104 over a network. The data storage system may store data that the cache server 104 needs to process. The data storage system may be integrated on the cache server 104, or may be located on the cloud or other network server. The cache server 104 receives a domain name query request sent by the terminal 102, queries a target reference table matched with a target domain name from a domain name data cache library, and obtains a target position number corresponding to a target protocol address type in the target reference table. The cache server 104 is further configured to obtain an address stored at a target position indicated by the target position number in the target reference table, and perform query according to the obtained address to obtain a target record linked list; and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the like. The cache server 104 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a method for processing a domain name query request is provided, which is described by taking the method as an example applied to the cache server 104 in fig. 1, and includes the following steps:
s202: receiving a domain name query request; the domain name query request carries a target domain name and a target protocol address type.
The Domain Name is the Name of a certain computer or a computer group on the Internet composed of a string of names separated by points, and is used for positioning and identifying the computer during data transmission, the protocol address refers to an IP address, and the DNS (Domain Name System) is a distributed database in which Domain names and IP addresses are mapped to each other, one Domain Name can correspond to a plurality of different IP addresses, and the IP addresses can be flexibly adjusted, so that the communication of the client can be decoupled from a specific target host, which is equivalent to providing an address bound to a specific network application, and therefore, the target IP address can be directly obtained through DNS query. The protocol address type refers to a record type of the DNS, such as a, AAAA, CNAME, MX, and the like, and in the DNS query process, the cache server first queries the cache locally, if hit, returns directly to the requester, and if miss, continues recursive query to the next stage.
The DNS server may be divided according to a cache server and an authoritative server: the authoritative server represents an authoritative owner of DNS record data in one region and maintains the DNS authoritative record result; the cache server can inquire and obtain DNS record data from the authoritative server in a recursive mode, cache for a certain time, and within the cache validity period, the client inquiry request can directly obtain the response of the DNS request from the cache record in the cache server.
S204: inquiring a target reference table matched with a target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions.
The domain name data cache library comprises all cache records of all domain names, and before actual cache record query, a reference data structure, namely a reference table, is set for each domain name and used for indexing types which need to be protected from being influenced. Each position in the reference table represents one type of DNS record data, which is equivalent to different types of protocol addresses, and the integer number corresponding to the type is used as the index value of the hash table, for example, the value of the a record type is 1, and corresponds to the 2 nd index position from 0 in the reference table. And after receiving the domain name query request, acquiring a reference table corresponding to a target domain name in the domain name query request, namely a target reference table.
S206: and acquiring a target position number corresponding to the target protocol address type in the target reference table.
In practical application, the reference table number usually refers to the number of the reference table, therefore, for a specific reference table, different index positions correspond to different protocol address types, and therefore, the position number refers to the number of the reference table. Assuming that the a record type value is 1, the acquired target position number is 1.
S208: and acquiring the address stored at the target position indicated by the target position number in the target reference table, and inquiring according to the acquired address to obtain a target record linked list.
Each position in the target reference table stores an address, and the address points to the cache record of the corresponding protocol address type. In the query process, when the cache server determines the target position number corresponding to the target protocol address type, the address stored at the target position indicated by the target position number can be directly acquired, the pointing of the actual cache result is completed, and the record linked list in the address is queried to obtain the target record linked list.
S210: and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record.
After the target record linked list is inquired, whether a cache record of the target protocol address type exists in the current target record linked list or not is judged, if yes, the cache record is fed back to the terminal by the cache server, the DNS inquiry is completed, if not, the cache record is not hit, the outward recursion inquiry is initiated by the cache server, the DNS record data is inquired from the authority server and obtained, and the cache record obtained by the recursion inquiry is stored locally by the cache server and then fed back to the terminal.
In the domain name query request processing method, after a domain name query request is received, a target reference table matched with a target domain name is queried from a domain name data cache library, a target position number corresponding to a target protocol address type in the target reference table and an address stored at a target position indicated by the target position number in the target reference table are obtained, query is performed according to the obtained address to obtain a target record linked list, if a cache record of the target protocol address type exists in the target record linked list, the cache record is fed back, the cache record of the target protocol address type requested by the domain name query request can be accurately queried, and cache pollution is avoided.
In one embodiment, the step of querying a domain name data cache for a target reference table matching a target domain name comprises: acquiring a pre-constructed domain name data cache library, and determining domain names corresponding to all reference tables in the domain name data cache library respectively; judging whether a domain name matched with the target domain name exists in the domain names; and if the domain name matched with the target domain name exists in the domain names, acquiring a reference table corresponding to the matched domain name as a target reference table.
Before actual query, a domain name data cache library is established in advance according to cache records of protocol address types queried historically, and therefore in the actual query, cache records corresponding to target protocol address types are queried directly in a reference table in a local domain name data cache library according to cache data in the domain name data cache library. After the cache server acquires a pre-constructed domain name data cache library, firstly determining the domain names corresponding to all reference tables in the domain name data cache library, then searching whether cache data matched with a target domain name exists in the current domain name data cache library, and if so, acquiring the reference table corresponding to the target domain name in the domain name data cache library to obtain a target reference table.
In this embodiment, a domain name data cache library which is constructed in advance is obtained, domain names which correspond to the reference tables in the domain name data cache library respectively are determined, whether a domain name which is matched with a target domain name exists in the domain name is judged, and if the domain name which is matched with the target domain name exists in the domain name, the reference table which is corresponding to the matched domain name is obtained to be used as the target reference table, so that the target reference table which is corresponding to the target domain name can be directly queried locally, and response efficiency is improved.
In one embodiment, if there is no domain name in the domain names that matches the target domain name, the method includes: initiating recursive query of the target domain name outwards to obtain a recursive result of the target domain name; and extracting a cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
If the domain name matched with the target domain name does not exist in the domain name, the cache server indicates that no cache record corresponding to the target domain name exists locally at present, at this time, the cache server initiates recursive query of the target domain name outwards, and after a recursive result of the target domain name is obtained, the cache server will unpack a response packet, extract record data under the domain name, and store the record data into a target reference table corresponding to the target domain name.
In this embodiment, when a domain name matched with the target domain name does not exist in the domain name, the recursive query of the target domain name is initiated outwards to obtain a recursive result of the target domain name, the cache record corresponding to the target domain name in the recursive result of the target domain name is extracted, and the target reference table corresponding to the target domain name is created according to the cache record corresponding to the target domain name, so that a basis is provided for the subsequent accurate query of the cache record of the target protocol address type.
In an embodiment, as shown in fig. 3, the step of creating, according to the cache record corresponding to the target domain name, a target reference table corresponding to the target domain name includes:
s302: a reference table is initialized.
The reference table is a hash table, each position in the reference table points to a cache address of one protocol address type, and the cache server respectively corresponds the number of each position in the reference table to each protocol address type.
S304: and adding the cache record corresponding to the target domain name into the record linked list under the corresponding domain name.
After the cache record corresponding to the target domain name is inquired, the cache server adds the cache record to a record linked list under the corresponding domain name, and all the cache records of the target domain name are stored in the record linked list.
S306: and determining a target position number corresponding to the target protocol address in the initialized reference table.
And the cache server acquires the corresponding number in the initialized reference table according to the target protocol address in the domain name query request to obtain the target position number.
S308: and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
After the target position number is obtained, the cache server adds the address of the record linked list storing the cache record of the target protocol address type to the position indicated by the target position number, and associates the cache record with the target position number to obtain a target reference table.
In the embodiment, a reference table is initialized, the cache record corresponding to the target domain name is added to the record linked list under the corresponding domain name, the target position number corresponding to the target protocol address in the initialized reference table is determined, and the address of the record linked list in which the cache record is stored is added to the target position indicated by the target position number in the target reference table, so that the target reference table is obtained, the record linked list of the target protocol address type can be directly inquired through the target reference table, and the response efficiency is improved.
In one embodiment, the step of obtaining a target location number corresponding to a target protocol address type in a target reference table includes: acquiring the corresponding relation between each position number in the target reference table and the protocol address type; and screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
The cache server acquires position numbers which are the same as the target protocol address type in the protocol address types corresponding to the target reference table and serve as the target position numbers.
In the embodiment, the corresponding relation between each position number in the target reference table and the protocol address type is obtained, and the target position number corresponding to the target protocol address type is screened out from the plurality of position numbers according to the corresponding relation, so that the record linked list of the target protocol address type can be directly inquired through the target reference table, and the response efficiency is improved.
In one embodiment, if no cache record of the target protocol address type exists in the target record linked list, the method includes: initiating recursive query of the cache record of the target protocol address type outwards to obtain a recursive result of the cache record; and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in a target record linked list.
When the target record linked list does not have the cache record of the target protocol address type, the cache server initiates recursive query of the cache record of the target protocol address type outwards, the response packet obtained by recursion is released, the cache record matched with the target protocol address type is extracted, then the cache server stores the queried cache record to the target record linked list, and local cache is updated.
In this embodiment, if the target record linked list does not have the cache record of the target protocol address type, the recursive query of the cache record of the target protocol address type is initiated outwards to obtain the recursive result of the cache record, and the cache record matched with the target protocol address type in the recursive result of the cache record is extracted and stored in the target record linked list, so that the cache record of the target protocol address type requested by the domain name query request can be accurately queried, and the cache pollution is avoided.
In one embodiment, as shown in fig. 4, a method for preventing DNS mutex record cache conflict is provided, which includes the following steps:
(1) The DNS query request arrives at the cache server.
(2) The cache server first checks whether the cache contains the domain name being looked up, and if not, indicates that there is no request for the domain name, or that the previous associated cache has expired, and is considered as a miss cache. If the cache is not hit, an outward recursive query is triggered.
Com, when the result is obtained by recursion, the cache server will unpack the response packet and extract the record data (which may be a record, CNAME record or nxdmoin, etc.) under this domain name.
(3) At this time, assuming that a record data is obtained, the cache server will first establish a domain name data structure in the cache, then initialize a reference table (all initial values in the table are null values), and then add the just obtained a record to the record linked list under the corresponding domain name. As shown in fig. 5, each element in the reference table is designed to point to reference form data of the actual record memory address, and there may be many-to-one for the reference table entry and the actual cache record.
(4) And setting the table entry value of the position with the number of 1 (the corresponding numerical value of the type A is set to be 1) in the reference table as the memory address of the just added record A, finishing pointing to the actual cache result, using the record A to respond to the requesting client, and finishing the 1 st query request.
When another client requests the AAAA record of a.com 2 time, the cache server finds that a.com exists in the cache, and first checks the entry numbered 28 (the AAAA record corresponds to a value of 28) in the reference table, because the cache server has not received the AAAA type query before, the entry still points to a null value and misses the cache.
The cache server initiates a.com AAAA request type recursive query outwards and obtains CNAME type result data. The same as the case where the record type request a is answered, the actual cache record linked list under the corresponding domain name is added with the CNAME type record cache result, and then the entry in the reference table of the AAAA points to the CNAME record area address. Assuming that the 3 rd client requests the a record of a.com, the cache server finds that the a.com domain exists and that the reference table corresponding to the a type has a corresponding entry and has an actual pointing direction, and will respond by using the a record cache track pointed by the table entry (this is a hit cache).
And so on, at this time, the next query request except for the a and AAAA types under a.com cannot hit the cache, and a recursion is initiated, and the cache can be hit after the step of adding the cache is completed.
In the embodiment, for a cache management mechanism under a domain name, a preposed record reference table is established according to request types for accurately distinguishing the request types, and a direction relation to an independent physical area is established according to different request types, so that accurate cache isolation of different types of records is realized.
It should be understood that, although the steps in the flowcharts related to the embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the application also provides a domain name query request processing device for realizing the above related domain name query request processing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so that specific limitations in one or more embodiments of the domain name query request processing device provided below can refer to the limitations on the domain name query request processing method in the above description, and details are not described here.
In one embodiment, as shown in fig. 6, there is provided a domain name query request processing apparatus including: the system comprises a request receiving module 10, a reference table acquiring module 20, a number acquiring module 30, a linked list acquiring module 40 and a record feedback module 50, wherein:
a request receiving module 10, configured to receive a domain name query request; the domain name query request carries a target domain name and a target protocol address type.
A reference table acquiring module 20, configured to query a target reference table matched with a target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions.
The number obtaining module 30 is configured to obtain a target location number corresponding to the target protocol address type in the target reference table.
And the linked list obtaining module 40 is configured to obtain an address stored at the target position indicated by the target position number in the target reference table, and perform query according to the obtained address to obtain the target record linked list.
And a record feedback module 50, configured to feed back the cache record if the cache record of the target protocol address type exists in the target record linked list.
In one embodiment, the reference table acquisition module 20 includes: the device comprises a cache library acquisition unit, a domain name judgment unit and a reference table acquisition unit, wherein:
and the cache library acquisition unit is used for acquiring a pre-constructed domain name data cache library and determining the domain names corresponding to the reference tables in the domain name data cache library.
And the domain name judging unit is used for judging whether a domain name matched with the target domain name exists in the domain names.
And the reference table acquisition unit is used for acquiring a reference table corresponding to the matched domain name as the target reference table if the domain name matched with the target domain name exists in the domain names.
In one embodiment, the reference table obtaining module 20 is further configured to initiate a recursive query of the target domain name outward if no domain name matching the target domain name exists in the domain names, so as to obtain a recursive result of the target domain name; and extracting the cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
In one embodiment, the reference table acquiring module 20 is further configured to initialize a reference table; adding a cache record corresponding to the target domain name into a record linked list under the corresponding domain name; determining a target position number corresponding to a target protocol address in the initialized reference table; and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
In one embodiment, the number obtaining module 30 includes: a correspondence acquisition unit and a number acquisition unit, wherein:
and the corresponding acquiring unit is used for acquiring the corresponding relation between each position number in the target reference table and the protocol address type.
And the number acquiring unit is used for screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
In one embodiment, the record feedback module 50 is further configured to, if no cache record of the target protocol address type exists in the target record linked list, initiate recursive query of the cache record of the target protocol address type outward to obtain a recursive result of the cache record; and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in a target record linked list.
The modules in the domain name query request processing device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O for short), and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the cache record data. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a domain name query request processing method.
It will be appreciated by those skilled in the art that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: receiving a domain name query request; the domain name query request carries a target domain name and a target protocol address type; inquiring a target reference table matched with a target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions; acquiring a target position number corresponding to the target protocol address type in a target reference table; acquiring an address stored at a target position indicated by the target position number in the target reference table, and inquiring according to the acquired address to obtain a target record linked list; and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record.
In one embodiment, a processor, involved in executing a computer program, queries a target reference table from a domain name data cache that matches a target domain name, comprising: acquiring a pre-constructed domain name data cache library, and determining domain names corresponding to all reference tables in the domain name data cache library respectively; judging whether a domain name matched with the target domain name exists in the domain names; and if the domain name matched with the target domain name exists in the domain names, acquiring a reference table corresponding to the matched domain name as a target reference table.
In one embodiment, the processor executes the computer program to further perform the following steps if there is no domain name in the domain name that matches the target domain name: initiating recursive query of the target domain name outwards to obtain a recursive result of the target domain name; and extracting a cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
In one embodiment, the creating of the target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name involved in the execution of the computer program by the processor comprises: initializing a reference table; adding a cache record corresponding to the target domain name into a record linked list under the corresponding domain name; determining a target position number corresponding to the target protocol address in the initialized reference table; and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
In one embodiment, the obtaining of the target location number corresponding to the target protocol address type in the target reference table involved in the execution of the computer program by the processor comprises: acquiring the corresponding relation between each position number in the target reference table and the protocol address type; and screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
In one embodiment, when the processor executes the computer program, if the target record linked list does not have the cache record of the target protocol address type, the following steps are further implemented: initiating recursive query of the cache record of the target protocol address type outwards to obtain a recursive result of the cache record; and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in a target record linked list.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a domain name query request; the domain name query request carries a target domain name and a target protocol address type; inquiring a target reference table matched with a target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions; acquiring a target position number corresponding to the target protocol address type in a target reference table; acquiring an address stored at a target position indicated by the target position number in the target reference table, and inquiring according to the acquired address to obtain a target record linked list; and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record.
In one embodiment, the computer program when executed by a processor involves querying a target reference table from a domain name data cache that matches a target domain name, comprising: acquiring a pre-constructed domain name data cache library, and determining domain names corresponding to all reference tables in the domain name data cache library respectively; judging whether a domain name matched with the target domain name exists in the domain names; and if the domain name matched with the target domain name exists in the domain names, acquiring a reference table corresponding to the matched domain name as a target reference table.
In one embodiment, the computer program when executed by the processor further performs the following steps if no domain name matching the target domain name exists in the domain names: initiating recursive query of the target domain name outwards to obtain a recursive result of the target domain name; and extracting a cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
In one embodiment, the computer program when executed by the processor is directed to creating a target reference table corresponding to a target domain name based on a cache record corresponding to the target domain name, comprising: initializing a reference table; adding a cache record corresponding to the target domain name into a record linked list under the corresponding domain name; determining a target position number corresponding to a target protocol address in the initialized reference table; and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
In one embodiment, the computer program, when executed by the processor, is directed to obtaining a target location number in a target reference table corresponding to a target protocol address type, comprising: acquiring the corresponding relation between each position number in the target reference table and the protocol address type; and screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
In one embodiment, the computer program when executed by the processor further performs the following steps if no cache record of the target protocol address type exists in the target record linked list: initiating recursive query of the cache record of the target protocol address type outwards to obtain a recursive result of the cache record; and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in a target record linked list.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of: receiving a domain name query request; the domain name query request carries a target domain name and a target protocol address type; inquiring a target reference table matched with a target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions; acquiring a target position number corresponding to the target protocol address type in a target reference table; acquiring an address stored at a target position indicated by the target position number in the target reference table, and inquiring according to the acquired address to obtain a target record linked list; and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record.
In one embodiment, the computer program when executed by a processor involves querying a target reference table from a domain name data cache that matches a target domain name, comprising: acquiring a pre-constructed domain name data cache library, and determining domain names corresponding to all reference tables in the domain name data cache library respectively; judging whether a domain name matched with the target domain name exists in the domain names; and if the domain name matched with the target domain name exists in the domain names, acquiring a reference table corresponding to the matched domain name as a target reference table.
In one embodiment, the computer program when executed by the processor further performs the following steps if no domain name matching the target domain name exists in the domain names: initiating recursive query of the target domain name outwards to obtain a recursive result of the target domain name; and extracting a cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
In one embodiment, the computer program when executed by the processor is directed to creating a target reference table corresponding to a target domain name based on a cache record corresponding to the target domain name, comprising: initializing a reference table; adding a cache record corresponding to the target domain name into a record linked list under the corresponding domain name; determining a target position number corresponding to a target protocol address in the initialized reference table; and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
In one embodiment, the computer program, when executed by the processor, is directed to obtaining a target location number in a target reference table corresponding to a target protocol address type, comprising: acquiring the corresponding relation between each position number in the target reference table and the protocol address type; and screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
In one embodiment, the computer program when executed by the processor further performs the following steps if no cache record of the target protocol address type exists in the target record linked list: initiating recursive query of the cache record of the target protocol address type outwards to obtain a recursive result of the cache record; and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in a target record linked list.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include a Read-Only Memory (ROM), a magnetic tape, a floppy disk, a flash Memory, an optical Memory, a high-density embedded nonvolatile Memory, a resistive Random Access Memory (ReRAM), a Magnetic Random Access Memory (MRAM), a Ferroelectric Random Access Memory (FRAM), a Phase Change Memory (PCM), a graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims (10)

1. A domain name query request processing method is characterized by comprising the following steps:
receiving a domain name query request; the domain name query request carries a target domain name and a target protocol address type;
inquiring a target reference table matched with the target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions;
acquiring a target position number corresponding to the target protocol address type in the target reference table;
acquiring an address stored at a target position indicated by the target position number in the target reference table, and inquiring according to the acquired address to obtain a target record linked list;
and if the target record linked list has the cache record of the target protocol address type, feeding back the cache record.
2. The method of claim 1, wherein querying a domain name data cache for a target reference table matching the target domain name comprises:
acquiring a pre-constructed domain name data cache library, and determining domain names corresponding to all reference tables in the domain name data cache library respectively;
judging whether a domain name matched with the target domain name exists in the domain names;
and if the domain name matched with the target domain name exists in the domain names, acquiring a reference table corresponding to the matched domain name as a target reference table.
3. The method of claim 2, wherein if there is no domain name in the domain names that matches the target domain name, the method comprises:
initiating recursive query of the target domain name outwards to obtain a recursive result of the target domain name;
and extracting a cache record corresponding to the target domain name in the recursion result of the target domain name, and creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name.
4. The method according to claim 3, wherein creating a target reference table corresponding to the target domain name according to the cache record corresponding to the target domain name comprises:
initializing a reference table;
adding the cache record corresponding to the target domain name into a record linked list under the corresponding domain name;
determining a target position number corresponding to the target protocol address in the initialized reference table;
and adding the address of the record linked list in which the cache record is stored to the target position indicated by the target position number in the target reference table to obtain the target reference table.
5. The method of claim 1, wherein obtaining the target location number corresponding to the target protocol address type in the target reference table comprises:
acquiring the corresponding relation between each position number in the target reference table and the protocol address type;
and screening out a target position number corresponding to the target protocol address type from the plurality of position numbers according to the corresponding relation.
6. The method of claim 1, wherein if the target record linked list does not have a cached record of the target protocol address type, the method comprises:
initiating recursive query of the cache record of the target protocol address type outwards to obtain a recursive result of the cache record;
and extracting the cache record matched with the target protocol address type in the recursion result of the cache record, and storing the cache record in the target record linked list.
7. A domain name query request processing apparatus, characterized in that the apparatus comprises:
the request receiving module is used for receiving a domain name inquiry request; the domain name query request carries a target domain name and a target protocol address type;
the reference table acquisition module is used for inquiring a target reference table matched with the target domain name from a domain name data cache library; the domain name database comprises reference tables respectively corresponding to different domain names, and each reference table comprises a plurality of positions;
a number obtaining module, configured to obtain a target location number corresponding to the target protocol address type in the target reference table;
a linked list obtaining module, configured to obtain an address stored in the target reference table at a target position indicated by the target position number, and perform query according to the obtained address to obtain a target record linked list;
and the record feedback module is used for feeding back the cache record if the cache record of the target protocol address type exists in the target record linked list.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. 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 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202211605478.8A 2022-12-14 2022-12-14 Domain name query request processing method, computer device, apparatus, medium, and product Pending CN115858590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211605478.8A CN115858590A (en) 2022-12-14 2022-12-14 Domain name query request processing method, computer device, apparatus, medium, and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211605478.8A CN115858590A (en) 2022-12-14 2022-12-14 Domain name query request processing method, computer device, apparatus, medium, and product

Publications (1)

Publication Number Publication Date
CN115858590A true CN115858590A (en) 2023-03-28

Family

ID=85672821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211605478.8A Pending CN115858590A (en) 2022-12-14 2022-12-14 Domain name query request processing method, computer device, apparatus, medium, and product

Country Status (1)

Country Link
CN (1) CN115858590A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116405463A (en) * 2023-06-07 2023-07-07 阿里巴巴(中国)有限公司 Domain name query method, system, electronic device and non-transitory machine-readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116405463A (en) * 2023-06-07 2023-07-07 阿里巴巴(中国)有限公司 Domain name query method, system, electronic device and non-transitory machine-readable medium
CN116405463B (en) * 2023-06-07 2023-08-11 阿里巴巴(中国)有限公司 Domain name query method, system, electronic device and non-transitory machine-readable medium

Similar Documents

Publication Publication Date Title
EP3668063A1 (en) Domain name resolution method, server and system
CN106933854B (en) Short link processing method and device and server
US10826869B2 (en) Domain name resolution method, server and storage medium
US20080209552A1 (en) Identifying potentially offending content using associations
JP4799018B2 (en) Method, system and apparatus for managing computer identification information
CN103891247B (en) Method and system for domain name system based discovery of devices and objects
CN101197754A (en) Distributed system, distributed service processing method and correlated device
CN108228799B (en) Object index information storage method and device
CN105611000B (en) A kind of DNS domain name method for quickly retrieving of name server
CN115858590A (en) Domain name query request processing method, computer device, apparatus, medium, and product
CN114205330A (en) Domain name resolution method, domain name resolution device, server, and storage medium
CN108154024B (en) Data retrieval method and device and electronic equipment
CN111475704A (en) Intelligent domain name resolution method and device and computer readable storage medium
CN112817983A (en) Handle identifier analysis caching method, query method and handle identifier analysis system
US10205679B2 (en) Resource object resolution management
US8005844B2 (en) On-line organization of data sets
EP2426894B1 (en) System and method of processing DNS request and DNS reply
CN111352938A (en) Data processing method, computer device and storage medium
JP6233846B2 (en) Variable-length nonce generation
EP3340582A1 (en) Determining a top level domain from a domain name
CN112989255B (en) Identification analysis system
US7058773B1 (en) System and method for managing data in a distributed system
CN111309673A (en) Snapshot data generation method and device of incremental data
JP2017123040A (en) Server device, distribution file system, distribution file system control method, and program
CN111447291A (en) DNS (Domain name System) -based scheduling method and system and electronic equipment

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