Explain the magic of the Windows system Hosts file

  
                

Many users know that there is a Hosts file (no suffix name) in the Window system. In Windows98, the file is in the Windows directory and in the Windows2000/XP system in the C:\\Winnt\\System32\\Drivers\\Etc directory. . But many people don't know what the Hosts file is for? The file is actually a plain text file that can be opened with ordinary text editing software such as Notepad.

Open the hosts file with Notepad and first see Microsoft's description of this file. This file works according to the standard of TCP/IP for Windows. Its role is to include the mapping between IP address and Host name. It is a mapping IP address and Hostname. It is required to only require each segment. Can include a mapping relationship, the IP address should be placed at the top of each paragraph, and then the mapped Host name (host name). For the mapping description of this paragraph, use “#” after segmentation, use text to explain.

Now let's see how Hosts works in Windows.

We know that to access the website on the network, we must first resolve the network domain name (www.XXXX.com) to the IP address of 61.XXX.XXX.XXX through the DNS server, and then our computer can access it. For each domain name request, we have to wait for the domain name server to parse and return the IP information, so the efficiency of accessing the network will be reduced, and the Hosts file can improve the parsing efficiency. According to the Windows system, before the DNS request is made, the Windows system first checks whether there is this address mapping relationship in its own Hosts file. If so, the IP address mapping is called, and if no domain name resolution is made to the known DNS server. In other words, the request level of Hosts is higher than DNS.

Knowing how the Hosts file works, what does it do in specific use?

1. Speed ​​up domain name resolution

For websites that we visit frequently, we You can configure the mapping between domain name and IP in Hosts, so that when we enter the domain name computer, we can quickly resolve the IP without requesting the DNS server on the network.

2, convenient LAN users

In many units of the LAN, there will be servers available to users. However, since the DNS server is rarely installed in the local area network, it is quite troublesome for many people to access these services by inputting a hard-to-remember IP address. Now you can give these servers a name that is easy to remember, and then create an IP mapping in Hosts so that we can enter the name of the server when we access it later. Previous12Next page Total 2 pages

Copyright © Windows knowledge All Rights Reserved