Logical Tips logo BBBOnLine Reliability Seal
  Site Contents  
  Most Recent Articles  
  Most Popular Articles  
 Windows 
  Time-Saving Tips  
  Configuration  
  File Management  
  Windows Explorer  
 Microsoft Office 
  Word Tips  
  Excel Tips  
  PowerPoint Tips  
  Browsers  
 Internet 
  Browsers  
  Email  
  Online Security  
  Site Development  
  Web  
 Graphics 
  Digital Photography  
  Image Editing  
  Design  
  Vector Graphics  
 General Computing 
  Hardware  
  Peripherals  
  Troubleshooting  
  Miscellaneous  
 Musings 
  Nerdy Thoughts  
  Random Reflections  

Web

Use the Hosts file to Block Sites

by Susan DaffronProtected by Copyscape. Do not copy.

As some long-time readers know, I use the pop-up blocker built into the Google toolbar to block annoying ads while I surf the Internet. It's free (from http://toolbar.google.com) and it works well. To date, my toolbar has blocked 1,971 windows. That's a good thing. Unfortunately, it doesn't block all of the annoying ads I encounter.

Some web sites use various tricks to get around blocking software. In fact, local newspaper sites that shall remain nameless have some particularly annoying pop-under ads that I'm really delighted to never see again. Ads that say things like, "your computer is running slowly" or other supposedly helpful claims are often spyware. You often can tell where these obnoxious flashing banners of badness are coming from by looking at the title bar. Because the ads come from a separate server than the rest of the page, it's actually relatively easy to block out the offending site. In addition to blocking pop-unders, you also can block sites you don't want your kids to see.

One way to block sites is by adding entries to Windows' "Hosts" file. This file is just a plain editable text file that lives on your computer. It has entries that look like:
127.0.0.1  media.fastclick.net

When you surf to a site, Windows automatically checks to see if the address is located in the Hosts file. The number 127.0.0.1 is the "loop back" IP address of your own computer, so Windows skips the link to the site (media.fastclick.net) and moves on. The ad server can't open its window, so it can't load any programs, spyware, or cookie files either.

You can open the Hosts file in Notepad and edit the entries so the sites you want to avoid are blocked. In Windows XP, the file is located in the C:\Windows\System32\Drivers\Etc folder. You can learn much more about the Hosts file at this page: http://www.mvps.org/winhelp2002/hosts.htm

In fact, this page also has a downloadable Hosts file you can use just by copying it into the Etc folder. Or you can view the file to see what evil parasitic sites you want to avoid. The downloadable Hosts file is 318K and the page has a note that says Hosts files that are larger than about 135K can actually slow down your computer.

As a compromise, I just copied out the lines for the ad networks I knew about from the downloaded file into my Hosts file. Over time, I may find more annoying sites, and I'll just add those entries into the file. Having the download as a reference is really handy, since it has comments that explain what some of the bad sites are up to.

The best news is that I copied in all the lines for the stupid ad network, and it was bye bye pop-unders!

Like the articles in Logical Tips? Get the books for ALL the tips!

logical tips

Logical Tips for Mastering Your Computer:
Quick Shortcuts, Tips, Tricks, and Techniques to Help You Use Your Computer More Effectively

Go from Computing Newbie to Power User!

Read about this book on Amazon
logical tips internet

Logical Tips for Mastering the Internet:
Quick Shortcuts, Tips, Tricks, and Techniques to Help You Use the Internet More Effectively

Go from Internet Newbie to Expert!

Read about this book on Amazon
logical tips office

Logical Tips for Mastering Microsoft Office:
Quick Shortcuts, Tips, Tricks, and Techniques to Help You Use Microsoft Office More Effectively

Don't Let Microsoft Office Drive You Crazy!

Read about this book on Amazon
logical tips office

Logical Tips for Mastering Microsoft Windows:
Quick Shortcuts, Tips, Tricks, and Techniques to Help You Use Microsoft Windows More Effectively

Combat Windows Weirdness!

Read about this book on Amazon

Did you like this article? Let us know!
Please click here to send feedback on this article.
NOTE: If you have computer-related questions, you must post them on our forum.
We do not answer computer questions via email.

Don't Miss Our Weekly Publishize Newsletter!
Learn how to create books, web sites, and info products
Email
Name


Check Out
Our Books!




This site powered by the Logical Web Publisher (TM): Fast, easy, and affordable content management