How to Block Ads Network-Wide With Pi-hole on Raspberry Pi

Pi Hole
(Image credit: Tom's Hardware)

While online advertising is a major revenue source that allows your favorite websites, including this one, to make money, sometimes people want to block it for various reasons such as performance or privacy concerns. You could install blocking software on each device you own, but the most efficient way is to create a server using Pi-hole that filters all your web traffic at the local network level.

Pi-hole is a Raspberry Pi based network wide ad blocker. We install the software to a Raspberry Pi running Raspberry Pi OS, run a short installation script and then point our machines to the Raspberry Pi’s IP address for instant ad blocking. We can also -- and we strongly encourage this -- add the sites you use frequently like tomshardware.com to a whitelist so you can help them keep the lights on.

Latest Videos FromTom's Hardware
TOPICS
Les Pounder
Associate Editor

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

  • burritokid
    Nice article. Been using a pi hole connected to my router for ages but wasn't aware of the whitelist domain option, so good catch! 👍
    Reply
  • pixelpusher220
    burritokid said:
    Nice article. Been using a pi hole connected to my router for ages but wasn't aware of the whitelist domain option, so good catch! 👍
    How often do you encounter sites that don't function due to the pi-hole?
    I'd love to do it but with the non-techies in my household, the tech support job is mine...lol
    Reply
  • Buggedsee
    pixelpusher220 said:
    How often do you encounter sites that don't function due to the pi-hole?
    I'd love to do it but with the non-techies in my household, the tech support job is mine...lol
    I've been using pi-hole for about 2 years now and I've never encountered a site not working. The main issues is with my wife browsing Etsy and Instagram and not being able to go to the ad sites (she regularly tells me). Also, sponsored links in Google searches don't work, but that's it from our experience.
    Reply
  • Buggedsee
    Admin said:
    Using Pi-hole, your Raspberry Pi can filter ads before they reach your PCs, phones or tablets.

    How to Blocks Ads Network-Wide With Pi-hole on Raspberry Pi : Read more

    Small comment on your whitelisting... If your site serves the ads the whitelisting will work, but as the ads are NOT served by tomshardware.com whitelisting it does nothing...
    Reply
  • vishnumrao
    pixelpusher220 said:
    How often do you encounter sites that don't function due to the pi-hole?
    I'd love to do it but with the non-techies in my household, the tech support job is mine...lol


    Many times. As an example a redirect from deal websites like slickdeals will not work. I guess these redirects are tracked for hits and sale etc. My wife mostly browses on her phone. She deafeats or rather works around the pihole block by turning off wifi (much to my frustration, :) )
    Reply
  • Kamikaze5110
    Sadly i buyed Rpi zero for using pi-hole just for one reason... Youtube on Smart TV. But unfortunatly you can't block YouTube videos with Pi-hole. This should be mentioned in article.
    Reply
  • pixelpusher220
    Buggedsee said:
    Small comment on your whitelisting... If your site serves the ads the whitelisting will work, but as the ads are NOT served by tomshardware.com whitelisting it does nothing...
    This. I will happily allow ads directly from Toms or whatever site. It's the third party crap that's the problem. I have a very long whitelist built up in NoScript as I've tailored the minimum to get stuff working.
    Reply
  • mordsith
    I think this guide needs an update. I could not use the user "pi" anymore. Apparently, it is a security update in Rasp Pi OS? I searched long and hard and finally found a raspberry pi hole guide that addressed this point - for anyone facing any issues.
    Reply
  • Viking2121
    I've been running PiHole for quite a while, even blocks a ton of ads on the smart TV's, I run it on my media server and secondary on a PC thats on almost all the time.

    NextDNS is pretty good as well but its hosted off site, get 300K queries for free each month, 20 bucks for a year and bunch of block lists you can play around with.
    Reply
  • Bob0220
    mordsith said:
    I think this guide needs an update. I could not use the user "pi" anymore. Apparently, it is a security update in Rasp Pi OS? I searched long and hard and finally found a raspberry pi hole guide that addressed this point - for anyone facing any issues.
    Can you be more specific as to where you found this guide?
    Reply