How to manually block malicious websites? Ingeniously modify the hosts file

  
. When browsing the web, it is very annoying to jump out of a bunch of junk ads. In fact, this problem is very easy to solve, but many people still don't know, and often complain that their computers are infected with viruses. The page is locked, can't be closed, or often pops out of the ad window, I don't know what to do.
Today, Xiaobian tells you a secret. Windows has a little-known feature that can help you block these malicious websites. This is the hosts file. You can modify it by manually modifying it without installing third-party tools. software. Then you will definitely ask what is the hosts file?
First, what is the hosts file
hosts files exist in the system32\\drivers\\etc under the Windows directory. This file has no extension, but we can use Notepad to open it. Open the file, you can see that there are many English explanations. At the end of the file, there is a line of 127.0.0.1localhost. This file includes the host's IP address and image name, and each address entered should be placed in a separate row. The IP address should be placed in the first column of the corresponding hostname. There should be at least one space between the IP address and the host name.
Because we are accessing the website, the request level of the hosts file is higher than the DNS server. Therefore, modifying the hosts file can process the specified URL to prevent users from accessing specific websites.
The hosts file also speeds up our access to the site. When we access the network, our computer sends a network domain name to the DNS server, and the DNS server resolves the domain name into an IP address and returns it to the computer. This process slows down the speed of visiting a website. Properly working with the hosts file can speed up access to the site. For example, the specified IP address is added to the hosts file, so that the DNS server does not need to parse the address of the web page.
In fact, the hosts file has other special advanced features: such as convenient LAN users to connect to the system. These features can greatly reduce our access time to the network, making our access to the network faster and more convenient.
Second, blocking specific websites
To block specific websites, we can do the following.
1. In C:\\windows\\system32\\drivers\\etc, find the hosts file and open it with Notepad.
2. Enter the address of several websites you want to block at the bottom of the file. The format is as follows. The URL to be blocked is my123***.com:
127.0.0.1 my123***.com
127.0.0.1 my123***.com
3. Save the hosts file.
4. Change the properties of the hosts file to read-only to prevent tampering by viruses.
Third, speed up access to the website
To speed up the resolution of the URL, for us to visit the website to speed up, first find the IP address of the website you need to visit, you can use the ping command. Then, open the hosts file and add the “IP address domain name” at the end of the file.
Finally, save the hosts file and modify it to read-only properties. When you browse the website again, the domain name — IP address resolution is done by your local machine, without accessing the DNS server, speeding up the website access speed.
When you manually modify it using the hosts file, you won't complain that your computer is locked by a virus page, you can't close it, or you often jump out of the ad window, I don't know what to do

Copyright © Windows knowledge All Rights Reserved