Maximum PC

Send online ads down a Pi-Hole

-

LINUX Some sort of Linux computer. A Pi Zero is a perfect choice at

just $10.

AN ACTUAL HONEST-TO- GOODNESS letter (well, an email) from a reader arrived in the busy MaximumPC newsroom recently. Once we’d read it, we were even more shocked to discover it was filled with sensible questions and ideas, rather than the usual offer of manhood-enhancing medication. So thanks to Shawn, without whom we might have written about something completely different this month.

Shawn’s suggestion relates to Internet of things (IoT) devices, specifical­ly smart lightbulbs, which he wants to connect to a segmented guest network to deny them full access to the wider internet while keeping their useful functional­ity. He found he could do this with his guest network, but the presence of a Pi-Hole network ad blocker put a spanner in the works. We’ll get to the segmented network part in a later issue, once we’ve worked out how to do it, but first here’s how to set up a Pi-Hole DNS server and never see an online advert again. Except for the ones you whitelist, of course, because ad revenues write writers’ checks.

So, the moral of this story is this: please email us. It’s not that we’re lonely (honest!), it’s more that your ideas might just make it into the magazine. –IAN EVENDEN

1 PREPARATIO­N

A Pi-Hole is a DNS sinkhole that’s used by your router as its domain name server. It strips out traffic from known advertisin­g sites and makes it disappear. As it runs at the network level, it can strip advertisin­g from places such as smart TV UIs and cellphones, as well as the more common website banners and takeovers.

>> This has the benefit of not showing you annoying ads, which also speeds up the loading times of websites. The downside is that ad impression­s pay for the web as we know it, meaning that the more we block ads, the less free content there’s likely to be in the future. It’s a fine balancing act.

>> Pi-Hole is an open-source project that runs on Linux—the officially supported OSes are Raspberry Pi OS, Debian 9 onward, Ubuntu from 16.X, Fedora 32 or later, and CentOS 7 onward. As you’re going to want it running all the time, it’s recommende­d that you run it on a low-power device, such as a single-board computer. It will run in a Docker container, or a VM as long as you can give it its own static IP address. It will happily share a machine with a Plex server, so you can kill two birds with one stone. You can even run it on a Raspberry Pi Zero W, but we can’t find ours, so we’ve broken out the Pi 4 instead.

>> And although it is possible to run a Pi-Hole over Wi-Fi, it’s better to run it over Ethernet, as it might be handling a lot

of traffic. If you want to run it on a Pi Zero, you might want to look into a USB to Ethernet adapter. However you connect, you’re going to need to give it a static IP address on whatever you use to dish those out, most likely a DHCP server running on your router.

2 OS INSTALLATI­ON

The Pi-Hole runs on the standard Raspberry Pi OS, so if you need to, fire up the Raspberry Pi Imager and prepare a Micro SD card [ Image A]. The minimum you need for the regular Raspberry Pi OS is 8GB, or 4GB if you fancy living in a Terminal with Pi OS Lite. With the former, you can leave it running the graphical desktop and take control using VNC.

3 SETUP

Once you’ve booted your Pi, let it do its usual thing of downloadin­g updates. You can tinker with the OS’s appearance while it does this—our personal preference is to move the menu bar to the bottom, possibly because more than 25 years of using Windows has done something to our brains. Once you’ve done the inevitable restart, it’s time to install the Pi-Hole.

 ?? ?? A
A

Newspapers in English

Newspapers from United States