Where is the win7 hosts file location? Win7 modify the hosts file detailed graphic tutorial

  

For friends who like to reverse the computer, the hosts file may be familiar. In Windows, the hosts file size is only about 1K, but this file can be used to achieve some very amazing features, including making a web address, blocking the development of a website, and even blocking ads. For computer novice friends, modifying the hosts file is also very simple, just need to know where the hosts file is, how to simply modify it, let's take a look at it in detail.

Where is the hosts file?

This article takes Win7 system as an example, XP, Win8 and Win10 systems, the operation steps are the same.

Hosts file path: C:\\WINDOWS\\system32\\drivers\\etc

The above C refers to the system disk, the general computer system is installed in the C drive, if your computer system is not installed In the C drive, please refer to the actual system drive letter.

Win7 modify the hosts file graphic tutorial

We can directly find the hosts file through the above file path, here Xiaobian teaches everyone to open the modified hosts file method in the fastest way.

1, open the run in the Win7 start menu, you can also use the [Win + R] combination shortcut to open quickly, then paste the hosts file location in the input box after opening, then the bottom of the "ld" ; OK & rdquo; as shown below.

2, you can quickly open the hosts file. Next, right click on the file, and then select “Open” and then choose to open using Notepad, as shown below.

3. After opening in Notepad mode, you can modify the hosts file. Modify it according to the function you want to implement, as shown below.

Example 1: Specify the IP address of the visited website

Specify the IP address of the access to this www.jb51.net: 119.188.139.154, just add the following sentence below the Hosts file:

119.188.139.154 www.jb51.net (note that there must be spaces between IP and URL), as shown below.

After the addition is complete, you can save it. After we go to the computer and ping www.jb51.net, we can see that the access is the specified IP address, as shown in the figure.

This method of specifying the IP address by modifying the hosts file is sometimes useful. For example, everyone knows that Google can't open it in China. This is mainly because the domestic blocking of Google's large number of DNS leads to You can find some available Google server IPs that are not blocked. According to the above method, you can access Google by using the available IP address.
Modify the Host file to access Google

Example 2: Block the specified website

Sometimes, in order to prevent children from having some unhealthy websites, we can add these URLs to the hosts file, add After that, the specified website will not be accessible.

Modify the hosts file, it is very simple to block the website, just follow this format:

127.0.0.1 www.The URL to be blocked.com (for example, to edit this phone: M.jb51.net) The method of modifying the Hosts file is as follows.

If you need to add more than one, please correspond to one in one line.

After adding and saving, try to open this version of the phone in your computer, the website will not open normally, as shown below.

Detailed tutorial: How to block websites? Shielding website method summary

There are many other wonderful uses for modifying the hosts file, such as blocking video website advertisements, etc., I will not introduce them in detail here. I hope this article can help computer lovers.

Extended reading:

How to block Youku advertising How to get rid of video ads such as Youku

Copyright © Windows knowledge All Rights Reserved