Free AD Blocking

Probably old news to most readers by now, but still deserving of a quick write-up.  

PI-Hole is a free (donation-ware) software that was initially designed to run on Raspberry Pi hardware.  The popularity of this software and use case meant there was enough demand for the product, that it was also developed for Linux and container environments.  Pi-Hole is a local DNS (and optionally a DHCP) server to put on the network that will compare all DNS lookups to a publicly maintained list of AD servers.  When browsing the web or even YouTube, many of the ads will be replaced with a blank box.  

Think of like this...a user goes to a webpage, that computer does a DNS look up, and returns the IP, then the computer displays that webpage.  On that webpage there are calls to other internet servers that host the ads to be displayed, which also require a DNS query.  If a PI-Hole is acting as the DNS server, and that internet ad server is on it's list, instead the users' computer getting the IP information back, it gets a "I can't find this server" response.

Why run a DNS filter?  Well ads can be very annoying so there is that.  Also a sizeable chunk of malware comes through "side-jacking" or "ad-jacking"; where the ads being sent to us actually contains malicious code.  Then bandwidth, simply not having to download the ads can yield savings on bandwidth.

I don't have any Raspberry Pi hardware, and didn't want to invest in that eco-system.  So I first tried using a Windows10 VM running Docker for Windows.  I didn't have any luck, something to do networking.

I then installed it as an application on  Ubuntu VM, using this YouTube Video from "Craft Computing" I ignored all of the recursive stuff in favor of the more basic setup.

Installation Steps:

Install Ubuntu Server 20.04 (https://ubuntu.com/download/server), my VM is only 1vCPU, 4gb RAM, and 20gb disk

Install Pi-Hole - sudo curl -sSL https://install.pi-hole.net | bash

Set the Web Admin Password - pihole -a -p [password]

For my home-lab, and maybe some of you also already have a local DNS server and would rather not migrate to only a PI-Hole DNS server.  Not a problem just setup a "Conditional Forwarder".  Under Settings-> DNS--> Conditional Forwarder:

Local Network = your network address IE: 192.168.100.0/24

IP address of your DHCP server (router) = your DNS server (yes it says DHCP server and router...)

Local domain name = your.domain.local 


After two months of usage, I have almost no issues to speak of.  Once in a while when doing a Google search, sometime the the first result is shopping AD for that very same item, which maybe what one wants, well it is blocked.   Not a big deal.  I have never had to actually log back into the PI-hole for restarting system or changing settings. It doesn't catch all ads, but the basic settings catch a large chunk.  Ad servers after are another "whack-a-mole" game. 


No comments:

Post a Comment