hosts file

The storage path of the hosts file of each system platform


host is a system file without an extension , which can be opened with tools such as Notepad. Its function is to establish an associated "database" between some commonly used URL domain names and their corresponding IP addresses. When the user enters a URL in the browser that needs to be logged in When it is found, the system will automatically search for the corresponding IP address from the Hosts file
. Once found, the system will immediately open the corresponding web page. If it is not found, the system will submit the URL to the DNS domain name resolution server for IP address resolution.

The functions of the hosts file are as follows:
1. Speed ​​up domain name resolution
For websites that are frequently visited, you can configure the mapping relationship between the domain name and IP in Hosts, so that when you enter the domain name, the computer can quickly resolve the IP without requesting the network. DNS server .

2. Convenient for LAN users
In many units of LAN, there will be servers available for users to use. However, since DNS servers are rarely set up in the local area network, it is quite troublesome for many people to enter difficult-to-remember IP addresses to access these services.
Now you can give these servers an easy-to-remember name, and then create an IP mapping in Hosts, so that you can enter the name of the server when you access it later.

3. Blocking websites
Now there are many websites that install various plug-ins into the computer without the user's consent, some of which may be Trojan horses or viruses. For these websites, you can use Hosts to map the domain name of the website to the wrong IP or the IP of your own computer, so that you don't have to visit. Write the following on Hosts:
127.0.0.1 #Blocked website
0.0.0.0 #Blocked website In
this way, computer resolves the domain name to the local or wrong IP, which achieves the purpose of shielding.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325079778&siteId=291194637