Determining a top level domain from a domain name
A system includes a processing system of a device including one or more processors. The system also includes a memory system including one or more computer-readable media. The one or more computer-readable media contain instructions that, when executed by the processing system, cause the processing system to perform operations. The operations include reading, at a domain name system (DNS) server, top-level domain (TLD) information from a TLD list. The operations also include sizing data structures for a hash table. The operations also include loading the TLD information into the hash table. The operations also include determining whether a collision constraint is met in the hash table. The operations also include increasing a size of the data structures when the collision constraint is not met.
1 . A system comprising:
a processing system of a device comprising one or more processors; and
a memory system comprising one or more computer-readable media, wherein the one or more computer-readable media contain instructions that, when executed by the processing system, cause the processing system to perform operations comprising:
reading, at a domain name system (DNS) server, top-level domain (TLD) information from a TLD list;
sizing data structures for a hash table;
loading the TLD information into the hash table, wherein the hash table comprises one or more buckets having one or more entries, wherein entries of the one or more entries each include TLD information;
determining whether a collision constraint is met in the hash table; and
increasing a size of the data structures when the collision constraint is not met.
2 . The system of claim 1 , wherein the TLD information comprises a list of TLDs for which the DNS server is authoritative.
3 . The system of claim 1 , wherein sizing the data structures for the hash table comprises sizing the data structures for the hash table at a minimum size.
4 . The system of claim 3 , wherein the minimum size comprises 4 entries.
5 . The system of claim 1 , wherein increasing the size of the data structures comprises increasing the size of the data structures to have a smallest size that meets the collision constraint.
6 . The system of claim 5 , wherein the collision constraint is zero.
7 . The system of claim 1 , further comprising:
re-loading the TLD information into the hash table after the size of the data structures for the hash table has been increased; and
determining whether the collision constraint is met in the hash table after the TLD information has been re-loaded into the hash table.
8 . A system comprising:
a processing system of a device comprising one or more processors; and
a memory system comprising one or more computer-readable media, wherein the one or more computer-readable media contain instructions that, when executed by the processing system, cause the processing system to perform operations comprising:
reading, at a domain name system (DNS) server, top-level domain (TLD) information from a TLD list;
sizing data structures for a hash table;
loading the TLD information into the hash table, wherein the hash table comprises one or more buckets having one or more entries, wherein entries of the one or more entries each include TLD information;
determining whether a collision constraint is met in the hash table;
increasing a size of the data structures when the collision constraint is not met;
receiving a query from a client for a DNS name after the size of the data structures has been increased;
looking up a TLD of the DNS name;
looking up DNS data for the DNS name when the TLD is found;
processing the DNS data to produce processed DNS data; and
sending a response to the client including the processed DNS data.
9 . The system of claim 8 , wherein the TLD information comprises a list of TLDs for which the DNS server is authoritative.
10 . The system of claim 8 , wherein sizing the data structures for the hash table comprises sizing the data structures for the hash table at a minimum size.
11 . The system of claim 10 , wherein the minimum size comprises 4 entries.
12 . The system of claim 8 , wherein increasing the size of the data structures comprises increasing the size of the data structures to have a smallest size that meets the collision constraint.
13 . The system of claim 12 , wherein the collision constraint is zero.
14 . The system of claim 8 , further comprising:
re-loading the TLD information into the hash table after the size of the data structures for the hash table have been increased in size; and
determining whether the collision constraint is met m the hash table after the TLD information has been re-loaded into the hash table.
15 . The system of claim 8 , wherein the DNS data comprises name server records.
16 . The system of claim 8 , wherein the processed DNS data comprises a list of name servers for the DNS name.
17 . The system of claim 1 , wherein the hash table comprises the plurality of data structures.