Mohammed Mudassir Uddin

BlogFebruary 2026homelabnetworking

Blocking ads on every device from a Raspberry Pi Zero 2 W

Pi-hole filters ads at the DNS level at home, and Tailscale carries the same filter to my phone when I am out. About two hours of setup.

A weekend project from February. I got tired of ads following me from device to device, so I set up a Raspberry Pi Zero 2 W with Pi-hole and Tailscale.

How it works

Pi-hole sits on the home network as the DNS server and refuses to resolve ad and tracking domains, so those requests never leave the house. Tailscale builds an encrypted network between my devices. When I am away, my phone still uses the Pi as its DNS server through the tunnel, so the same filter applies on mobile data.

Phone, laptop Away from home mobile data Tailscale tunnel Pi-hole Raspberry Pi Zero 2 W Normal sites resolve Ad and tracker domains never resolve Phone, laptop at home: direct away: Tailscale Pi-hole Raspberry Pi Zero 2 W Normal sites resolve Ads, trackers never resolve
One filter, every device. At home the devices ask the Pi directly; away from home the same query goes through the Tailscale tunnel.

Setup

Flash the OS onto a microSD card, SSH in, install Pi-hole, give the Pi a static IP, point the network's DNS at it, install Tailscale, and join each device. It took about two hours, most of it waiting for installs.

Two things I did not expect. Pages load faster without the tracking scripts, and my phone's battery lasts longer because it is not fetching content I never asked for.

The general point: filtering at DNS covers most apps on every device at once, which no browser extension can do.