Stop ads with Pi-hole

Set up your Pi as a pow­er­ful ad-block­ing ac­cess point in min­utes.

Linux Format - - RASPBERRY PI PROTECTION -

There aren’t many projects on the Rasp­berry Pi that can be in­stalled us­ing just one or two lines of code. How­ever, the cre­ators of the Pi-hole project have cre­ated an in­staller that’s so sim­ple to down­load, you can set up your Rasp­berry Pi as an ad blocker in min­utes.

While you may be fa­mil­iar with browser plug­ins such as AdBlock Plus, these are used to block code from web pages that have al­ready loaded. The Pi-hole blocks ad­ver­tis­ing web­sites at a DNS level, so they’re pre­vented from load­ing in the first place. This re­quires no client-side soft­ware and gen­er­ally is a much smoother and eas­ier way to keep your home or of­fice net­work free of an­noy­ing ad­verts.

Open­ing your Pi-hole

In or­der to pro­ceed, you’ll need to install the lat­est ver­sion of Rasp­bian on your Pi. Make sure to run sudo apt-get up­date and sudo apt-get up­grade on your Pi be­fore fol­low­ing the steps in the tu­to­rial. The Pi-hole is com­pat­i­ble with all mod­els of Pi, but if you wish to con­nect it to your router via Eth­er­net (which we rec­om­mend) you’ll need to use ei­ther a Rasp­berry Pi 3 or a Pi Zero/Pi Zero W with a USB OTG Eth­er­net adap­tor.

The term ‘DNS Servers’ is most com­monly used to re­fer to pub­licly ac­ces­si­ble com­put­ers, which con­tain host­names such as www.lin­ux­for­mat.com and their re­lated pub­lic IP ad­dress. This en­ables web­sites to have recog­nis­able names rather than a string of num­bers. Ev­ery in­ter­net-en­abled de­vice you use queries a DNS server each time you try to ac­cess a web­site.

Pi-hole acts as a DNS server, con­nected to your lo­cal net­work. Any re­quests made from de­vices can be routed through the Pi-hole and checked against a con­stantly up­dated list called Grav­ity, which con­tains mil­lions of do­mains that do lit­tle but of­fer ad­ver­tis­ing and spam. If a do­main is listed, it’ll be con­signed to a black hole of in­ter­net ad­ver­tise­ments. In less-po­etic terms, Pi-hole will sim­ply not load the do­main.

For per­mit­ted do­mains, the Pi-hole ac­cesses an up­stream DNS server avail­able on the pub­lic in­ter­net such as OpenDNS, which will then load your page seam­lessly.

Fol­low the steps in the guide ( op­po­site) to set up your Pi-hole. Once this is done you’ll need to con­fig­ure your router or de­vices to use the Pi-hole as their DNS server. See the box­out ‘Down with DNS’ ( be­low) for more help with this.

Ad­min in­ter­face

If the prospect of au­to­mat­i­cally block­ing mil­lions of spammy web­sites isn’t enough to en­tice you, Pi-hole also has a handy ad­min in­ter­face that’s cre­ated au­to­mat­i­cally dur­ing setup.

You can ac­cess it ei­ther at http://pi.hole/ad­min or http://yourPi-hole-ipad­dress/ad­min. The in­ter­face is pro­tected by a pass­word, which is gen­er­ated for you dur­ing setup. You can change this from Ter­mi­nal by run­ning pi­hole -a -p .

Click Query Log in the left-hand side to view all the do­mains that have been ac­cessed by de­vices on your net­work. Choose the Whitelist or Black­list but­ton next to each do­main name to al­low or block them re­spec­tively.

If you want to fine-tune your web fil­ters fur­ther then click the Black­list but­ton on the left-hand side and en­ter a do­main

name to block it au­to­mat­i­cally. We rec­om­mend that you take some time to ex­plore the Set­tings sec­tion to dis­cover all of Pi-hole’s fea­tures.

Is ad block­ing theft?

Eyeo GmbH, the Ger­man com­pany that makes Adblock Plus, has been through no fewer than six court cases by pub­lish­ers, who claim that the block­ing of their on­line ads is il­le­gal, but so far the courts haven’t agreed. In the case of Adblock Plus, web­sites are asked to pay in or­der to fea­ture ac­cept­able ads on a pre-ap­proved whitelist.

Pi-hole, on the other hand, is a project that runs on a not­for-profit ba­sis, re­ly­ing on do­na­tions to stay afloat. This is one of many ways that web­sites can mon­e­tise their con­tent be­sides dis­play­ing ad­verts. If you’re us­ing web­sites that are owned by multi-mil­lion dol­lar cor­po­ra­tions, you also may not lose too much sleep in block­ing their ad­verts be­fore they reach your screen.

The strong­est ar­gu­ment for ad-block­ing soft­ware is that track­ing cook­ies and ad­ver­tise­ments can be used to gather in­for­ma­tion on your brows­ing habits and some­times even install ma­li­cious ‘junkware’ on your de­vices. Most web­sites and apps have both a free and pre­mium ver­sion, so if your con­science is prick­ing you, con­sider sup­port­ing your favourite ser­vices by sub­scrib­ing or mak­ing a do­na­tion.

Get­ting Pi-hole up and run­ning

Dur­ing in­stal­la­tion, the pro­gram will in­form you that the Pi-hole needs a static IP ad­dress to func­tion prop­erly and of­fers to as­sign it­self one us­ing your net­work set­tings. Gen­er­ally speak­ing, even if the de­vice res­tarts any mod­ern router won’t try to as­sign it a new IP. How­ever, to be on the safe side you may pre­fer to con­fig­ure your router to as­sign the same IP to your Pi-hole’s Mac ad­dress, so that none of your de­vices will run into prob­lems.

If your router doesn’t sup­port chang­ing DNS set­tings, then you can con­fig­ure each de­vice man­u­ally to use the

Pi-hole. See the Down with DNS box ( be­lowleft) for more in­for­ma­tion. Bear in mind that some in­ter­net de­vices such as Google’s Chrome­cast me­dia stream­ing de­vice don’t sup­port man­u­ally chang­ing DNS set­tings. You can work around this by ac­cess­ing Set­tings from the Pi-hole’s web ad­min in­ter­face and use Pi-hole’s DHCP server. Make sure to dis­able DHCP on your router if you do this.

If you’re set­ting up the Pi-hole to pro­tect your fam­ily from harm­ful web­sites, re­mem­ber that any­one with ac­cess to a de­vice can also change their own set­tings back to us­ing a Pub­lic DNS. This will en­able them to visit any site with­out be­ing logged by the ser­vice.

Should you find the set­tings are too re­stric­tive, then you can also whitelist cer­tain do­mains by en­ter­ing your ad­min pass­word on blocked pages, or even dis­abling Pi-hole al­to­gether for a cer­tain amount of time – for ex­am­ple just for five min­utes – from the web ad­min in­ter­face.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.