CN110995881A - Domain name storage method and device - Google Patents

Domain name storage method and device Download PDF

Info

Publication number
CN110995881A
CN110995881A CN201911206712.8A CN201911206712A CN110995881A CN 110995881 A CN110995881 A CN 110995881A CN 201911206712 A CN201911206712 A CN 201911206712A CN 110995881 A CN110995881 A CN 110995881A
Authority
CN
China
Prior art keywords
domain name
address information
storage
dns
cache server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911206712.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.)
Nanjing Yaxin Zhiwang Technology Co Ltd
Original Assignee
Nanjing Yaxin Zhiwang Technology 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 Nanjing Yaxin Zhiwang Technology Co Ltd filed Critical Nanjing Yaxin Zhiwang Technology Co Ltd
Priority to CN201911206712.8A priority Critical patent/CN110995881A/en
Publication of CN110995881A publication Critical patent/CN110995881A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/58Caching of addresses or names
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Landscapes

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

Abstract

The embodiment of the application provides a domain name storage method and device, relates to the technical field of computers, and solves the problem that the utilization rate of a storage space in a DNS cache server is low. The method comprises the following steps: when receiving the domain name and the address information sent by the DNS recursive server, the DNS cache server judges whether the stored domain name comprises the domain name. If the domain name is already stored in the DNS cache server, only the address information corresponding to the domain name is stored. The effective utilization rate of the storage space in the DNS cache server is improved.

Description

