Nuke The Nasty Servers – HOSTS File Blocking


AdBlocker_Logo

Nuke The Servers

In a perfect world, all content on the Web would be free. But in case you didn’t get the memo, it’s not a perfect world. Someone, somewhere, somehow, has to pay for the bandwidth and content you are consuming every time your Web browser retrieves a Web page. Due to this unfortunate reality, many sites on the Web are slathered with banner ads.

Personally, I don’t mind paying my dues, to an extent, by donating limited real estate within my browser to the banner ads that support the Web site whose content I wish to view. Advertising is what greases the wheels on which much of the Web is run.

As long as there has been online advertising, there have been moronic, evil and mischievous people abusing the medium for their own misguided purposes. Too often, the unregulated and self-policing nature of the Web is abused in a number of ways to target anyone unfortunate enough to encounter a connection to an evil Web server. Or, even a not-so-evil Web server unintentionally dispensing “malpurposed” data. (Did I just invent a word, there?)

While many people install Ad-Blockers to eliminate any and all advertising, I believe that is simply the wrong thing to do, and it hurts everyone who uses the Web. It hurts site owners who must incur the expense of developing and managing the site. It hurts the advertisers who support site owners. And ultimately, it hurts the user community as a whole, because without content, the Web loses purpose.

The HOSTS File

My choice and recommendation to others is HOSTS file blocking. This method can block unwanted third-party ad and tracking servers without blocking the host site providing the content.

The HOSTS file is a small, somewhat obscure file in nearly all operating systems. The file is part of the Internet Protocol (IP) implementation of the Operating System (OS). While it is little-used these days, it can be used to completely block any nefarious server from probing its grubby little tentacles into your computer.


hosts file

Basically, the HOSTS file over-rides Domain Name Server (DNS). Every time your computer tries to access a destination on the internet, it first checks with the HOSTS file for an Internet Protocol (IP) address. If there isn’t one for the destination in question, the next stop is a DNS server to convert a “www.whatever.xxx” address to a numerical IP address. If there is an entry in the HOSTS file for that destination, the HOSTS file is then the authority and no DNS lookup takes place.

How It Works

Here’s how it works. To block a nefarious server, you simply replace the domain’s real IP address with 0.0.0.0 on a line in the HOSTS file. Since that address (0.0.0.0) doesn’t exist anywhere on the Web, there is no contact between your computer and the nefarious server. Because the HOSTS file overrides DNS, adding a line that tells the computer “whatever.com‘s” IP address is 0.0.0.0 prevents the computer from finding the site.

It is a simple process to add listings to the HOSTS file for servers on the Web that you wish to avoid. While it is easy to do, there are many thousands of undesirable servers. Adding them manually, one by one, would take many hours of work. Fortunately, there is an easier way.

A sub-domain of the mvps.org Web site (Microsoft “Most Valuable Professionals”, or MVPs) is dedicated to maintaining authoritative information and providing updates to what is known as the MVPS HOSTS file. The site explains how using HOSTS file blocking can speed the loading of Web pages and block sites from tracking your browsing and viewing sessions, limiting their data-mining efforts.

The MVPS HOSTS file includes entries to block servers that host most Parasites, Browser Hijackers and unwanted Ad-Ware programs that target unprotected Web browsers and computers.


There Are Downsides

While HOSTS file blocking is an effective means of avoiding unwanted Ads, Tracking and Malware, it is not without it’s downsides. It’s not necessarily a set-and-forget proposition. Bad servers come and go. New servers come online every day. The HOSTS file needs to be updated occasionally, plus there may be times when you want to allow access to a blocked server for one reason or another. These issues can be easily managed with a HOSTS file manager app, such Hostsman, a freeware application to help manage, update and edit your HOSTS file.

HostsMan HOSTS file manager

In my view, Ad-Blocker programs do a disservice to both site owners and, ultimately users. Ad-Blocker software may leave a message like, “Ads blocked by AdBlock”, or similarly, on the site’s traffic logs. That is an unfortunate and unnecessary insult to the site owner providing the content and bandwidth you use when you visit that site. The HOSTS file may block the same ad or server, but it does so without adding insult to injury.

The MVPS HOSTS file doesn’t block ALL advertising. It only blocks servers that are known to be unfriendly or risky. That’s the way it should be. Banner Ads from a first-party site on which you are consuming content should be allowed. It’s only fair.

For complete information on the very simple process of installing the MVPS HOSTS file on your system, I refer you to the detailed guide at the venerable MVPs.org site: http://winhelp2002.mvps.org/hosts.htm.

Editing the HOSTS file manually can be done with any simple text editor, including Notepad, however, Administrative Privileges are required, so when launching the text editor, you must use the Right-click Context Menu, and select. Run As Administrator.

 

editing the hosts file requires administrative privileges

When saving the file after it has been edited, the text editor may default to saving the file with a .TXT filename extension. The HOST file will not work if saved with any filename extension. Therefore, you must make certain to change the “Save as type” option to “All Files (*.*)”

It is important to note that many Malware programs attempt to manipulate the HOSTS file to redirect your browser to advertising sites or to servers that will attempt to infect your system with malicious files. It is very easy for this to happen to an unprotected HOSTS file. For this reason, many AntiVirus programs prevent access to the HOSTS file by default. This is a good thing. You must remember to enable HOSTS file access when updating or changing entries in the HOSTS file, then reset the option to block HOSTS file access when the changes are completed.

Have you used the HOSTS file to block ads or nefarious servers? Do you use ad blocking browser extensions? Do you Have any HOSTS file tricks to share? Please leave a comment below.

About the Author

Daniel Banks

Daniel Banks is a computer enthusiast and part time tech. He began his computing career in the early '90s with a state-of-the-art 486 computer. Playing Kong when he should have been working, he quickly became a master at throwing exploding bananas. RAM was measured in kilobytes... computers only came in one color... getting online made lots of noise and AOL was the internet... or, so we thought. Daniel has been building custom computers for himself and others for over 25 years. His current box was built back in 2008, sporting a Gigabyte mainboard, over-clocked i7 Quad Core engine, 8GB RAM, and an antiquated, over-clocked video card that still gets the job done, running a carefully manicured Win7 OS. Don’t ask where he got the OS. Dan has always had a passion for computers and all things geek. We hope you enjoy his articles.

There are 5 comments

Your email address will not be published. Required fields are marked *