Many users know that there is a hosts file (no suffix name) in the Window system, in the Windows 98 system, in the Windows directory, located in the C: WinntSystem32driverseetc directory in the Windows 2000 / XP system. This file is actually a plain text file, which can be opened with ordinary text editing software such as notepad.
Use Notepad to open the HOSTS file, first see Microsoft's instructions for this file. This file works according to the standard of TCP / IP for Windows, which is a mapping relationship that contains IP addresses and host names. It is a regulation that maps IP addresses and Host Name (host name). Each section can only include a mapping relationship, the IP address is placed at the forefront of each parameter, and then writes the Host Name (host name). For this mapping description, use the "#" to use the text description.
Let's take a look at how Hosts work in Windows.
We know that we can access the network domain (xxxx.com) to 61.xxx.xxx.xxx's IP address through the DNS server to 61.xxx.xxx.xxx, our computer can access. If we request each domain name to wait for the domain name server to return to IP information, the efficiency of accessing the network will decrease, and the Hosts file can improve the parsing efficiency. According to the Windows system, the Windows system will check if this address mapping in your HOSTS file is checked, if there is, if there is, the IP address map is called, and if not, the domain name resolution is filed to the known DNS server. That is to say, Hosts's request level is higher than DNS.
Know how the Hosts file is working, what role is there in specific use?
1, speed up domain name analysis
For websites to be regularly accessed, we can configure domain names and IP mappings in Hosts, so when we enter domain names, you can quickly parse IP without requesting DNS servers on your network.
2, convenient local area network users
In a multi-unit LAN, there will be servers to be used to users. However, due to the general set of DNS servers in the local area network, access these services should be entered to enter a non-notiled IP address, which is quite troubles to many people. You can now make a name that is easy to remember, and then build an IP mapping in Hosts, so we entered the name of this server when you visit.
3, shielded website
Now there are many websites to agree to install a variety of plugins into your computer, some may be Trojans or viruses. For these websites we can use Hosts to map the domain name of the site to the wrong IP or your computer's IP, so you don't have to access it. We write the following in Hosts:
127.0.0.1 # Shielded Website
0.0.0.0 # Shielded website
This way the computer parses the domain name is resolved to the native or error IP, and the purpose of the shield is achieved.
4, smooth connection system
For Lotus servers and some database servers, if you enter the IP address directly, you can only enter the server name to access. Then we configure the HOSTS file so that the input server name can be connected smoothly.
Finally, it is to point out that the mapping configured by the Hosts file is static. If the computer on the network changes, please update the IP address in time, otherwise you will not access