Softwareintermediate

Block Ads on Every Device: A Raspberry Pi DNS Filter (Pi-hole)

One $30 board filters ads and trackers for your entire home network - phones, TVs, and smart gadgets included, no software installed on any of them.

By Folk Technica·July 16, 2026·CC BY-SA 4.0
Close-up of a green printed circuit board
Time
1 evening (2 hours)
Total cost
$35–$60
Difficulty
intermediate
Easier if you've finished a build or two before.

Every ad blocker you’ve used protects one browser on one device. A DNS filter protects the whole house: when any device asks “where is tracker.example.com?”, the Pi answers “nowhere,” and the request dies before a single byte of ad loads. Smart TVs, phone apps, game consoles - devices that can’t run ad blockers - all get covered at once. This is the classic first self-hosting project, and it earns its keep every day.

Step 1: Flash the Pi

Using Raspberry Pi Imager, flash Raspberry Pi OS Lite (64-bit) - no desktop needed. In the Imager’s settings gear: set a hostname like pihole, enable SSH, and set a username and strong password. Boot the Pi connected to your router by ethernet.

Step 2: SSH in and update

From your computer’s terminal:

Terminal window
sudo apt update && sudo apt full-upgrade -y

If pihole.local doesn’t resolve, find the Pi’s IP in your router’s device list and SSH to that instead.

Step 3: Give the Pi a fixed address

A DNS server that changes address breaks the network, so reserve the Pi’s IP. The clean way is in your router’s settings: find “DHCP reservation” or “static lease” and pin the Pi’s current IP to its MAC address. Note that IP - you’ll need it twice more.

Step 4: Install Pi-hole

Terminal window
curl -sSL https://install.pi-hole.net | bash

The installer walks you through choices; the defaults are all sensible. Accept the recommended blocklist, keep the admin web interface, and write down the admin password it prints at the end (or set your own after with pihole setpassword).

Step 5: Point your network at it

In your router’s DHCP/LAN settings, change the DNS server to the Pi’s IP address. Every device gets the filter automatically at its next lease renewal - reboot your phone’s Wi-Fi to see it immediately. If your router won’t let you change DNS (some ISP boxes lock it), set DNS manually on your most-used devices instead.

Step 6: Verify it’s working

Open http://<pi-ip>/admin and watch the query log while you browse on your phone. Blocked queries show up in red. A typical household sees 15–30% of all DNS traffic blocked - that’s the ad-tech layer you’ve been carrying. If a legitimate site breaks, the log shows exactly which domain to whitelist, one click.

Step 7: Maintenance (there barely is any)

Pi-hole updates its blocklists weekly on its own. Every month or two, SSH in and run:

Terminal window
sudo apt update && sudo apt full-upgrade -y
pihole -up

That’s the whole chore list. If the Pi ever dies, the network keeps working the moment you set the router’s DNS back - no lock-in, no subscription, no company between you and your own traffic.

Where to go next

  • Add Unbound so the Pi resolves DNS itself instead of asking Google or Cloudflare
  • Run a second Pi-hole on another cheap board for redundancy
  • Point your travel laptop at home via WireGuard and carry the filter with you

Build this next

Build something from this?

The Folk Technica newsletter shares new guides, field tests, and reader builds.

The Folk Technica newsletter

One email when a new guide or article goes up. No noise, easy to leave.

Powered bySubstack