Steps to Block Websites Using Windows Hosts Files
Step 1: First, Open Windows Explorer. Now Click on This PC or My Computer.
Step 2: Open C:\, then click on the Windows folder. Next Open System32 folder, Inside that open the drivers folder and then open etc folder. Here you can see some files and open hosts files.
Step 3: Now, notice that the file type for the host’s file is listed as File. Now open notepad as Administrator. And drag hosts file on the notepad.
To add new entry in hosts file is very easy. The hosts file uses the format:
IP Address exampledomain.com
Step 4: To block the website add IP Address 127.0.0.1 for hosts that you want to block. So, if I wanted to block a website like www.nytimes.com, I could just add the following line in hosts file:
Steps to Redirect Websites Using Windows Hosts Files
If you didn’t want to block the website in that way, you could also redirect it to another website.
Step 1: First, you need to find the IP address of the other site. For example, I want to redirect from abc.com to xyz.com. And assume the address of xyz.com is 192.168.43.169.
Step 2: Add the new entry in windows hosts file like,
192.168.43.169 abc.com. Refer below sreenshortt,
Nice! Now when I visit abc.com, I get redirect to xyz.com. If the website uses HTTPS like Google.com or something, it should still redirect if you use the host name because there is no way to specify the HTTPS version of a website in the HOSTS file. The hosts file is still useful, even in Windows 10. It also still works just fine in Windows 8, 7, Vista, etc.]]>