Alright so there’s a ton of addons for firefox that will let you skip all the ad’s on most sites out there, but let’s say you want to do that in all your browsers! Here’s a great roll your own way of doing it with a few free software install’s on your own pc that will block most any ad’s as well as display whatever you want it to in there places!

Here’s some examples.

Facebook:

Hulu Desktop:

Myspace:

Information Weekly:

And all of this is done before a request is sent out so they never have to know!

What’s going on is I’ve edited my HOSTS file and have a local web server to serve up the error pages.

Really it’s simple. I promise! The hardest part is designing the error page’s html :) (and I’ll include mine as well below)

So first off you need to edit your HOSTS file. This is like your pre DNS lookup so if you have sites you frequent often and would like them to load slightly faster, add them to your hosts file and it will save a request to your DNS Server (usually given by your ISP however I recommend OpenDNS or google’s new DNS which seems pretty fast!)

The program I use to edit my HOSTS file is called Hostman and it’s a great little app that runs at startup and will let you know if there’s updates to the built in list’s that they offer. You of course can add your own sources to it if you so choose however they do a pretty good job and are updated often. Along with that you can use the built in http server to report the IP of the site’s being blocked however I wanted a better error page so I installed my own http server using NGINX locally as it uses very little resources and works a treat!

So you’ve got Hostman installed, selected the blocklists that you want (and or added your own sources like bluetack or whatever) and have updated your HOSTS file. Great! Now let’s get to NGINX’s configuration!

Download and extract the NGINX file’s to your root drive (ie C:/) so you have a folder C:/nginx inside there you’ll find a folder called conf and of course that’s where the configuration file’s are located. Open C:/nginx/conf/nginx.conf with your favorite editor (I love Notepad ++) and on line 48 you’ll see something like this:

[codesyntax lang="text" lines_start="48" highlight_lines=""]

error_page  404              /404.html;
location = /404.html {
root   html;

[/codesyntax]

This will tell you the directory for your custom error page to be displayed everytime an ad is blocked. Mine looks like this:

[codesyntax lang="html4strict" highlight_lines=""]

<html>
<head>
<title>Room 404</title>
<style>
body { font-family: monospace, Arial, sans-serif, Tahoma, Verdana,; }
</style>
</head>
<body bgcolor="black" text="white">
<table width="100%" height="100%">
<tr>
<td align="center" valign="middle">
Room <font color="#FF0000">404</font><br/>
Dan's Blocking Ad's<br/>
Sorry.. Kinda.
</td>
</tr>
</table>
</body>
</html>

[/codesyntax]

This will center the text both horizontally and verticly. and display it on a black background with white text (unless otherwise noted like my red text)

You of course can add images, or whatever else you might find interesting, and it will be displayed. I like this because it’s fast and light so there’s no delay displaying it on the webpage.

Once you’ve added your changes (if you made any) you need to start NGINX and that’s just a quick press of the Windows button, type in cmd and simply change directory’s to the nginx folder

[codesyntax lang="text" highlight_lines=""]

cd C:/nginx

[/codesyntax]

then starting the NGINX Server.

[codesyntax lang="text" highlight_lines=""]

C:/nginx> start nginx

[/codesyntax]

You’ll see a window open ever so briefly and then dissapeer you should now be able to go into your web browser and go to http://localhost and be shown your homepage running on NGINX locally, try http://localhost/error and you should see your error page pop on screen. Viola! Your http server is working properly!

Now the nice thing about this setup is it works system wide, so ANYTHING making a query over the internet is subject to the blocking power of this setup so if you have a program that’s ad supported and it no longer works this might be the cause, however I believe even that would be a very rare occurrence.

I Hope this setup helps you keep your speed and privacy up this holiday season and Merry Christmas to you all! (You’ll also note that I don’t have any ad’s on my sites, feel free to thank me in the comment’s if you appreciate this!)