How to Block Websites the Easier Way in Windows

Discretion and privacy are the most popular trend on the Internet now.  One might not be aware of this, but our every activity is constantly tracked online. Whether it be the websites that you visit, the songs or movies that you stream online, the shopping you do online and much more, all this data is constantly monitored and tracked. One of the most important reason for which your online activity is tracked is because this data is very important to online advertisers. Advertisers use this data to show ads on the websites you visit and these ads are filtered according to your interests and surfing habits.  The privacy of your online activity is very important and you should be aware of how you can protect your activities and identity online.

accessdenied.jpgWhile there are many browser extensions and addons that you can use to block ads and websites, there is a simple hack/trick for Windows Operating System using which you can block any website or online ads easily. The best part about this trick is that you can use it to block websites on all the browsers on your Windows PC.

This simple trick makes use of editing the Windows HOSTS file. HOSTS file in Windows is used to maintain a static table of host-name to IP address mapping and this file is used to locally translate website names to IP addresses.

There are two simple methods to edit the HOSTS file on Windows –

  1. Manually edit the HOSTS file
  2. Use a tool called Hostsman editor

1. Manually editing the HOSTS file on Windows

HOSTS file on your Windows system can usually be found at C:\Windows\system32\drivers\etc\ (where C:\ is the drive where Windows OS is installed). After you have located the HOSTS file, you can use any text editor to edit the file manually.


To block a website, goto the end of the file and make an entry like this :


For example if you want to block so that it cannot be opened from any browser on your Windows PC, you can make an entry on a new line in the HOSTS file like this:

Once you have made the entries in the HOSTS file, you have to save the file. Also for the changes to reflect instantly, you should clear browser cache and all the browser cookies. You next step should be to clear the DNS cache on your Windows machine. To do this, open a command prompt on your Windows machine and type this:


It is also a good option to restart the machine for changes to take effect. That’s it ! Now when you type the address of a blocked website in any of the web browser on your Windows machine, it will not open.

How to block ads on Websites :

As can be seen from the screenshot above, if you want to block online ads on websites (e.g. Google ads) you have to make two entries on the HOSTS file:

If you have correctly made this entry in the HOSTS file, you should never see Google Ads on any of the websites that you visit. The same technique can be used to block any advertising server, malicious sites, sites which may harm your computer or sites with inappropriate content.

2. Editing HOSTS file using Hostsman Editor

If are going to use HOSTS file to block a large number of websites, we recommend you to use a tool to easily manage your blocking list. Hostsman is a free application with an easy to use interface.



You can download Hostsman from this link.

If you are looking for an alternate utility other than Hostsman to edit the HOSTS file, you can also make use of Hostess. Hostess specializes in blocking online ads and is very easy to use.

Download Hostess