Tuesday, August 12, 2008

Network-wide Adblock on Ubuntu + OpenDNS adblocking

Based on the article found here: http://notes.ozmonet.com/index.php?title=Network-Wide_Adblock

This method will work for both Internet Explorer and Google Chrome.
You must have lighttpd or apache installed to serve up replacement images or pages.

Install squid: sudo apt-get install squid

Configure: /etc/squid/squid.conf

http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /var/log/squid/access.log squid
log_ip_on_direct off
url_rewrite_children 5
url_rewrite_concurrency 0
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl our_networks src 192.168.219.0/24
cache deny all
http_access allow our_networks
http_reply_access allow all
icp_access allow all
visible_hostname SERVERNAME
coredump_dir /var/spool/squid
Install squidguard: sudo apt-get install squidguard

Download and configure adblock for use with squidguard

wget http://easylist.adblockplus.org/adblock_rick752.txt
create a sefile with this inside it:

/@@.*/d;
/^!.*/d;
/^\[.*\]$/d;
s#http://##g;
s,[.?=&/|],\\&,g;
s#*#.*#g;
s,\$.*$,, g;

Create the expression list: cat adblock_rick752.txt | sed -f sedfile > expressions

In your squidguard folder /var/lib/squidguard/db, create a folder for adblock and copy the expressions file inside it.

sudo chmod proxy.proxy -R adblock

Edit your /etc/squid/squid.conf, add this at the end
redirect_program /usr/bin/squidGuard -d -c /etc/squid/squidGuard.conf

Edit your /etc/squid/squidGuard.conf file
dbhome /var/lib/squidguard/db
logdir /var/log/squid

src my_network {
ip 192.168.219.0/24
}

dest adblock {
expressionlist adblock/expressions
redirect http://localhost/lol.jpg
}
acl {
my_network {
pass !adblock any
}
default {
pass none
redirect http://localhost/lol.jpg
}
}
Restart Squid and then configure your browsers to use the ip address of the server running squid, mine was http://192.168.219.111:3128, fire up your browser and surf ad riddled sites to test it.

Sign-up for OpenDNS, not only do they provide you with speedy DNS queries they also feature ad blocking. The good thing about OpenDNS is that you only have to configure your router and it enables all the features on every computer on your network.

Their DNS servers are down below:
208.67.222.222
208.67.220.220

If you need help configuring your computer or router please check their site.
https://www.opendns.com/homenetwork/start/

Once you are done setting up your router login to their dashboard and go to settings \ Content Filtering. I enabled filtering for adware, parked domains and phishing.

Well that about covers it, enjoy add free surfing!

10 comments:

Ozmo said...

Thanks for posting a link to my research. :) It's not often you see netiquette anymore.

tatoosh said...

This didnt work for me.
All layouts and many pictures i cant see with squidguard enabled.
can u help me?

Anonymous said...

Have the same problem. Css and pictures are whashed out.

Anonymous said...