Domain name storage method and device
Technical Field
The invention relates to the technical field of computers, in particular to a domain name storage method and device.
Background
When accessing a website, a terminal typically sends a domain name query request to a Domain Name System (DNS) cache server. After receiving the domain name query request, the DNS cache server queries whether to store an Internet Protocol (IP) address corresponding to the domain name in the domain name query request, and if the DNS cache server stores the IP address corresponding to the domain name in the domain name query request, sends the IP address to the terminal. And if the DNS cache server does not store the IP address corresponding to the domain name in the domain name query request, sending a domain name resolution request to the DNS recursive server so that the DNS recursive server can resolve the domain name to obtain the IP address corresponding to the domain name.
For a web site, multiple servers may be deployed globally depending on geographic location or network type, with each server having a different IP address. For a plurality of terminals from different geographical locations/network types, when the DNS recursive server resolves a domain name in a domain name query request sent by each of the plurality of terminals, a plurality of IP addresses corresponding to the domain name and having different contents are obtained. In this case, the DNS cache server needs to store a plurality of "correspondence between domain names and IPs". At this time, the DNS cache server stores a plurality of identical domain names, occupies a large amount of storage space, and reduces the effective usage rate of the storage space of the DNS cache server.
Disclosure of Invention
The embodiment of the application provides a domain name storage method and device, and solves the technical problem that the memory utilization rate of a DNS cache server is low.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a domain name storage method is provided, in which a DNS cache server determines whether a domain name already stored includes the domain name when receiving the domain name and address information sent by a DNS recursive server. If the domain name is already stored in the DNS cache server, only the address information corresponding to the domain name is stored.
It can be seen that, after receiving the domain name and address information sent by the DNS recursive server, the DNS cache server does not need to store the domain name already stored in the DNS cache server again, which improves the effective utilization of the storage space in the DNS cache server.
In a second aspect, there is provided a domain name storage apparatus including: a receiving unit, configured to receive a domain name and address information sent by a DNS recursive server, where the address information corresponds to the domain name; and the storage unit is used for storing the address information if the stored domain name comprises the domain name.
In a third aspect, a domain name storage device is provided that includes a memory and a processor. The memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus. When the domain name storage device is operated, the processor executes the computer-executable instructions stored in the memory, so that the domain name storage device executes the domain name storage method according to the first aspect.
The domain name storage device may be a network device, or may be a part of a device in the network device, such as a system on chip in the network device. The chip system is configured to support the network device to implement the functions involved in the first aspect and any one of the possible implementations thereof, for example, to receive, determine, and offload data and/or information involved in the domain name storage method. The chip system includes a chip and may also include other discrete devices or circuit structures.
In a fourth aspect, a computer-readable storage medium is provided, which includes computer-executable instructions, which when executed on a computer, cause the computer to perform the domain name storage method according to the first aspect.
In a fifth aspect, there is provided a computer program product, which when run on a computer, causes the computer to perform the domain name storage method according to the first aspect and any one of its possible designs.
It should be noted that all or part of the computer instructions may be stored on the first computer storage medium. The first computer storage medium may be packaged together with the processor of the domain name storage device, or may be packaged separately from the processor of the domain name storage device, which is not limited in this embodiment of the present application.
For the description of the second, third, fourth and fifth aspects of the present invention, reference may be made to the detailed description of the first aspect; in addition, for the beneficial effects of the second aspect, the third aspect, the fourth aspect and the fifth aspect, reference may be made to the beneficial effect analysis of the first aspect, and details are not repeated here.
In the embodiment of the present application, the names of the domain name storage devices described above do not limit the devices or the functional modules themselves, and in an actual implementation, the devices or the functional modules may appear by other names. Insofar as the functions of the respective devices or functional blocks are similar to those of the present invention, they are within the scope of the claims of the present invention and their equivalents.
These and other aspects of the invention will be more readily apparent from the following description.
Drawings
Fig. 1 is a schematic structural diagram of a domain name storage system according to an embodiment of the present application;
fig. 2 is a schematic hardware structure diagram of a communication device according to an embodiment of the present disclosure;
fig. 3 is a schematic hardware structure diagram of another communication apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of a domain name storage method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a domain name storage device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another domain name storage device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms "first" and "second" are used to distinguish the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the terms "first" and "second" are not used to limit the quantity and execution order.
Currently, when receiving a domain name and an IP address corresponding to the domain name sent by a DNS recursive server, a DNS cache server may receive a plurality of "correspondence between domain name and IP address". In practical applications, the plurality of domain names in the plurality of "correspondence between domain names and IP addresses" may be the same domain name. Therefore, when the DNS cache server stores a plurality of "correspondence between domain names and IP addresses", a plurality of identical domain names may be stored, which occupies a large amount of storage space, and reduces the effective usage rate of the storage space of the DNS cache server.
In practical applications, one or more aliases may exist for a domain name (e.g., domain name a includes an alias: domain name B). When receiving the "correspondence between domain name and IP address" sent by the DNS recursive server, the DNS cache server may receive the "correspondence between domain name a and IP address" sent by the DNS recursive server, and may also receive the "correspondence between domain name B and IP address" sent by the DNS recursive server. Because the domain name B is an alias of the domain name a, when the DNS cache server stores the "correspondence between the domain name a and the IP address" and the "correspondence between the domain name B and the IP address", it is equivalent to that the DNS cache server stores two domain names a, which also occupies a large amount of storage space, and reduces the effective usage rate of the storage space of the DNS cache server.
Furthermore, the DNS cache server may receive the "correspondence between domain name and IP address" sent by different DNS recursive servers (e.g., DNS recursive server a and DNS recursive server B). When the DNS cache server receives the "correspondence between domain name a and IP address" sent by the DNS recursive server a, the "correspondence between domain name a and IP address" is stored. When the DNS cache server receives the "correspondence between domain name a and IP address" sent by the DNS recursive server B, the "correspondence between domain name a and IP address" is stored again. In this case. The DNS cache server equivalently stores two domain names A, occupies a large amount of storage space, and reduces the effective utilization rate of the storage space of the DNS cache server.
In view of the above problem, an embodiment of the present application provides a domain name storage method, where after receiving a domain name and address information sent by a DNS recursive server, a DNS cache server determines whether the stored domain name includes the domain name. If the domain name is already stored in the DNS cache server, only the address information corresponding to the domain name is stored. Compared with the prior art, the method provided by the embodiment of the application does not need to store the domain name which is already stored in the DNS cache server again, and the effective utilization rate of the storage space in the DNS cache server is improved.
The domain name storage method provided by the embodiment of the application is suitable for the domain name storage system 10. Fig. 1 shows one configuration of the domain name storage system 10. As shown in fig. 1, the domain name storage system 10 includes: a terminal 11, a DNS cache server 12 and a DNS recursion server 13. The DNS cache server 12 communicates between the terminal 11 and the DNS recursive server 13, respectively, via a network.
The DNS cache server 12 is configured to receive a domain name query request sent by the terminal 11, and send a plurality of address information corresponding to the domain name to the terminal 11 according to the domain name in the domain name query request.
The DNS cache server 12 is further configured to receive the domain name and the address information corresponding to the domain name sent by the DNS recursive server 13, and store the domain name and the address information corresponding to the domain name.
The DNS recursive server 13 is configured to analyze the domain name resolution request message sent by the DNS cache server 12 to obtain address information corresponding to the domain name.
Optionally, if the DNS recursive server 13 cannot resolve the domain name resolution request message sent by the DNS cache server 12, sending a recursive query to the DNS authority server, and sending the queried address information to the DNS cache server 12.
Terminal 11 in fig. 1 and terminal 21 in fig. 2 may refer to devices that provide voice and/or data connectivity to a user, handheld devices having wireless connection capability, or other processing devices connected to a wireless modem.
A wireless terminal may communicate with one or more core networks via a Radio Access Network (RAN). The wireless terminals may be mobile terminals such as mobile phones (or "cellular" phones) and computers with mobile terminals, as well as portable, pocket, hand-held, computer-included, or vehicle-mounted mobile devices that exchange language and/or data with a wireless access network, such as cell phones, tablets, laptops, netbooks, Personal Digital Assistants (PDAs).
The DNS cache server 12 and the DNS recursive server 13 in fig. 1 may be one server in a server cluster (consisting of a plurality of servers).
The basic hardware structures of the terminal 11, the DNS cache server 12, and the DNS recursive server 13 in fig. 1 are similar and include elements included in the communication apparatus shown in fig. 2. The hardware configuration of the terminal 11, the DNS cache server 12, and the DNS recursive server 13 in fig. 1 will be described below by taking the communication apparatus shown in fig. 2 as an example.
Fig. 2 shows a hardware structure diagram of a communication device provided in an embodiment of the present application. As shown in fig. 2, the communication device includes a processor 31, a memory 32, a communication interface 33, and a bus 34. The processor 31, the memory 32 and the communication interface 33 may be connected by a bus 34.
The processor 31 is a control center of the communication apparatus, and may be a single processor or a collective term for a plurality of processing elements. For example, the processor 31 may be a Central Processing Unit (CPU), other general-purpose processors, or the like. Wherein a general purpose processor may be a microprocessor or any conventional processor or the like.
For one embodiment, processor 31 may include one or more CPUs, such as CPU 0 and CPU 1 shown in FIG. 2.
The memory 32 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
In a possible implementation, the memory 32 may exist separately from the processor 31, and the memory 32 may be connected to the processor 31 through a bus 34 for storing instructions or program codes. The processor 31 can implement the domain name storage method provided by the embodiment of the present invention when calling and executing the instructions or program codes stored in the memory 32.
In another possible implementation, the memory 32 may also be integrated with the processor 31.
A communication interface 33 for connecting with other devices through a communication network. The communication network may be an ethernet network, a radio access network, a Wireless Local Area Network (WLAN), or the like. The communication interface 33 may include a receiving unit for receiving data, and a transmitting unit for transmitting data.
The bus 34 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 2, but it is not intended that there be only one bus or one type of bus.
It is to be noted that the configuration shown in fig. 2 does not constitute a limitation of the communication apparatus. The communication device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components than shown in fig. 2.
Fig. 3 shows another hardware configuration of the communication apparatus in the embodiment of the present application. As shown in fig. 3, the communication device may include a processor 41 and a communication interface 42. Processor 41 is coupled to communication interface 42.
The function of the processor 41 may refer to the description of the processor 31 above. The processor 41 also has a memory function, and the function of the memory 32 can be referred to.
The communication interface 42 is used to provide data to the processor 41. The communication interface 42 may be an internal interface of the communication device, or may be an external interface (corresponding to the communication interface 33) of the communication device.
It is noted that the configuration shown in fig. 2 (or fig. 3) does not constitute a limitation of the communication apparatus, which may include more or less components than those shown in fig. 2 (or fig. 3), or combine some components, or a different arrangement of components, in addition to the components shown in fig. 2 (or fig. 3).
The following describes a domain name storage method provided in an embodiment of the present application in detail with reference to the accompanying drawings.
Fig. 4 is a schematic flowchart of a domain name storage method according to an embodiment of the present application. The domain name storage method can be applied to the domain name storage system 10 shown in fig. 1. The domain name storage method includes S501-S512.
S501, the terminal 11 sends a domain name query request message to the DNS cache server 12.
The DNS cache server 12 is a service of the internet, and serves as a distributed database in which domain names and Internet Protocol (IP) addresses are mapped to each other, so that users can access the internet more conveniently.
The terminal 11 only needs to memorize the domain name of the web site when accessing the web site through the browser, and does not need to memorize address information that is not easily understood. Therefore, when accessing the internet, the terminal 11 first sends a domain name query request message to the DNS cache server 12, where the domain name query request message includes a domain name of the internet that the terminal 11 wants to access, and is used to request to acquire address information corresponding to the domain name. The address information may be an IP address.
S502, the DNS cache server 12 determines whether the domain name in the domain name query request message and the plurality of address information corresponding to the domain name are stored.
DNS cache servers 12 may store domain names and address information.
Alternatively, the DNS cache server 12 may store the domain name and the address information in a Hash table (Hash table). By storing data in this way, the search speed can be increased.
Specifically, the hash table is a structure for accessing data by a hash value. The hash table includes a plurality of hash values, each hash value uniquely corresponding to a hash bucket. One hash bucket represents a portion of the storage space in the DNS cache server 12.
Optionally, the DNS cache server 12 divides the memory in the cache into a plurality of address spaces (i.e., hash buckets in the hash table) according to the total amount of the memory, and connects the address spaces in order to prevent memory fragmentation. Such as assigning 500 ten thousand short domain name address spaces, 20 thousand long domain name address spaces. The DNS cache server 12 may be assigned to the corresponding address space according to the content length of the domain name. The storage space may store only the domain name transmitted by the DNS recursive server 13, or may store the domain name and the address information transmitted by the DNS recursive server 13. In the case that the storage space only stores the domain name sent by the DNS recursive server 13, the address information sent by the DNS recursive server 13 may be stored in other storage spaces, and a preset relationship between the domain name and the address space is set, and the domain name and the address information corresponding thereto are associated together.
If the DNS cache server 12 queries the cache for the domain name sent by the terminal 11, S503 is executed. If the DNS cache server 12 does not inquire about the domain name sent by the terminal 11 in the cache, S504 is executed.
S503, the DNS cache server 12 sends a plurality of address messages corresponding to the domain name to the terminal 11.
The plurality of address messages may be sent in a form of a message, or may be sent in a form of a data packet, which is not limited herein. The terminal 11 may traverse a plurality of address information and select the address information with the highest response speed to access the website.
Optionally, the DNS cache server 12 determines, according to the domain name sent by the terminal 11, a hash value corresponding to the domain name first through a hash function, and then determines a corresponding hash bucket through the hash value. If the hash bucket stores a plurality of address information corresponding to the domain name, the hash bucket sends a plurality of address information corresponding to the domain name to the terminal 11. If the hash bucket stores the preset relationship between the domain name and the plurality of address information corresponding to the domain name, the plurality of address information corresponding to the domain name are obtained from the storage according to the preset relationship, and the plurality of address information corresponding to the domain name are sent to the terminal 11.
Optionally, the DNS cache server 12 further stores a reference count of the domain name, where the reference count is used to indicate the number of times the domain name is requested to be accessed. After the DNS cache server 12 transmits a plurality of address information corresponding to the domain name to the terminal 11, the DNS cache server 12 increments the reference count of the domain name by one.
Optionally, the DNS cache server 12 may regularly clean the domain name with a long storage time and the plurality of address information corresponding to the domain name in the cache, so as to prevent the invalid domain name with a long storage time from occupying the memory space. When the storage duration of the domain name in the DNS cache server 12 is equal to the preset duration, it is determined whether the reference count of the domain name is smaller than a preset threshold. And if the reference count of the domain name is smaller than a preset threshold value, deleting the domain name and the plurality of address information. And if the reference count of the domain name is greater than or equal to the preset threshold, re-timing the storage duration of the domain name.
S504, the DNS cache server 12 sends a domain name resolution request message to the DNS recursive server 13.
S505, the DNS recursive server 13 parses the domain name to obtain the address information corresponding to the domain name.
After receiving the domain name resolution request message (including the domain name) sent by the DNS cache server 12, the DNS recursive server 13 resolves the domain name to obtain the address information corresponding to the domain name. Here, the number of address information corresponding to the domain name is one or more.
For example, a website corresponding to domain name a may deploy multiple servers around the world, and the address information of each server is different. Suppose that a website corresponding to the domain name a deploys a server in beijing, and the address information of the server is IP 1. The website corresponding to the domain name a is deployed with another server in the Shanghai, and the address information of the server is IP 2. When the beijing terminal accesses the website, the DNS recursive server 13 may analyze the domain name sent by the beijing terminal to obtain the IP 1, so that the beijing terminal can quickly access the beijing server corresponding to the website, and the access efficiency is improved. Similarly, when the shanghai terminal accesses the website, the DNS recursive server 13 resolves the domain name sent by the shanghai terminal to obtain IP 2. Since the DNS recursive server 13 resolves two pieces of address information (IP 1 and IP 2) for the domain name a, one domain name can correspond to a plurality of pieces of address information.
Optionally, when the DNS recursive server 13 cannot resolve the domain name resolution request message sent by the DNS cache server 12, sending a recursive query to the DNS authority server, and sending the queried address information to the DNS cache server 12.
S506, the DNS recursive server 13 sends the domain name and the address information corresponding to the domain name to the DNS cache server 12.
S507, the DNS cache server 12 determines whether the stored domain name includes the domain name sent by the DNS recursive server 13.
After receiving the domain name and the address information sent by the DNS recursive server 13, the DNS cache server 12 calculates a hash value of the domain name, and determines whether the calculated hash value exists in the hash table according to the calculated hash value. If the hash value exists in the hash table of the DNS cache server 12, which indicates that the domain name already stored in the DNS cache server 12 includes the domain name sent by the DNS recursive server 13, S508 is executed. If the hash value does not exist in the hash table of the DNS cache server 12, it is determined that the domain name sent by the DNS recursive server 13 is not included in the domain names already stored by the DNS cache server 12, and S509 is performed.
S508, the DNS cache server 12 stores the address information sent by the DNS recursive server 13.
If the domain name sent by the DNS recursive server 13 is already stored in the DNS cache server 12, the domain name is not stored, and only the address information corresponding to the domain name is stored.
Optionally, the DNS cache server 12 may further re-time the storage duration of the domain name and the storage duration of the address information sent by the DNS recursive server 13.
Specifically, since there is a time period (TTL) for the domain name and the address information stored in the DNS cache server 12, the DNS cache server 12 processes the domain name and the address information according to the TTL (e.g., deletes the domain name and the address information). Therefore, when the domain name is already stored in the DNS cache server 12, the DNS cache server 12 will count the storage duration of the domain name and the address information again, so as to prevent the DNS cache server 12 from performing error processing on the domain name and the address information.
Illustratively, the first storage time of the domain name and address information is 19: 00, the storage time is 1 hour. Thus, the DNS cache server 12 processes the domain name and address information at 20: 00. However, if the DNS cache server 12 receives the domain name and the address information sent by the DNS recursive server 13 for the second time at 19:30, the DNS cache server 12 counts the storage time of the domain name and the address information again, that is, processes the domain name and the address information at 20:30 minutes.
S509, the DNS cache server 12 stores the domain name and the address information sent by the DNS recursive server 13.
If the domain name is not stored in the DNS cache server 12, the DNS cache server 12 stores the domain name and the address information corresponding to the domain name.
Optionally, when the DNS cache server 12 stores the domain name and the corresponding address information, the domain name may be stored in a new hash bucket (storage space).
For S507, S508, and S509, illustratively, the hash table includes domain name a and domain name B. Domain name a is stored in hash bucket a, the hash function of domain name a is f (a), and the hash value of domain name a is f (a) ═ 1. Domain name B is stored in hash bucket B, the hash function of domain name B is f (B), and the hash value of domain name B is f (B) ═ 2. At the first preset time, the DNS cache server 12 receives the domain name C and the address information corresponding to the domain name C sent by the DNS recursive server 13. The DNS cache server determines the hash value of the domain name C through the hash function f (C) of the domain name C. If the hash value f (C) of the domain name C is 1, determining that the domain name C is the same as the domain name a, then storing the address information corresponding to the domain name C, and retiming the storage time of the domain name C and the storage time of the address information corresponding to the domain name C. If the hash value f (C) of the domain name C is 3, it is determined that the domain name C is different from the domain names a and B, and the domain name C is stored in a new hash bucket (i.e., address space).
S510, the DNS cache server 12 sends address information corresponding to the domain name to the terminal 11.
Optionally, in the embodiment of the present application, S507 may be performed first, and then S510 may be performed. S510 may be executed first, and then S507 may be executed. S507 and S510 may also be performed simultaneously. And are not limited herein.
As can be seen from the above, in the domain name storage method provided in the embodiment of the present application, when receiving the domain name and the address information sent by the DNS recursive server 13, the DNS cache server 12 determines whether the stored domain name includes the domain name. If the domain name is already stored in the DNS cache server 12, only address information corresponding to the domain name is stored; if the domain name is not stored in the DNS cache server 12, the domain name and address information corresponding to the domain name are stored. Compared with the prior art, the method provided by the embodiment of the application does not need to store the domain name in the DNS cache server 12 and the stored domain name again, and the effective utilization rate of the storage space in the DNS cache server 12 is improved.
The scheme provided by the embodiment of the application is mainly introduced from the perspective of a method. To implement the above functions, it includes hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiment of the present application, the domain name storage device may be divided into the functional modules according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. Optionally, the division of the modules in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 5 is a schematic structural diagram of a domain name storage device 70 according to an embodiment of the present disclosure. The domain name storage device 70 is used to improve the effective utilization of the storage space in the DNS cache server, for example, to execute the domain name storage method shown in fig. 4. The domain name storage device 70 includes: a receiving unit 701 and a storage unit 702.
A receiving unit 701, configured to receive a domain name and address information sent by a DNS recursive server, where the address information corresponds to the domain name. For example, in conjunction with fig. 4, the receiving unit 701 may be configured to perform S506.
A storage unit 702, configured to store the address information if the stored domain name includes the domain name. For example, in conjunction with fig. 4, the storage unit 702 may be used to perform S508.
Optionally, as shown in fig. 6, the domain name storage device 70 further includes: a processing unit 703.
The processing unit 703 is configured to count again the storage duration of the domain name and the storage duration of the address information.
Optionally, if the stored domain name does not include the domain name, the storage unit 702 is further configured to store the domain name and the address information. For example, in conjunction with fig. 4, the storage unit 702 may also be used to perform S509.
Optionally, the receiving unit 701 is further configured to receive a first request sent by the terminal, where the first request includes a domain name, and the first request is used to request to acquire address information corresponding to the domain name. For example, in conjunction with fig. 4, the receiving unit 701 may also be configured to perform S501.
Optionally, as shown in fig. 6, the domain name storage device 70 further includes: a determining unit 704 and a transmitting unit 705.
A determination unit 704 for determining that a plurality of address information corresponding to the domain name have been stored. For example, in conjunction with fig. 4, the determination unit 704 may be configured to perform S502.
A sending unit 705, configured to send the plurality of address information determined by the determining unit 704 to the terminal. For example, in conjunction with fig. 4, the sending unit 705 may be configured to execute S503.
Optionally, the DNS cache server further stores a reference count of the domain name; the reference count is used to indicate the number of times the domain name is requested for access. After the receiving unit 701 receives the first request sent by the terminal, the processing unit 703 is further configured to increment the reference count of the domain name by one.
Optionally, as shown in fig. 6, the domain name storage device 70 further includes: and a judging unit 706.
The determining unit 706 is configured to determine whether the reference count of the domain name is smaller than a preset threshold when the storage duration of the domain name is equal to a preset duration.
The processing unit 703 is further configured to delete the domain name and the pieces of address information if the determining unit 706 determines that the reference count of the domain name is smaller than the preset threshold.
The processing unit 703 is further configured to re-time the storage duration of the domain name if the determining unit 706 determines that the reference count of the domain name is greater than or equal to the preset threshold.
Embodiments of the present application also provide a computer-readable storage medium, which includes computer-executable instructions. When the computer executes the instructions to run on the computer, the computer is caused to execute the steps executed by the domain name storage device in the domain name storage method provided by the above embodiment.
The embodiments of the present application further provide a computer program product, where the computer program product may be directly loaded into a memory and contains software codes, and after the computer program product is loaded and executed by a computer, the computer program product can implement each step executed by a domain name storage device in the domain name storage method provided in the foregoing embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The processes or functions according to the embodiments of the present application are generated in whole or in part when the computer-executable instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). Computer-readable storage media can be any available media that can be accessed by a computer or can comprise one or more data storage devices, such as servers, data centers, and the like, that can be integrated with the media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and there may be other division ways in actual implementation. For example, various elements or components may be combined or may be integrated into another device, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (14)

