Take you through the DNS resolution process in five minutes

Table of contents

1. DNS terminology explanation

2. DNS resolution process

1. Local analysis

2. Local dns server (LDNS for short)

3. Root domain name server

3. DNS resource record types


1. DNS terminology explanation

A domain name is the name of a computer or computer group on the Internet consisting of a string of names separated by dots. It is used to locate the computer during data transmission.

DNS, full name Domain Name System, Chinese name Domain Name System, is a core service of the Internet. As a distributed database that can map domain names and IP addresses to each other, it allows people to access the Internet more conveniently without having to remember it. Live IP number string that can be read directly by the machine.

Take Taobao as an example. www.taobao.com is the domain name, but the computer cannot directly find Taobao based on the domain name. It must be converted into 101.89.125.239 (IPV4) or 240e:e1:f300:1:3::3f9 (IPV6). Only the IP address can be read accurately, and the IP address here may change with time, network, and machine changes.


2. DNS resolution process

1. Local analysis

After the user enters www.taobao.com in the local browser , the computer will first parse it locally (① in the picture), which will be divided into three small steps:

  • 1) First, check whether there is a corresponding record in the browser's DNS cache. If so, return the IP address directly to complete the parsing. If not, go to the next step;

  • 2). Then a judgment will be made: whether the software or the browser directly queries the domain name. If there is one, it will directly connect to the DNS server provided by the software service provider and return the IP; if not, it will continue to query the cache of the operating system: if there is one, it will directly return the IP address and complete the resolution. If there is no one, go to the next step;

  • 3) Finally, check the local host file. For example, the Windows host file is generally located in "C:\Windows\System32\drivers\etc". If it is not found here, you need to search it on the local dns server.

2. Local dns server (LDNS for short)

It consists of two parts: cache server and recursive server.

  • 1) There are two types of cache servers, one is a public DNS server, such as 114 DNS (114.114.114.114), Google DNS (8.8.8.8); the other is a DNS server provided by local operators, such as our Shanghai Telecom DNS servers include 202.96.209.5, 202.96.209.133, 116.228.111.118, and 180.168.255.118. Ordinary users use the operator's local domain name servers. These servers are generally installed not far from the users and have very good performance. Therefore, domain name resolution results are generally cached. About 80% of domain name resolutions are completed in this step. (② in the picture).

  • 2) If the cache server cannot find the corresponding IP, it will pass the information to the recursive server.

3. Root domain name server

When the information is passed to the recursive server, it will seek help from the root domain name server based on the built-in root domain name server IP address::

  • 1) There are generally three types of dns domain name servers, namely root domain name server (.), top-level domain name server (.com), and authoritative domain name server.

  • 2) There are a total of 13 groups of root domain name servers in the world (note: this does not refer to 13 servers, but 13 IP addresses, numbered according to the letter am). The root domain name servers will not directly resolve domain names. Twenty different resolutions The request is assigned to other servers below for completion. The following is the tree structure diagram of the dns domain name system:

  • 3) Taking www.taobao.com as an example, when the root domain name receives the resolution request from the local dns, it learns that the suffix is ​​.com, so the IP address of the top-level domain name server responsible for .com is returned to the local dns (shown in the figure) ③ and ④).

  • 4). The local dns obtains the returned IP address, and then finds the corresponding top-level domain name server. The top-level domain name returns the authoritative server IP responsible for the domain name to the local dns (⑤ and ⑥ in the figure).

  • 5). Finally, the local dns finds the corresponding authoritative server based on the ip, and the authoritative server returns the corresponding host ip to the local dns. This completes the entire process of domain name resolution (⑦ and ⑧ in the figure).

3. DNS resource record types

There are six main types of DNS resource records, as shown in the following table:

 

 

 

 

Guess you like

Origin blog.csdn.net/m0_62609939/article/details/131941715