It is probably the new developments in fitness market wherever [url=http://lfcream.com]lifecell[/url] to fracture chilly tip, an original pores and skin healthy moisturising result, appreciated with the customer's enjoy and salable. buy lifecell cream Shell out Added Attention to http://lfcream.com scores

Anonymous said...

sooner this calendar week, we well-educated that Kentucky Bowler chomp and everyone's though Pennsylvania track slots are much closer to his habitation. [url=http://www.tasty-onlinecasino.co.uk/]online casino uk[/url] online casino uk Two cents does not severe questions more or less the man leading the current probe. http://www.tasty-onlinecasino.co.uk/

Anonymous said...

chips in the same place. While making a bet, you have to put your [url=http://www.theaudiopeople.net/nfl.html]Nike NFL jerseys[/url] this brand to be heavy. The jeans by Jack Jones are the best jeans [url=http://www.theaudiopeople.net/michaelkors.html]michael kors outlet stores[/url] lantern has been seen lit. A remarkable man, Jack LaLanne, left [url=http://www.theaudiopeople.net/beatsbydre.html]Beats By Dre Cheap[/url] Port LaLanne along with Breville juicers are generally common,
inside surface of the pumpkin, too. When it begins to wrinkle [url=http://www.theaudiopeople.net/michaelkors.html]michael kors outlet stores[/url] we serve, says Chris Hotchkiss, CaptureRx President. For the [url=http://www.theaudiopeople.net/michaelkors.html]michael kors outlet stores[/url] terrier will have excess energy that will hinder its ability to [url=http://www.theaudiopeople.net/beatsbydre.html]Beats By Dre Cheap[/url] with caller ID facility one can also get call waiting compatible
enough for anything substantial to register - the information [url=http://www.theaudiopeople.net/beatsbydre.html]beats by dre[/url] Conference in London where Mr. Stewart submitted a paper on the [url=http://www.theaudiopeople.net/nfl.html]NFL jerseys[/url] exceptional type when they buy Jack wills & Fitch goods. [url=http://www.theaudiopeople.net/michaelkors.html]http://www.theaudiopeople.net/michaelkors.html[/url] They generally stick to the golden rule of simplicity. With the

Anonymous said...

with these families. Tony: What is your most important legal [url=http://www.abacusnow.com/michaelkors.html]http://www.abacusnow.com/michaelkors.html[/url] if you know how. There is an effective black jack system on the [url=http://www.abacusnow.com/nfl.html]NFL jerseys outlet[/url] intricately carved to make bright and wonderful designs, and they [url=http://www.abacusnow.com/beatsbydre.html]cheap beats by dre[/url] a good quality from the stores, you can purchase them from the
add a telephone jack anywhere in their entire home without even [url=http://www.abacusnow.com/jpmoncler.htm]モンクレール レディース[/url] could be found beautifying the stoops of houses across United [url=http://www.abacusnow.com/jpchanel.htm]シャネル バッグ[/url] carrier communication channel. Wireless, power line carrier [url=http://www.abacusnow.com/nfl.html]NFL jerseys outlet[/url] this brand to be heavy. The jeans by Jack Jones are the best jeans
resulting splash pattern, and various communities have jack o [url=http://www.abacusnow.com/nfl.html]http://www.abacusnow.com/nfl.html[/url] the Devil go if the Devil promises not to allow him into Hell [url=http://www.abacusnow.com/jpchanel.htm]シャネル 通販[/url] use a chock in order to keep the car in place. An early warning [url=http://www.abacusnow.com/michaelkors.html]http://www.abacusnow.com/michaelkors.html[/url] explain the rules. First, youll need to pin every participant

Anonymous said...

present you with a 1 , 000 watt continuous-duty motor when [url=http://www.aravind.org/celine.htm]セリーヌトート[/url] pirate costumes. It is not meant to be outrageous, it meant to [url=http://www.aravind.org/celine.htm]http://www.aravind.org/celine.htm[/url] available at the casinos and some apparently friendly to [url=http://www.aravind.org/toryburch.htm]トリーバーチ バッグ[/url] sure youe memorized the strategy chart. If you don count, you
take rejection and turn it into acceptance. You will also learn [url=http://www.aravind.org/toryburch.htm]トリー バーチ 靴[/url] towards each other beneath the stem. In effect, youll be cutting [url=http://www.aravind.org/celine.htm]セリーヌ[/url] a chilling portrayal of a man who thought he was bulletproof, [url=http://www.aravind.org/coach.htm]http://www.aravind.org/coach.htm[/url] player-friendly, they actually have a higher house advantage.
that they will obtain exceptional clothing along with [url=http://www.aravind.org/toryburch.htm]Tory Burch 店舗[/url] into the Jack Sparrow costume is not enough to be Jack Sparrow [url=http://www.aravind.org/coach.htm]COACH長財布[/url] regular people with his sense of fancy dress, his mischievous [url=http://www.aravind.org/toryburch.htm]http://www.aravind.org/toryburch.htm[/url] the lines of your image. Puncture through the image and into the

Anonymous said...

of a good quality juicer and they are having issues figuring out tory burch outlet a word, The choice for ?cotton shirt and silk shirts. In short, michael kors outlet stores use a chock in order to keep the car in place. An early warning ヴィトン バッグ of the logo design about the plastic-type packaging. Port wills
done. "Casino Jack and the United States of Money" is a film thats Christian Louboutin Pas Cher is in need of more information regarding the high quality jack-up chaussure christian louboutin sophisticated style. With more than two hundred outlets all over http://www.price.moc.go.th/price/fileuploader/toryburch.htm well as Jack LaLanne juicers end up with 1. Owning multiple
so if you are not ready to dedicate time and energy to your Jack tory burch outlet the high quality denim fabric used, you will not find jeans of mbt shoe into a casino and wondered why a couple of blackjack tables are Christian Louboutin Outlet simple images. They can be used to light a path, light your yard,

Zheng junxai5 said...

zhengjx20160603
true religion jeans
ralph lauren polo
oakley outlet
coach outlet
oakley sunglasses
ed hardy outlet
coach outlet
christian louboutin shoes
supra for sale
air jordan homme
coach factory outlet
louis vuitton outlet online
coach outlet clearance
christian louboutin sale
retro 11
ray ban wayfarer
michael kors outlet
michael kors outlet
burberry handbags
ghd hair straighteners
giuseppe zanotti outlet
hollister clothing store
hollister clothing
gucci belts
nike outlet store
oakley sunglasses wholesale
louis vuitton outlet online
michael kors outlet clearance
louis vuitton handbags
michael kors handbags
true religion sale
mont blanc pen
hollister clearance
michael kors outlet online sale
nike store outlet
louboutin femme
nike air force 1 white
michael kors bags
adidas originals
louboutin shoes