top of page

Pi-hole Ad and Malware Blocker Setup

Updated: Jul 12, 2023


Pi-hole provides numerous benefits as a network-wide ad blocker and privacy tool. It eliminates annoying ads and pop-ups across all devices, resulting in a cleaner and more streamlined browsing experience.

By blocking ad-related domains, Pi-hole accelerates webpage loading times, saving bandwidth and reducing data consumption.

It also enhances online security by blocking access to malicious domains and preventing tracking and data collection by advertisers.

Overall, Pi-hole offers an effective and convenient solution to improve browsing speed, reduce data usage, bolster privacy, and enhance online security and this is a guide on how to setup a pi-hole.


Using EtherApe, I'm going to demonstrate the effectiveness of Pi-hole on a well established bastion of truth and a British institution (cough) and particularly high in Adverts, the Dailymail.

Before the Pi-hole is enabled there's numerous and sustained....

Video pop-ups

Header Ads

Ads on both sides of the news articles

The network noise is... outrageous, both in the number of connections to Ad-sites and the amount of traffic, represented by the heat map.

After the Pi-hole is enabled:

Video pop-ups - gone

Header Ad - gone

Ads on both sides of the news articles - gone

EtherApe is showing a much calmer heat map with farless outbound connections.


The following equipment is required, mines from Amazon.

Raspberry Pi 4 Model B - £97.99

SanDisk 128Gb Extreme microSDXC - $16.99

Raspberry Pi 4 USB-C Power Supply - £11.99

Total £126.17

Raspberry Pi Installation

Raspberry Pi makes downloading and burning the image to SSD easy, needing only the Imager executable.

Download and install from, the wizard will guide you through the burning process.

Run the Imager and select Operating System.

Select 'Raspberry Pi OS (64-bit)'.

Insert the microSSD into the PC and select Storage and then choose the correct storage.

Click on the cog:

Set credentials, used to manage the pi-hole.

Enable SSH


Click on Write and Yes to the warning message.

The writing process takes a while, its exhausting work, go and top up with a coffee.

Click continue.

If the Format Disk message appears select Canel.

Remove the microSD card from the PC and insert it into the Raspberry Pi device.

Attach the power and ethernet cables, it will power on automatically.

Pi-hole installation

There are a couple of options for the initial configuration, including connecting a monitor, keyboard and mouse.

I've opted for interrogating DHCP for the IP address of the pi-hole, then reserving.

Putty to the to the IP address.

Type admin and the password set earlier.

The first item on the itinerary is installing the latest patches for Raspberry Pi :

sudo apt-get update

sudo apt-get upgrade

I'm stuck behind a firewall and need to point the pi-hole to an internal timesource.

Configure NTP.

sudo nano /etc/systemd/timesyncd.conf


To save changes.

Ctrl + o (output to file)

Ctrl + x (exit file)

sudo timedatectl set-ntp true

sudo reboot

Log back on via Putty

Installing Pi-hole is one command, followed by a wizard.

Click Ok to start the Pi-hole configuration.

Read and then click Ok.


Yes to set the current IP address assigned.

Ignore, the IP has been reserved in DHCP.

Select the preferred DNS server or add custom DNS entries.

You may wish to consider doubling up on the DNS filtering with the following free services.

OpenDNS provides Family Sheild for blocking adult content:



Cloudflare provides for Families with the following 2 options

Malware Blocking Only:



Malware and Adult Content



Yes to install the default block list.

Yes to install the Admin Web Interface.

Yes to install the pre-requisites.

Yes to enable logging.

Of course, I want to see everything.

Make a note of the Web Admin password and Ok.

The Web Admin password will be updated to something more complex later.

Pi-hole Configuration

Open a browser and enter the IP of the Raspberry Pi, enter the Web Admin password.

Clearly, the most important issue to resolve is the interface, go to the Web Interface in Tools and set the Start Trek theme.

Pi-hole block lists are extensible, consider adding the following adlists.

Don't feel it necessary to add all the lists at once, one at a time and test, some lists may be too restrictive and you'll be forever whitelisting.

Adaway Default Blocklist: Blocking ads and known tracking domains.


OISD: Blocks most Ad, Malware, Porn etc.


EasyList: A popular list that blocks various types of ads.


EasyPrivacy: A list that focuses on blocking privacy-invading trackers.


MVPS: Blocks ads, banners, and known malicious sites


AD Guard DNS Filter: A DNS filter list by AdGuard that blocks ads and trackers.


Chad Mayfield: Porn Filter

  • blocklists/master/lists/pi_blocklist_porn_all.list

Click on ADLists and add the URL's.

Pi-hole won't automatically block the additional lists, they require processing.

Click on Tools and then Update Gravity and Update.

Gravity will require monthly checks as the online lists are amended.

Updating the Web Admin Password to something a little more complex via Putty. Login with admin and the initial password set in Imager, then type the following.

pihole -a -p


Updating Raspberry Pi and Pi-Hole is essential for security and stability. Regular updates patch vulnerabilities, protecting against cyber threats. They improve system performance and fix bugs.

Every month run the following commands by logging in via Putty and the admin account.

Update Raspberry Pi OS

apt-get update

apt-get upgrade

Update Pi-hole

pihole -up

Update Gravity

pihole -g

Update the Client's DNS Settings

Home User

For home users, DNS, the bit that resolves domain names to IP addresses is handled by the router, either BT, Virgin or Sky etc. Due to the different types of router and potential configurations I'm unable to provide clear and concise guidance. The router's DNS settings need updating to that of the IP of the pi-hole.

My Setup

Meh what can I say, it flips between 2 configurations depending on the cost of energy, my preferred setup is definetly off the cards at this moment.

Current config, a pair of Pi-holes act as DNS proxies, with forwarders from the Domain Controllers (DC's). All client resolution is via the DC's.

Or my preferred setup. The clients point their DNS to a pair of Pi-holes, these pass any queries on to the DC's and finally proxy out via a pair of synology NAS's. The benefit of this config, the Pi-holes log the clients hostnames. The downside is the cost of running the hardware.

Thanks for your time and support by reading this blog. If you found it useful, please share.

30 views0 comments



bottom of page