Preliminary understanding of DNS and the role of domain names



DNS: DNS (Domain Name System) is the English abbreviation of "Domain Name System".
The main function is to resolve the domain name to IP (TCP/IP communicates through IP, but the IP pair is not easy to remember, the domain name https://www.baidu.com is easier to remember), to put it bluntly It's just a domain name in exchange for an IP.


DNS is managed by a special agency. If you have a server, you can apply for a domain name that others have not yet applied through some domain name application agents on the Internet to give you a server, so that others or you can access your server without going through Enter the IP (https://123.123.123.123) to access, and you can access it directly with your domain name (https://me.me.me.me.com). After you apply for a domain name, the agent will add a record of the IP corresponding to your domain name in the main DNS server, and will update it to the DNS servers in various places after a period of time.



Advantages of domain name: When your server IP changes (due to server relocation, lease period to re-lease another), you can ask the agent to change the IP of the IP record corresponding to the main DNS domain name for you, no need User by user to tell them that your IP has changed (because the domain name has not changed). Users will get your new IP through the DNS server.


DNS working process:
1. The browser enters the domain name to access (https://www.baidu.com)
2. The browser searches the local DNS file (it seems to be the hosts file) to see if there is an IP corresponding to this domain name. Use this IP to access.
3. If the local DNS file does not exist, go to the local DNS server (in a region, such as Guangdong DNS server) designated by the local machine to find it, and return if there is. If not, it will look up to its upper level until it is the root DNS server. If there is none, it proves that the domain name is unavailable.
4. During the search process, the DNS server will record the search records for this time and cache them, which is convenient for the next search.
5. Finally, a copy of the local DNS file will be cached to facilitate one visit to this website.


Each region has a DNS server. We should set the DNS server of this machine to the local one, because the DNS server set to other regions may be very slow due to network reasons.


If the machine does not set up DNS, you can still access the website through IP, but not through the domain name.


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327033762&siteId=291194637