How to stop or block Websites (either http or https) on Windows XP/7 using hosts file
by: Revengsky Joseph D. Reyes – a.k.a rjdreyes
Some routers have a standard or way how to block websites, but not all have the capabilities to block certain websites or url. For instance, if you familiar with the difference between http or https, if you put on the router the website you want to block say, e.g. http://www.mywebsite.com but if the client used the website request such as https://www.mywebsite.com, this will redirect to other protocol, in which the router wouldn’t block it.
There other routers has all the capabilities, but regardless the router has more or less capabilities, and you need an alternative way how to block/stop websites from incoming request by the client in your network, then this tip/guide will help you a lot.
If you’re familiar with hosts file, then this will an easy task for you, else I’ll guide you throughout the tutorial. (Note: You must have an administrator account or privileges)
1. (Whether using Windows XP/7) Go to Windows Explorer, go the System Folder of your Windows (e.g. If the installation of your Windows System is in C: drive, you can check C:\Windows or else look into other drives)
2. From Windows Root Folder, go to (e.g. C:\WINDOWS\system32\drivers\etc), then from there, you will found the hosts file.
3. On Windows XP: Right-click the hosts file then choose Open. Then select Open with Notepad. (This will able you to edit the hosts file) then from there, input your desire website to block. (See the below image for an example)
(e.g. 127.0.0.1 mywebsite.com and 127.0.0.1 www.mywebsite.com, the mywebsite.com is entirely different with www.mywebsite.com, if you are familiar with IP address, prefix, subdomain and domain name server you would understand it)
On Windows 7: Type notepad at start menu search bar, then from there, right-click Notepad and then click Run as administrator. Browse on the folder where the hosts file is located (mentioned earlier), then drag and drop to the opened Notepad.
For some instances:
Why you can’t save the edited hosts file on its original file on Windows 7?
You need to use Replacer. Replacer is a tool that can replace a system file without booting on a safe mode, be sure that your account has an administration privileges. (click here to download). It’s because it’s protected under the Windows system. Unlike Windows XP, you can save it right away. Just save the edited hosts file on other folder then used Replacer. (click here for an example how to use Replacer)
4. If you can still visit or browse the said website (the website supposed to be blocked), Open the Command Prompt (Type cmd on Start Menu Search Bar), then type:
This will reset / resolve DNS Cache. This will led the www.mywebsite.com or mywebsite.com to the IP address (127.0.0.1) which the localhost and not on the real IP address destination.
Try to explore its usages, then comment here if you found one interesting to share.
That’s all! I hope this guide and tips helps you out! Cheers! 😀
(Note: Microsoft (Windows XP and 7 OS) Logo/Images/Pictures has a respective copyright. I used it for demonstration purpose only.)
BUY WINDOWS XP / 7 AT AMAZON US:
Related Entries / Links / Sources / Articles / Sources:
Replacer Official Site – Download
Uxtheme.dll is missing or not found or corrupted on Windows XP