There is an old Chinese saying that goes, "Far relatives are not as helpful as close neighbors." When trouble comes, distant relatives are not as helpful as neighbors. It has roughly the same meaning as "Far water cannot save a near fire." The principle of proximity is not only useful in real society, but also widely recognized in virtual networks. DNS is an example.
Simply put, DNS (Domain Name System) is the "domain name system". In a TCP/IP architecture network environment, DNS is a very important and commonly used system. The main function is to convert the DomainName that is easy for people to remember and the IP that is not easy for people to remember. The network host that performs DNS services above can be called DNS Server. Basically, we usually think that DNS just converts the Domain Name into an IP Address, and then uses the found IP to connect. Of course, there is also the function of converting IP to Domain Name, but it is not as commonly used as the former.
DNS works using layers. For example: the DomainName of a school forum is bbs.abc.edu.cn, and this DomainName is assigned from .edu.cn. .edu.cn is granted from .cn. .cn comes from ".", which is the so-called "root domain". The root domain is already the top level of Domain Name. The "." layer is managed by the Internet Information Center. DomainNames all over the world are like this, granted layer by layer. When I check a Domain Name, the DNS is also checked layer by layer. Take bbs.abc.edu.cn as an example:
1. First, the computer sends a request question to its set DNS Server and asks what the IP corresponding to bbs.abc.edu.cn is.
2. This DNS will first check whether there is the information you are looking for in its cache, and if so, give an answer. If not, start from the top. The local DNS system sends a "answer" request to the root DNS system, and the root DNS system returns the IP address of the DNS system of "CN";
3. The local DNS system accesses cn’s DNS and obtains the IP address of edu.cn’s DNS system;
4. The local DNS system accesses the DNS of edu.cn and obtains the IP address of the DNS system of abc.edu.cn;
5. The local DNS system accesses the DNS of abc.edu.cn and obtains the IP address of the DNS system of bbs.abc.edu.cn. Then return the IP address of bbs.abc.edu.cn to the user.
In this process, no matter which layer it is, after the information is found, the corresponding content will be copied to the cache for next time use. After knowing that DNS operates using a hierarchical structure, you should know that the DNS closest to us is the best. (Source: http://dns.qy.com.cn )