LOGO

Block Websites on Windows PC - No Software Needed

July 7, 2011
Block Websites on Windows PC - No Software Needed

Enhancing Online Security: Blocking Unsafe Websites with the Windows Hosts File

Every website you access has the potential to monitor your online activity, display unwanted advertisements, or even distribute harmful software. While common sense and standard security software, like antivirus programs and browser extensions, offer a degree of protection, an additional security measure can be implemented. Exploring the capabilities of the Windows Hosts file provides a method for blocking known malicious domains.

This article details how to bolster your online safety by incorporating blocking lists into the Windows Hosts file. The Hosts file functions by allowing redirection of domain names to a specified IP address. This functionality can then be utilized to prevent access to domains known for serving advertisements, tracking cookies, and other potentially undesirable content.

Understanding the Windows Hosts File

The Windows Hosts file is a simple text file utilized by Windows to translate hostnames into corresponding IP addresses. This file is loaded during system startup and consulted before any DNS server queries are made. Essentially, the Hosts file enables the redirection of a domain name to an alternate IP address, potentially leading to a different website or even back to your local computer.

block-unsafe-websites-blocking-lists-windows-hosts-file-2.jpg

The Advantages of Utilizing the Hosts File for Site Blocking

Firstly, the Hosts file allows for the blocking of websites identified as malicious through exclusion lists. These lists contain domains known to pose a security risk.

Secondly, blocking ad servers and trackers through these lists can result in faster website loading speeds, as resources dedicated to advertisements and tracking are prevented from loading. This also enhances your privacy and security by shielding your browsing habits from numerous tracking entities.

Finally, the Hosts file can be used for harmless redirection, such as re-routing one search engine to another.

Editing the Windows Hosts File: A Step-by-Step Guide

A previous article by Mark details the process of blocking websites via the Hosts file, providing comprehensive instructions: Create your own Internet Filter with the Windows Hosts file.

The following outlines a brief guide to editing the file in Windows 7.

  • Open Notepad with administrative privileges. Navigate to > Start > All Programs > Accessories, right-click on > Notepad, and select > Run as administrator. Confirm the prompt to allow the program to make changes to your computer by selecting > Yes.
  • Within Notepad, go to > File > Open and locate the Hosts file, found at > C:\Windows\System32\drivers\etc. The folder may appear empty initially, displaying only *.txt files. In the bottom right corner, change the file type filter to > All Files.
block-unsafe-websites-blocking-lists-windows-hosts-file-3.jpg

Sourcing Blocking Lists

WinHelp2002 is a valuable resource for obtaining pre-compiled Hosts files designed to block advertisements, banners, and other unwanted online elements. The provided Hosts file is regularly updated, with the most recent update occurring in June 2011. The file is available for download in plain text or as a ZIP archive. The ZIP file includes a batch file (mvps.bat) to automate the renaming and replacement of your existing Hosts file. Alternatively, you can manually add the list to your Hosts file by copying and pasting the content from the text file, following the instructions previously outlined.

hpHosts offers another source for Hosts files. You can either adhere to the installation instructions on their website or manually copy and paste the list from their text file into your existing Hosts file.

Numerous other resources distribute blocklists. However, ensure that any list you acquire is formatted correctly as 'IP address domain name' (without quotation marks), such as '127.0.0.1 google.com' (without quotation marks). This would redirect the domain name google.com to the IP address 127.0.0.1 (localhost). If a list lacks IP addresses, you can manually add them.

Tools for Hosts File Management

I suggest using HostsMan. Beyond offering a user-friendly interface for adding entries to your Hosts file, it also allows importing blocking lists from hpHosts via the > Update Hosts button.

block-unsafe-websites-blocking-lists-windows-hosts-file-4.jpg

You have the option to either merge this data with your current Hosts file or completely overwrite it. Merging is recommended, as it allows for easy removal of the added information without losing any existing customizations.

block-unsafe-websites-blocking-lists-windows-hosts-file-5.jpg

The application also provides a convenient interface for editing the Hosts file.

block-unsafe-websites-blocking-lists-windows-hosts-file-6.jpg

Currently, HostsMan does not support importing custom text files and merging them with your Hosts file. This task must be performed manually.

If you found this article helpful, consider exploring these related posts on MakeUseOf:

  • 3 Best Resources To Find Sites That Are Known To Have Spyware & Viruses
  • Block Websites Without Any Network Experience using Any Weblock
  • 3 Free Real-Time Malware Protection & Removal Tools

Were you previously aware of the Hosts file, and how do you plan to utilize it going forward?

Image credits: John David Bigl III

#block websites#windows#pc#without software#website blocker#restrict access