Friday, 13 September 2019

If you haven't heard of the Pi-Hole it is a great tool. It is a DNS server (actually it is more than just that) which can run on a Raspberry Pi that simply blocks out adverts while you're browsing the web. While some Ad-Blockers are browser add-ons this takes a different view, it simply stops the adverts from being loaded before they reach the browser.

Effectively setup the Pi-Hole on a Raspberry Pi then update the DNS settings on your Router so that it uses the Pi-Hole and then all devices connected won't see an advert as every time one is attempted to be loaded the Pi-Hole handles the request. It's great.

But what about your laptop? They're meant to be taken with you, so you'll see adverts when your elsewhere.

Install Docker For Windows. I'm not going to detail all of the steps but the Pi-Hole image requires a Linux container (which is handy given the size of Windows containers). Downloading Docker For Windows requires you to create an account (or login) to Docker.

Ensure that Windows containers and not the default, as to set it up we need to embrace Linux.

Download the Pi-Hole image, to do this open PowerShell and run:Docker Pull pihole/pihole

This will take a couple of minutes (not long) to download the Linux container with the Pi-Hole installed.

Create the following directories on your machine:

C:\pihole\

C:\pihole\pihole

C:\pihole\dnsmasq.d

These are locations that the PiHole image will use to store files that will remain (for when upgrading the container to a newer version of PiHole)

I strongly suggest that you use a strong password, as the web interface to the Pi-Hole will require this to login. You can now browse to LocalHost in a browser and you should see a page showing that the PiHole is running, although no requests are currently going to it (so it won't actually be blocking any adverts).

Docker may ask you for an account to share files on your C drive (or wherever you placed them).

Finally, you need to update the DNS setting for your connection to block adverts. To do this

In File Explorer right click on Network and select Properties

Click on your connection

Select Properties in the dialog

Then select TCP/IPv4 and then properties

Then set the DNS settings to be 192.168.0.1 (as the Pi-Hole container is running on your laptop).

Click Ok to dismiss the dialog boxes and you're done.

To see the interface for PiHole type localhost into a browser. Click on Login and enter the password (in my example vRz0n36IWF but please change it!).