Block Thousands of Ads With HOSTS





Introduction: Block Thousands of Ads With HOSTS

In this instructable, I will show you an easy way to block nearly thousands of advertisements, in one simple, easy method.

Step 1: About Window's HOSTS File

Before we start, it is important to understand exactly what the HOSTS file is.

The HOSTS file is a file with IP addresses, corresponding to a domain name, that windows references and bypasses DNS with.

For a more in-depth explanation, please visit Wikipedia's definition:

Step 2: Download Replacement HOSTS File

There are many replacement HOSTS file out there, so experiment and determine which one you like best. I personally use the MVPS malware prevention HOSTS file. It does fine for me.

The MVPS HOSTS file I've used is located here:

Simply save this file to your desktop, temporarily.
(Right-Click, Save Target/Link As..)

Step 3: Navigate to and Backup Default HOSTS File

Our next step is to find the HOSTS file on your computer.

Here are some of the default locations for the Windows HOSTS file from Wikipedia.

  • Linux and other Unix-like operating systems: /etc
  • Windows 95/98/Me: %windir%\
  • Windows NT/2000/XP/Vista: %SystemRoot%\system32\drivers\etc\ is the default location, which may be changed. The actual directory is determined by the Registry key \HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath .
  • Mac OS: System Folder:Preferences or System folder (format of the file may vary from Windows and Linux counterparts)
  • Mac OS X: /private/etc (uses BSD-style hosts file)
  • OS/2 and eComStation: "bootdrive":\mptn\etc\
  • Novell Netware: SYS:\ETC

If you can't find it, Start -> Search is always a good tool to use :).

Once you successfully navigate to the HOSTS file, rename is from "HOSTS" to "HOSTS.backup".
Doing this, you will always have a backup of your default HOSTS file if for some reason you want to revert to it.

Step 4: Copy New HOSTS File

Next, copy and paste the "HOSTS.txt" file from you desktop to where your default HOSTS file was.
After the file is copied, rename it from "HOSTS.txt" to just "HOSTS".

NOTE: You maybe have to edit your folder settings to not "Hide extensions for known file types" by going to Tools -> Folder Options -> View -> Uncheck "Hide extensions for known file types".

Step 5: Finish!

You have now replaced your HOSTS file!

It may take a few minutes for the changes to become active. You may also have to close all internet browser windows.

Enjoy internet browsing with minimal ads!



  • Epilog Challenge 9

    Epilog Challenge 9
  • Gluten Free Challenge

    Gluten Free Challenge
  • First Time Author Contest 2018

    First Time Author Contest 2018

We have a be nice policy.
Please be positive and constructive.




If you are using firefox, get the Adblock extension. If you are using IE, get Firefox, then get Adblock.

But the good thing about this, is that It works for ANY browser.
Not saying that firefox is bad...

If you are using IE, get Firefox, then get Adblockhahahahaha, 1 problem i cant hahahahahahahahalol

fyi im retarted not really but in a sence

I can't agree more with Purgedsoul. I have Firefox (w/ Adblock Plus of course!) and it works like a charm. You might get the noscript extension too so you can visit sites that block Firefox (they don't like the ads bypassed!).

I am not an expert, so do correct me if I"m wrong.

Having a large host file can slow a PC down to a crawl.
Use Peerguardian instead ( without logging)

I do keep <10 entries in the host file for an absolute deny policy.

Sometimes, I'll be attacked: My DNS will be changed and Peerguardian (PG) blocks all connections. I examine the address PG is block and put it in my hosts file. If possible, try to remember the site that started everything and block that too.

So - my opinion: keep the hosts file small (unless maybe its on another (*nix ) machine)[proxy?]

I agree 100% Back when I did this, i meant for it to be a quick & easy fix.

should of known how to do that. it looks for .... and replaces it with but, if you set apache up to broadcast on, does that mean your site will become the ad? yes think so

Yes. If you didn't want this to happen, you could always use spinach_dip 's suggestion: "try using instead of"

Yeah, I learned how to do this a year or two ago, and it's nice that there's no ads, but the "This page can not be displayed" things all over can still be a bit annoying. This method is also great for pranking people! Just redirect one site to another... It'll really confuse people!