Installing Pi-hole for network wide ad blocking

The SD card on one of my Pi Zero Ws died and now I have to set it back up again on a new one. It was running Pi-hole along with a few other stuff. For those that don’t know; Pi-hole is a open source, network-wide ad blocking solution that works by blocking DNS queries. Read more about it here.

First I setup a static IP for my Pi Zero W in the router’s DHCP.

SSH to the device and install Pi-hole. Installation is guided and interactive. It is the easiest way to install.

curl -sSL | bash

Once its successfully installed, modify DNS on your router to use the reserved IP of the Pi.

Now all the DNS queries should go to the Pi.
It also provides a nice web ui that allows us to monitor the blocked queries.

I used a simple Ansible role to set this up without the web UI as the Zero W does not have a lot of resources.




I work with cloud, containers, linux

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

XSS Vulnerability Part 1

14 Sept AMA Transcript w Megalodon

Advent of Cyber 2 [2020] Walkthrough part-1

How to Control Spam

Privacy Policy

Day 4: Become a self-taught blockchain developer with zero knowledge in 365 days

Avoid Becoming the Victim of Post-Disaster Fraud

Cyber Security and Work From Home: The New Normal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


I work with cloud, containers, linux

More from Medium

Make a Clone of Customized Raspbian OS

Linux cheat sheet: from simple commands to advanced-but-easy tricks

【Deepin Sharing】How to use GSettings

Raspberry pi