1. A domain name storage method is applied to a Domain Name System (DNS) cache server, and comprises the following steps:
receiving a domain name and address information sent by a DNS recursive server, wherein the address information corresponds to the domain name;
and if the stored domain name comprises the domain name, storing the address information.
2. The domain name storage method according to claim 1, further comprising:
and re-timing the storage time of the domain name and the storage time of the address information.
3. The domain name storage method according to claim 1 or 2, characterized in that the domain name storage method further comprises:
and if the domain name is not included in the stored domain names, storing the domain name and the address information.
4. The domain name storage method according to claim 3, further comprising:
receiving a first request sent by a terminal, wherein the first request comprises the domain name, and the first request is used for requesting to acquire address information corresponding to the domain name;
determining that a plurality of address information corresponding to the domain name has been stored;
and sending the plurality of address information to the terminal.
5. The domain name storage method according to claim 4, wherein the DNS cache server further stores a reference count of the domain name; the reference count is used to indicate a number of times the domain name is requested for access;
after receiving the first request sent by the terminal, the domain name storage method further includes:
incrementing a reference count for the domain name by one.
6. The domain name storage method according to claim 5, further comprising:
when the storage duration of the domain name is equal to a preset duration, judging whether the reference count of the domain name is smaller than a preset threshold value;
if the reference count of the domain name is smaller than the preset threshold value, deleting the domain name and the plurality of address information;
and if the reference count of the domain name is greater than or equal to the preset threshold, re-timing the storage duration of the domain name.
7. A domain name storage device applied to a DNS cache server comprises:
a receiving unit, configured to receive a domain name and address information sent by a DNS recursive server, where the address information corresponds to the domain name;
and the storage unit is used for storing the address information if the stored domain name comprises the domain name.
8. The domain name storage device according to claim 7, further comprising:
and the processing unit is used for retiming the storage time of the domain name and the storage time of the address information.
9. The domain name storage device according to claim 8,
if the domain name is not included in the stored domain names, the storage unit is further configured to store the domain name and the address information.
10. The domain name storage device according to claim 9,
the receiving unit is further configured to receive a first request sent by a terminal, where the first request includes the domain name, and the first request is used to request to acquire address information corresponding to the domain name;
the domain name storage device further comprises:
a determination unit configured to determine that a plurality of pieces of address information corresponding to the domain name have been stored;
a sending unit, configured to send the plurality of address information determined by the determining unit to the terminal.
11. The domain name storage device according to claim 10, wherein the DNS cache server further stores a reference count for the domain name; the reference count is used to indicate a number of times the domain name is requested for access;
after the receiving unit receives the first request sent by the terminal, the processing unit is further configured to increment a reference count of the domain name by one.
12. The domain name storage device according to claim 11, further comprising:
the judging unit is used for judging whether the reference count of the domain name is smaller than a preset threshold value or not when the storage duration of the domain name is equal to a preset duration;
the processing unit is further configured to delete the domain name and the plurality of address information if the determining unit determines that the reference count of the domain name is smaller than the preset threshold;
the processing unit is further configured to retime the storage duration of the domain name if the determining unit determines that the reference count of the domain name is greater than or equal to the preset threshold.
13. A domain name storage device comprising a memory and a processor; the memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus;
when the domain name storage device is running, the processor executes the computer-executable instructions stored by the memory to cause the domain name storage device to perform the domain name storage method according to any one of claims 1-6.
14. A computer-readable storage medium, comprising computer-executable instructions that, when executed on a computer, cause the computer to perform the domain name storage method of any one of claims 1-6.
CN201911206712.8A 2019-11-29 2019-11-29 Domain name storage method and device Pending CN110995881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911206712.8A CN110995881A (en) 2019-11-29 2019-11-29 Domain name storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911206712.8A CN110995881A (en) 2019-11-29 2019-11-29 Domain name storage method and device

