Notebookcheck Logo

Raspberry Pi: Turn the popular single-board computer into an ad blocker

Raspberry Pi: Turn the popular single-board computer into an ad blocker. Image source: Estefannie Explains It All)
Raspberry Pi: Turn the popular single-board computer into an ad blocker. Image source: Estefannie Explains It All)
The simple project should take all over ten minutes to set-up and turns a Raspberry Pi into your very own ad blocker. There is more to it than just blocking ads though, as it also gives you an oversight of your whole network among other features.

While adverts are not necessarily a bad thing, you may want some control over what content you are shown. Ad blockers are two a penny these days, with some web browsers like Opera even including built-in ones. But what if you would like greater oversight on the ads and trackers that are following your travels through the internet?

Well, if you have a spare Raspberry Pi lying about, then you could put it to use as a Pi-hole client. Pi-hole has been around for a while now, with the Raspberry Pi Blog running a post on it in 2018. All the same, it is a great way to block, and keep track of, traffic on your network.

All you need is a Raspberry Pi and the ability to run a script, the details of which you can find on places like the Raspberry Pi Blog or in a recent Devscover Coding & Raspberry Pi video. In essence, Pi-hole does not block ads in as much as it sends no data to certain domains. So, you will still see the boxes where adverts would normally be, but they should no longer display. Equally, Pi-hole hamstrings trackers, too. Setting-up Pi-hole takes about ten minutes and can be done from your Raspberry Pi itself.

You must also configure your devices to use your Raspberry Pi's IP address as their default DNS name server. While this is borderline impossible on Android 10, setting your router's DNS name server to your Raspberry Pi's IP address seems to resolve any device-specific restrictions. 

There are limits to Pi-hole, though. Sadly, it cannot control YouTube video adverts, primarily because of Google's obfuscation with the domains it uses to serve them before the start of videos. However, Pi-hole serves more than just to block ads. There is also a handy Pi-hole web interface that allows you to monitor ad-blocking data, query logs and a host of other information. Pi-hole is free to use, although the developers ask for a donation the software useful.

Buy CanaKit Raspberry Pi 4 now on Amazon

The Pi-hole web interface. (Image source: Raspberry Pi Foundation via Pi-hole)
The Pi-hole web interface. (Image source: Raspberry Pi Foundation via Pi-hole)
Read all 1 comments / answer
static version load dynamic
Loading Comments
Comment on this article
Please share our article, every link counts!
> Expert Reviews and News on Laptops, Smartphones and Tech Innovations > News > News Archive > Newsarchive 2020 04 > Raspberry Pi: Turn the popular single-board computer into an ad blocker
Alex Alderson, 2020-04- 8 (Update: 2021-09-28)