Home  >  Article  >  What are the consequences of deleting the hosts file?

What are the consequences of deleting the hosts file?

藏色散人
藏色散人Original
2023-03-09 14:42:058268browse

Deleting the hosts file will have no impact; hosts is a system file without an extension, which can be opened with tools such as Notepad. Its function is to establish an association between some commonly used website domain names and their corresponding IP addresses." Database"; when the user enters a URL that needs to be logged in in the browser, the system will first automatically search for the corresponding IP address from the Hosts file. Once found, the system will immediately open the corresponding web page. If not found, the system will then The URL is submitted to the DNS domain name resolution server for IP address resolution.

What are the consequences of deleting the hosts file?

#The operating environment of this tutorial: Windows 10 system, Dell G3 computer.

What are the consequences of deleting the hosts file?

Deleting the hosts file will have no impact.

Hosts file recovery method:

1. Create a new text document txt in the "c:\windows\system32\drivers\etc" folder;

What are the consequences of deleting the hosts file?

2. Copy the following content into the text document txt;

What are the consequences of deleting the hosts file?

3. Rename this article to modify the hosts file and delete the extension.

What are the consequences of deleting the hosts file?

Extended information:

Function of hosts file:

1. Speed ​​up domain name resolution

For frequently visited users For websites, we can improve the domain name resolution speed by configuring the mapping relationship between domain names and IPs in the hosts file. Because of the mapping relationship, when we enter the domain name, the computer can quickly resolve the IP address without requesting the DNS server on the network.

2. Build a mapping relationship

In many units, there will be their own local area network, and there will also be different servers provided for use by company members. However, since DNS servers are rarely installed in local area networks, when accessing these servers, you need to enter IP addresses that are difficult to remember, which is quite troublesome for everyone. Therefore, we can give these servers names that are easy to remember, and then create IP mappings in the hosts file, so that when we visit in the future, we only need to enter the name of the server and it will be OK!

3. Block spam websites

Now there are many websites that install various plug-ins into our computers without our consent, including many viruses and Trojans. . For these websites, we can use the hosts file to map the domain names of these websites to a wrong IP or the IP address of the local computer, so that access can be prohibited!

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What are the consequences of deleting the hosts file?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn