--------------------------------------------------------------------------------
Text:
Overview of DNS system resolution process
DNS (Domain Name Service) is the most basic and very important service in the Internet/Intranet, providing automatic conversion of domain names to IP addresses in network access. We know that there are thousands of hosts on the Inetrnet and are still increasing at any time. It is impossible for one or several DNS servers to implement such a resolution process. The traditional host table (hosts) method is even more incompetent. In fact, DNS relies on a distributed database system to parse host domain names in the network and promptly disseminate the information of the new host to other relevant parts of the network, thus bringing great convenience to network maintenance and expansion.
The service provided by DNS is to map familiar names into IP addresses. There are generally two mechanisms to complete, one is to complete with a host table, and the other is to implement the daemon process (named, or ) of the domain name service. Both methods can realize the mutual mapping between domain names and IPs.
Who is the current IP address and domain name assigned? The highest-level domain name of the Internet is registered and managed by the Internet Network Association's committee responsible for network address allocation, and it also assigns a unique IP address to each host of the Internet. There are three large network information centers in the world:
INTER NIC is responsible for the United States and beyond
RIPE-NIC is responsible for Europe
APNIC is responsible for Asia Pacific
DNS Hierarchy
DNS is a very complex concept. Before understanding DNS structure, let us first master some common terms about DNS.
Table 1 lists commonly used DNS terms.
Term Description
Domain A logical entity or organization representing a part of the network
Domain Name Part of the host name, which represents the domain containing this host. It can be used interchangeably with the domain
Host A computer on the network
Node A computer on the network
Domain Name Server A computer that provides DNS services that converts DNS names into IP addresses
Analysis The process of converting a DNS server into an IP address that matches it
Resolution program or library subroutine that extracts DNS information from the domain name server
Reverse parsing Convert the given IP address into its matching DNS name
Spoofing the behavior of making the network look like it has a different IP address or domain name
Table 1 Common DNS terms
Okay, after mastering some of the above terms, let me introduce the hierarchy of DNS so that everyone can have a deeper understanding of the entire architecture of DNS and the analysis process of the DNS system. DNS is actually a distributed database system, it is a hierarchical system. DNS does not have a host table that stores all host information. On the contrary, this information is stored in many distributed domain name servers. These domain name servers form a hierarchical system. The top level is a root domain, which is represented by the symbol dot ". ". In fact, the concept of domain is similar to the concept of our geographical administrative region management. A national administrative agency includes the central government, (equivalent to the root domain) and the provincial government (first-level domain name), under the provincial government, many municipal governments (second-level domain name), under the municipal government, many county governments (third-level domain name), and so on. Each lower subdomain is a subdomain of the superior domain. Each domain has its own group of domain name servers, which hold the host information of the current domain and the domain name server information of the lower subdomain. For example, the root domain server does not need to know the information of all hosts in the root domain, it only needs to know the address of the domain name server of all subdomains.
Figure 2 shows the hierarchy of the domain name:
Figure 2 DNS hierarchy
Figure 2 includes two types of geographic domain and institutional domain, where the geographical domain is illustrated by China as an example and the institutional domain is illustrated by com as an example. As shown in the figure above, a host on the Internet is marked. com is the first-level domain and china-pub is the second-level domain. www, mail, and dns are all host names, which are used to indicate the service type of the host. This example vividly illustrates the hierarchy and hierarchical management mechanism of the domain name system.
There are generally two types of first-level domains (i.e. top-level domains), one is a geographical domain and the other is an institutional domain. The geographical domain is divided into domain names through geographical areas. For example, China's geographical domain names are CN, Japan is JP, * is HK, and the United States generally does not use geographic domain names; institutional domains are classified according to the registered institutional type.
The top-level domain names of commonly used institutional classes are:
Domain Name Type of Institution
.GOV Government agencies
.EDU Educational Institutions
.INT International Organizations (such as the North Atlantic Treaty Organization NATO)
.MIL Military Department
.COM Business Organization
.NET Network Center
.ORG Social organizations, professional associations
Table 3
Although the agency name cannot tell users about the physical location of the system, most systems that use the agency name belong to the United States, but now some domain names (such as .COM, .NET, and .ORG) are available for global application.
New top-level domain names for other institutions:
Domain Name Type of Institution
.FIRM Business or Company
.STORE provides business units that purchase goods
.WEB The entity related to WWW is mainly engaged in activities
.ARTS Activities mainly focused on cultural and entertainment activities
.REC An entity that focuses on recreational entertainment activities
.INFU An entity that provides information services
.NOM Targeted individual or person naming
Table 4
(The above 7 domain names are the latest institutional domain names expanded by the IAHC of the Internet Special Committee on February 4, 1997)
Table 5 below lists some popular top-level domain names in geographic categories:
Domain Name Country or Region Domain Name Country or Region Domain Name Country or Region Domain Name Country or Region
.am Armenia .aq Antarctica .ar Argentina .au Australia
.bb Barbados .be Belgium .bg Bulgaria .ca Canada
.ch Switzerland .cl Chile .cn China .cr Costa Rica
.cy Cyprus .de Germany .dk Denmark .ec Egypt
.eg El Salvador .es Spain .fi Finland .gb UK (official)
.gr Greece .hk * .hu Hungary .ie Ireland
.il Israel .in India .ir Iran .it Italy
.jm Jamaica .jp Japan .kr South Korea .lt Lithuania
.lu Lucenbao .mo Macao .mx Mexico .ni Nicaragua
.nl Netherlands .no Norway .nz New Zealand .pe Belu
.ph Philippines .pl Poland .pt Portugal .ru Russia
.se Sweden .sg Singapore .si Slovenia .th Thailand
.tn Tunisia .tr Turkey .tw * .us United States
.uk UK (generic .ve Venezuela .vn Vietnam .zm Zambia
Table 5
DNS resolution process and principles
After introducing the concept of domains and the hierarchy of domains above, you can further understand the working principle and process of DNS. The working principle and process of DNS are divided into the following steps:
Step 1: The client submits a domain name resolution request and sends the request to the local domain name server.
Step 2: When the local domain name server receives the request, it first querys the local cache. If there is this record item, the local domain name server will directly return the query result.
Step 3: If there is no such record in the local cache, the local domain name server will directly send the request to the root domain name server, and then the root domain name server returns the address of the main domain name server of the query domain (root subdomain) to the local domain name server.
Step 4: The local server sends a request to the domain name server returned by the previous step, and then the server that accepts the request is queried for its own cache. If there is no such record, it returns the address of the relevant lower-level domain name server.
Step 5: Repeat Step 4 until the correct record is found.
Step 6: The local domain name server saves the returned results to the cache for the next use, and returns the results to the client.
Let's give an example to explain the process of resolving domain names in detail. Suppose that our client wants to access the site: , the local domain name server of this client is , a root domain name server is , and the domain name server of the website to be accessed is , and the domain name resolution process is as follows:
(1) The client issues a message requesting to resolve the domain name
(2) After the local domain name server receives the request, query the local cache. Assuming that there is no such record, the local domain name server issues a request to the root domain name server to resolve the domain name.
(3) After receiving the request, the root domain name server queries the local record and gets the following results: NS (indicates that the domain name server in the domain is:), and the address is given at the same time, and the result is returned to the domain name server.
(4) Domain name server After receiving the response, it will issue a message requesting the resolution of the domain name.
(5) Domain name server After receiving the request, it starts querying the local record and finds the following record:A 211.120.3.12 (represents that the IP address of the domain name server in the domain is: 211.120.3.12), and return the result to the client's local domain name server.
(6) The client's local domain name server saves the returned results to the local cache and returns the results to the client.
This completes the domain name resolution process.
summary
DNS is a very complex concept. Before we start building and configuring the DNS system, we must understand the DNS system resolution process so that we will not be confused and only know how to configure it, but not why.