Publications (1)

Publication Number Publication Date
CN110995881A true CN110995881A (en) 2020-04-10

Family

ID=70088780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911206712.8A Pending CN110995881A (en) 2019-11-29 2019-11-29 Domain name storage method and device

Country Status (1)

Country Link
CN (1) CN110995881A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111565195A (en) * 2020-05-21 2020-08-21 杭州安恒信息技术股份有限公司 Challenge black hole attack defense method of distributed system and distributed system
CN114640504A (en) * 2022-02-24 2022-06-17 京东科技信息技术有限公司 CC attack protection method, device, equipment and storage medium
WO2024109369A1 (en) * 2022-11-23 2024-05-30 腾讯科技(深圳)有限公司 Domain name query method and apparatus, and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935683A (en) * 2015-06-29 2015-09-23 北京经天科技有限公司 Buffer processing method and device for domain name resolution
CN105791460A (en) * 2016-03-03 2016-07-20 中国科学院信息工程研究所 DNS agent cache optimization method and system based on multi-dimension aggregation
CN107070988A (en) * 2017-03-06 2017-08-18 北京安博通科技股份有限公司 Message processing method and device
US20190158459A1 (en) * 2017-11-21 2019-05-23 Vmware, Inc. Virtual distributed domain name server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935683A (en) * 2015-06-29 2015-09-23 北京经天科技有限公司 Buffer processing method and device for domain name resolution
CN105791460A (en) * 2016-03-03 2016-07-20 中国科学院信息工程研究所 DNS agent cache optimization method and system based on multi-dimension aggregation
CN107070988A (en) * 2017-03-06 2017-08-18 北京安博通科技股份有限公司 Message processing method and device
US20190158459A1 (en) * 2017-11-21 2019-05-23 Vmware, Inc. Virtual distributed domain name server

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111565195A (en) * 2020-05-21 2020-08-21 杭州安恒信息技术股份有限公司 Challenge black hole attack defense method of distributed system and distributed system
CN114640504A (en) * 2022-02-24 2022-06-17 京东科技信息技术有限公司 CC attack protection method, device, equipment and storage medium
CN114640504B (en) * 2022-02-24 2024-02-06 京东科技信息技术有限公司 CC attack protection method, device, equipment and storage medium
WO2024109369A1 (en) * 2022-11-23 2024-05-30 腾讯科技(深圳)有限公司 Domain name query method and apparatus, and device and storage medium

