Knowing how the Hosts file works, what does it do in specific use?
1, speed up the domain name resolution
For sites that you want to visit frequently, we can configure the domain name and IP mappings in the hosts so that when we enter the domain name computer We can quickly resolve the IP without having to request a DNS server on the network.
2. Convenient for local area network users
In many units of the local area network, there will be servers available to users. However, because the LAN generally rarely set up a DNS server, access to these services to enter the hard-to-remember IP address, for many people is quite troublesome. It is now possible to give these servers an easy-to-remember name, and then set up an IP map in the hosts so that we can enter the name of the server when we access it later.
3. Blocking Websites
Now there are many websites without user consent to install a variety of plug-ins to your computer, some may be Trojan or virus. For these sites we can use the hosts to map the site's domain name to the wrong IP or the IP of its own computer, so that it does not have access. We wrote the following in the hosts:
127.0.0.1 #屏蔽的网站
0.0.0.0 #屏蔽的网站
In this way, the computer resolves the domain name to native or wrong IP, and achieves the purpose of shielding.
4. Smooth Connection System
For Lotus servers and some database servers, if you enter the IP address directly when you access that is inaccessible, you can only enter the server name to access. Then we configure the hosts file so that the input server name can be successfully connected.
Finally, the mapping of the Hosts file configuration is static, and if the computer on the network changes, update the IP address in a timely manner, otherwise you will not be able to access it.
What is the role of the C:\WINDOWS\system32\drivers\etc\hosts file