Pi-hole in 15 Minutes: Say Goodbye to Ads on Your Entire Network
So you want ads gone. Not “gone from Chrome,” gone-gone: off your phone, your TV, your smart fridge that definitely does not need to be smart. Enter Pi-hole: a DNS sinkhole that swallows ad requests before they even leave your network. All it needs is a spare Raspberry Pi and about 15 minutes of your evening.
What you need
- A Raspberry Pi (3B+ or newer, though honestly almost anything works, Pi-hole is not exactly demanding)
- Raspberry Pi OS Lite already flashed and booted, with SSH enabled
- A static IP for the Pi, or a DHCP reservation from your router
The fast way: one Docker command
If you already have Docker running on the Pi (and if you have been following this blog, you probably do), skip the traditional installer entirely and run Pi-hole as a container. It is cleaner, easier to update, and does not leave random files scattered across your filesystem.
docker run -d --name pihole
-p 53:53/tcp -p 53:53/udp
-p 80:80
-e TZ="Europe/Madrid"
-v pihole_etc:/etc/pihole
-v pihole_dnsmasq:/etc/dnsmasq.d
--restart unless-stopped
pihole/pihole:latestSwap the timezone for your own, wait for the container to finish starting, and check the logs to grab your auto-generated admin password:
docker logs pihole | grep randomPoint your network at it
This is the step everyone forgets and then wonders why nothing changed. Installing Pi-hole does nothing on its own: your devices need to actually use it as their DNS server. The clean way to do this for your whole house is in your router’s settings: find the DHCP or DNS section and set the primary DNS server to your Pi’s static IP. Every device that connects from now on will automatically route its DNS through Pi-hole, no per-device setup required.
No access to your router’s DNS settings? You can still set it manually per device. It is just more tedious, which is exactly why the router-wide approach is worth the extra two minutes.
Was it worth it?
Open the admin dashboard at http://your-pi-ip/admin and watch the query log fill up. Within an hour you will see exactly how many ad and tracker requests your devices were making in the background, usually a genuinely uncomfortable number. Fifteen minutes of setup for that kind of visibility is a pretty good trade.
When ads still get through
- An app or device ignores your router’s DNS entirely: some apps (and most smart TVs) hardcode Google’s or Cloudflare’s DNS and skip your router’s setting completely. The only real fix is blocking outbound DNS on ports 53/853 at the router level for everything except the Pi itself, which forces even the stubborn devices through Pi-hole.
- YouTube ads specifically: Pi-hole blocks a lot, but YouTube serves its ads from the same domains as the actual video content on purpose, precisely to dodge DNS-level blockers like this one. A browser extension is still the more effective tool for that specific case.
- The dashboard shows 0 queries after setup: your devices are still using the old DNS server, not Pi-hole. Double check the DHCP/DNS setting actually saved in the router, and that devices have renewed their DHCP lease (a quick reboot of the device does this).
Add a second Pi-hole for redundancy
One downside worth knowing upfront: if that single Pi goes offline, your entire network loses DNS resolution, not just ad-blocking, which means no internet at all until it’s back up. Once you’re comfortable with the basic setup, run a second Pi-hole instance (even a cheap Pi Zero works fine for this) and set it as the secondary DNS server in your router. Keep both lists in sync with Pi-hole’s built-in Gravity sync feature or the community-maintained Orbital Sync tool, so blocklists don’t drift apart between the two.
Related reading
- Running this on a fresh Pi? DietPi will make it lighter first
- Once it’s up, secure SSH access to it
Recommended gear
If you’re setting this up from scratch, here’s what I’d get:
- Raspberry Pi 4 Starter Kit, board, case and power supply in one box
- SanDisk Ultra 64GB microSD card, plenty of room for Pi-hole and whatever you run alongside it
As an Amazon Associate I earn from qualifying purchases, these are affiliate links, at no extra cost to you.