Similar Documents

Publication Publication Date Title
CN109561141B (en) CDN node selection method and equipment
WO2017114206A1 (en) Method and device for processing short link, and short link server
CN109756423B (en) Method and device for updating policy
CN111885216B (en) DNS query method, device, equipment and storage medium
CN110995881A (en) Domain name storage method and device
US20130254779A1 (en) Communication interface selection on multi-homed devices
TW201029422A (en) Methods, apparatuses, and computer program products for determining a network interface to access a network resource
CN114095430B (en) Access message processing method, system and working node
US20120240184A1 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
CN110769080B (en) Domain name resolution method, related product and computer readable storage medium
CN101741902B (en) System and method for Internet terminal to quickly access to Internet server
CN112566072A (en) NF-based communication method, device and storage medium
CN112954089A (en) Method, device and equipment for analyzing data and storage medium
CN109561165A (en) Domain name system configuration method and relevant apparatus
WO2024152980A1 (en) Data message response method and apparatus, electronic device and storage medium
CN111741512A (en) Private network access method and device
CN108810092B (en) Network access method and device, electronic equipment and computer readable storage medium
CN111294285B (en) Network data distribution method and load balancer
JP6484166B2 (en) Name resolution device, name resolution method, and name resolution program
US10327133B2 (en) Making subscriber data addressable as a device in a mobile data network
CN113115400B (en) Communication method and device
CN113965367B (en) Policy object upper limit control method, system, computer and storage medium
CN109460293B (en) Computing resource selection method under distributed computing environment in wireless cloud computing system
CN111092817A (en) Data transmission method and device
JP2021513250A (en) Session management methods and systems, as well as 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200410

RJ01 Rejection of invention patent application after publication