Want to block all users of a Windows PC from opening certain websites, regardless of the browser they use or the time of day? You need only make a few simple additions to the Windows hosts file. This method is straightforward and free, and it doesn’t require you to download or install any additional software. It’s an effective method for restricting users of all ages from seeing the content you don’t want them to access.
Block a Website on Your PC
1. Open Windows Explorer and navigate to C:WindowsSystem32driversetc. If Windows is not installed on C:, substitute the appropriate drive letter.
2. Double-click hosts, and select Notepad when Windows prompts you to choose a program. If you don’t get the prompt, or if the hosts file opens in another program, open Notepad (Start, All Programs, Accessories, Notepad), and then navigate to hosts by clicking File, Open within Notepad.
3. Place the cursor at the end of the last line, which will say something such as ‘127.0.0.1 localhost’ or ‘::1 localhost’. Press Enter to create a new line.
4. Type 127.0.0.1, tap the spacebar once, and then type the address of a website you want to block. For example, to block all traffic from YouTube, type 127.0.0.1 www.youtube.comon this line.
5. Continue to add the websites you wish to block, each prefaced with 127.0.0.1 and a space.
6. Click File, Save to commit to your changes. Dismiss any warnings from antimalware software, which may be triggered by your editing of the hosts file.
7. Close any open browser windows, and then reopen a browser to test your edits. The blocked sites should not display in any browser.
What Are The Benefits Of Blocking Sites Using The Hosts File?
First of all you can block malicious websites using excluding lists that contain known offenders.
Secondly, if those lists contain ad servers or trackers, you will experience faster website loading times, as all ad and tracking related apps are blocked from loading. Moreover, this protects your privacy and enhances security since your browsing habits are shielded from many known trackers.
Finally, you can play a prank on people by re-directing any website you like, for example Bing to Google.
What Tools Can I Use to Manage My Hosts Files?
I recommend HostsMan. Apart from providing a simple interface to add entries to your Hosts files, it also allows you to import blocking lists from hpHosts via the > Update Hosts button.
You can either merge this data with your current Hosts file or overwrite it. I recommend merging, since this allows you to simply delete the added information later and not lose anything you have in there already.
You can also edit the Hosts file using a convenient user interface.
Unfortunately, HostsMan does not currently allow you to import your own text files and merge them with your Hosts files. This is something you need to do manually.
I am a blogger since 2010 and I’m the author of this website I'm a systems/network administrator and I enjoy solving complex problems and learning as much as I can about new technologies. I write tutorials based on my work experience and other IT stuff I find interesting.
since 2006 in online world also I am a troubleshooter for the well-known website like http://www.fixya.com and many more groups