How to modify the hosts file win7

  

For friends who like to smash their computers, they may be familiar with the hosts file. 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: WINDOWSsystem32driversetc

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 take the actual The system letter will prevail.

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 way to modify the hosts file in the fastest way.

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

2, you can quickly find 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 using Notepad to open, you can modify the hosts file. Modify it according to the features you want to implement. Here are a few examples.

Example 1: Specify the IP address of the visited website

Specify the IP address of the access computer Pepsi.com www.pc841.com: 119.188.139.154, just add the following sentence below the Hosts file:

119.188.139.154 www.pc841.com (note that there should be spaces between the IP and the URL) as shown below.

After the addition is complete, you can save it. After we go to the computer and ping www.pc841.com, we can see that the specified IP address is accessed, 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 if you can find it. Some of the available Google server IPs that are not blocked, according to the above method, are assigned to the available IP addresses, and you can access Google normally.

Modifying Host Files to Access Google

Example 2: Blocking Designated Websites

Sometimes, to prevent children from having unhealthy websites, we can add these URLs to the hosts file. In the middle, after adding, the specified website will not be able to access normally.

Modifying the hosts file, shielding the website is very simple, just follow this format:

127.0.0.1 www. Need to block the URL.com Modify the Hosts file as follows.

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

After the addition is complete and saved, try to open the specified website on your computer and the website will not open properly.

There are many other useful uses to modify 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 enthusiasts.

Copyright © Windows knowledge All Rights Reserved