1. Accelerate domain name resolution
For websites that require frequent access, we can configure the ing between the domain name and IP address in hosts, so that when we enter the domain name computer, we can quickly resolve the IP address, instead of requesting DNS servers on the network.
2. Facilitate LAN users
In the LAN of many organizations, servers are provided for users. However, because DNS servers are rarely set up in Lan, it is quite troublesome for many people to access these services to enter hard-to-remember IP addresses. Now we can give these servers an easy-to-remember name, and then create an IP ing in hosts. In this way, we can enter the name of this server for future access.
3. Website Blocking
Many websites install various plug-ins on your computer without your consent. Some may be Trojans or viruses. For these websites, we can use hosts to map the Domain Name of the website to the wrong IP address or the IP address of our computer, so that no access is required. For example, if you do not want to access www.xxxx.com, write the following content in hosts:
127.0.0.1 www.xxxx.com # blocked websites
0.0.0.0 www.xxxx.com # blocked website
In this way, the computer resolves the domain name to the local machine or the wrong IP address, to achieve the purpose of blocking.
4. Smooth system connection
For Lotus servers and some database servers, if you enter an IP address directly during access, it cannot be accessed. You can only enter the server name to access the server. Then we configure the hosts file so that the server name can be successfully connected.
Finally, it should be pointed out that the hosting configured in the hosts file is static. If the computer on the network changes, update the IP address in time; otherwise, the IP address cannot be accessed.
5. Force a domain name to correspond to an IP address