当前位置:网站首页>[network planning] 2.4 DNS: directory service of the Internet

[network planning] 2.4 DNS: directory service of the Internet

2022-06-11 00:27:00 ChuHao H

 Insert picture description here
This article is based on 《 computer network —— top-down approach 》 A Book

2.4 DNS: Directory services of the Internet

One way to represent a host is to use the host name ( such as www.baidu.com), This host name is easy to remember and easy to accept . Then there are IP The address is used to mark the location of the host on the network , This fixed length IP The address is easy to be recognized by the router .

DNS Services provided

I just saw that there are two ways to identify the host . and The domain name system DNS From hostname to IP Address translation to service , That is to convert the domain name entered by the user into IP Address , Then access through the network .DNS It's a layered DNS The distributed database implemented by the server and an application layer protocol that enables the host to query the distributed database .DNS The server is usually running BIND The software UNIX machine .DNS Running on the UDP On the transport layer agreement , Use 53 Port no. .

For example , If a browser running on the host is ready to request URL by www.someschool.com/index.html What happens when the page of . To give www.someschool.com Send request message , First, get www.someschool.com The address of , This is done as follows :

  1. The browser is running on the host DNS Application client
  2. Browser from above URL Extract the host domain name from the www.someschool.com, And transfer the host name to DNS Application client .
  3. DNS The customer asked DNS The server sends a request message including the host name .
  4. DNS The customer finally recovers a response message , It contains www.someschool.com The host IP Address .
  5. Once the browser receives a message from DNS Of IP Address , It's going to IP Address 80 Port of HTTP The server process initiates a TCP Connect .

In addition to address translation services ,DNS It also provides some very important services :

  • Host alias : Hosts with complex host names have one or more aliases . under these circumstances , Several different host domain names will lead to the same host . Usually Specification host name Most in line with the specifications , But it may not be easy to remember , The host alias may be easy to remember
  • Email server alias : People also want to remember the email server address . But email addresses can be complicated , Therefore, the mail address can be easily remembered through the mail server alias . Email applications can call DNS, Analyze the provided hostname alias , To get the canonical host name of the host and its name IP Address .
  • Load distribution :DNS It is also used for load distribution between redundant servers , Busy sites are redundantly distributed across multiple servers . These servers run on different end systems , Each has a different IP Address . So a canonical hostname is associated with an address set ,DNS These are stored in the database IP Address set , When a user sends a... To a host name mapped to an address set DNS When asked , The server uses IP The entire set of addresses responds .

DNS Working mechanism overview

DNS A simple design of is to use only one on the Internet DNS The server , The server contains all host names and IP Address mapping , But the problem with this design is :

  • A single point of failure : If this DNS Server failure , The whole Internet will be paralyzed .
  • Communication capacity : Single DNS The server has to deal with everything DNS Inquire about , It will cause serious communication congestion .
  • Remote centralized servers : Servers that are too far away will cause a large delay .
  • maintain : A single server has to keep records for all Internet hosts , This is the central database is very large and needs to be updated frequently .

1. Distributed 、 Hierarchical database

In order to deal with the above problems ,DNS The system uses a large number of DNS The server , Distributed around the world in a hierarchical manner , No single server has all the mappings in the world , in other words ,DNS It's a distributed system . For the most part ,DNS The server is divided into 3 Kind of : root DNS The server 、 Top-level domain DNS Servers and authorities DNS The server .

  • root DNS The server : There are many root domain name servers around the world , It is provided to find the top-level domain corresponding to the top-level domain DNS Server services . such as www.baidu.com Your top-level domain name is com, The root domain name server will return com Top-level domain DNS Server's IP Address .
  • Top-level domain DNS The server : Every top-level domain ( such as com, org, edu) There will be corresponding top-level domains DNS Server cluster . Top-level domain DNS The server can query the corresponding authority according to the top-level domain name DNS The server . For example, visit www.baidu.com When ,com Top-level domain DNS The server will return baidu.com Of the authoritative server IP Address .
  • Authoritative server : The owner of a host that can be accessed publicly will choose an authority DNS The server saves the IP Mapping of address and host name , In this way, child users can access the host through the host name .

There is another critical class of hosts , be called Local DNS The server . every last ISP( Internet service provider , For example, institutional ISP Or in residential areas ISP) There is a local one DNS The server , When the host A And some one ISP When connected ,ISP Will provide another store with local DNS Server's IP Address of the host B The address of . host A You can send a message to the host B Get nearby DNS The address of the server .

原网站

版权声明
本文为[ChuHao H]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020628372607.html