Ads suck so why not get rid of them?

Posted by:

|

On:

|

, , ,

You’ll be shocked to know I’m not a marketer, or an ad-person. I’m pretty much the opposite of that. So when I say internet ads suck I really mean that the experience of internet ads suck. From the bright glitzy pop up and banner ads to the more muted static ads, every site has them on virtually every portion of white space.

These ads break up the flow of written or video content, and occasionally require you to click pop-ups to get rid of them (I’m an offender there, I had the newsletter subscription unintentionally configured on my site. It’s disabled now…). A small portion of ads are also outright malicious (this is called malvertising), sending users to scam or phishing sites.

Ads are inevitable though. The internet economy relies on ad revenue to support it’s ‘free’ product (remember, if something is free, you are always the product). Hell, some businesses are even trying a combination of paid and ad-revenue to support their business model.

Also since the internet has supplanted virtually every other form of information dissemination, businesses also have no choice but to advertise there to get to their target audiences. Basically, if you want to use the internet, you simply have to tolerate ads and their intrusive nature.

Blocking ads

Except you don’t, and I haven’t. Ad blockers have existed for decades. These products are usually browser plugins like AdBlock Plus (this is not an endorsement) which prevent or limit ads from being served on the pages you load. Ad blockers work in a variety of ways:

1) They maintain a list of domains that are known to serve ads (i.e. ads are hosted on these websites and linked into webpages) and block these.
2) They block images of specific sizes that are commonly used in advertising.
3) They check for specific scripts in websites and compare those to script patterns commonly used in advertising and, if there’s a match, block those scripts from running on the page.

As a general approach, this is fine if you spend most of your time on a single device. I doubt any of you do. We have laptops, desktops, cellphones and tablets and use them interchangeably. Remembering to install – and keep updated – ad blockers on all your devices is a pain. And then to do that for your whole family…

There is, however, another category of ad blocker that runs at the network level. The most basic (but still highly effective) variety use a list similar to point 1. They apply it to all traffic entering and leaving your network by acting as the DNS server for your network. DNS, remember, is the address book of the internet. So they stop your PC, phone, or tablet from even sending requests to serve ads. No need to install apps on every device.

The one I used to use, Pi-hole, ran on my Raspberry Pi 2 until COVID hit and I moved in with CF. The ad domain list I used at the time blocked her entire Pinterest experience and a allowlisting the Pinterest domain didn’t work. That just wouldn’t do. So given that we were all distracted by other things at the time I simply turned it off and suffered the annoyance of ads.

I found that Pi 2 carefully packed away amongst the tech stuff that made the trip in the container. The discovery prompted me to set up the Pi-hole again. Although I’ve been using Adblock Plus, and now uBlock Origin, on my PC I’ve continued to be served endless ads on other devices. So last week I set it up again – or at least I tried to. It turns out the Pi 2 did not survive the last four use of disuse and being shipped 16,000km.

Setting up the Pi-hole

No use crying over spilt milk, as they say, so I ordered a new Pi 5 which was delivered the morning I’m typing this post. Setting it up as a Pi-hole is relatively straightforward (maybe a 5/10 in terms of difficulty) but it does take a little bit of time:


1) Use the Raspberry Pi Imager to install Raspbian (the operating system) on the microSD card (32gb and larger are recommended, and required if you want a GUI) you’re using with your Pi. I’d suggest setting up the Wi-Fi and SSH access as part of the imaging process.


2) Access your Pi over the network via SSH and Putty, or plug it into a monitor (the Pi 5 needs a micro HDMI cable, make sure you have one), keyboard and mouse and update it to the latest version (the imager doesn’t have the most recent patches) using the command line application.


3) Make sure your Pi has a static IP address set on your router or Wi-Fi network. Setting the static IP address is one of the two more complicated technical steps in this process. If you don’t know how to set a static IP address, simply search for the model of your Wi-Fi router and ‘how to set a static IP address’ and follow the instructions. Or you could plug a prompt like this into ChatGPT: “How do I set a static IP address on my router for a device on my home network? My router is an xyz model.”


4) After updates are complete and the Pi has rebooted, install Pi-hole. Most of us will be fine with using the one step install, but if you want to nerd out, go right ahead and clone the repos. Follow the install instructions the installer gives you – the defaults are all perfectly fine. You should most definitely set up the web interface for management. Be sure to record the auto-generated password that’s shown during the setup process. You can change it later in Raspbian, but it’s a pain.


5) Set your router’s LAN DNS address to the IP address of your Pi. You’ll know the IP address because you set it in step 3. There are some instructions on how to set the DNS on your router here. Again, if you’re struggling, ask ChatGPT something like this: “I want to set the LAN DNS to insert IP address of Pi-hole here on my insert router model here. What are the detailed steps for me to do that?”


6) Access your Pi-hole dashboard via a browser on any device. In the address bar of the browser, go to http//:insert your IP address here/admin and plug in the password you recorded in step 4. If everything is working as expected you’ll see a number of active clients on the total queries like the below. It’ll take some time for that list to build up.


7) I’d suggest installing an additional ad list alongside the default one. Go to Adlists on the left, and paste the link to your preferred ad list (I use this one). Once that’s saved, go to Tools in the left menu, click on Update Gravity, and click the update button.

Conclusion

There you go, your Pi-hole should now be firing on all cylinders and blocking everything from ads to malvertising to those pesky telemetry requests various devices and applications send. After running the Pi-hole for nearly three hours, almost a full third of DNS queries on our network have been blocked.

It’s not a perfect solution, much like browser-based solutions. In fact, if you want a comprehensive blocking experience on your main device/s, I’d suggest installing uBlock Origin on your browsers on those machines. Remember though, ad blockers could well prevent websites from working correctly so if your family complains that something isn’t working as expected, I’d first look at uBlock and then at the Pi-hole. The trade-off for this admin? You’ll be seeing a lot less intrusive advertising on your internet meanders.


Discover more from iansharland.com

Subscribe to get the latest posts sent to your email.