Gallery project

๐Ÿ›ก๏ธ Pi-hole + Tailscale DNS

Tailnet-wide ad blocking. Your phone gets blocked DNS even on cellular. Combined with exit nodes, your traffic is ad-free everywhere.

Gallery IoT Intermediate Half-day Prereqs: M3

Why this project

Browser ad blockers only protect browsers. Mobile apps, smart-home telemetry, and shady tracking domains run unfiltered. A network-level DNS sinkhole like Pi-hole catches all of it. The Tailscale twist: by configuring Pi-hole as your tailnet's resolver, every device on your tailnet โ€” even your phone on cellular โ€” uses it.

Who this helps

What you get

DEVICES (any network) TAILNET DNS RESOLUTION ๐Ÿ“ฑ phoneon cellular ๐Ÿ’ป laptop ๐Ÿก IoT / TV ๐Ÿ›ก๏ธ Pi-hole on tailnetadmin โ†’ DNS โ†’ custom nameserver = pi-hole's tailnet IP โœ“ allowed โ†’ upstreamforwarded to 1.1.1.1 / 8.8.8.8 โ›” blocked โ†’ 0.0.0.0tracker / ad / known malware

Every tailnet device โ€” phone on cellular included โ€” sends DNS to Pi-hole. Match against blocklist โ†’ 0.0.0.0 (silently dropped). Otherwise โ†’ upstream resolver. Network-level ad blocking, everywhere you go.

Prerequisites

Steps

Install Pi-hole ~10 min

Easiest: Docker compose:

services:
  pihole:
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8080:80/tcp"
    environment:
      TZ: 'America/Los_Angeles'
      WEBPASSWORD: 'set-a-password-here'
    volumes:
      - ./etc-pihole:/etc/pihole
      - ./etc-dnsmasq.d:/etc/dnsmasq.d
    restart: unless-stopped

Verify: curl http://<pi-hole-host>:8080 shows the admin UI.

Make sure the host is on the tailnet ~2 min

Find the Pi's tailnet IP: tailscale ip -4. Save that.

Configure Tailscale to use Pi-hole ~3 min

  1. Admin console โ†’ DNS โ†’ Nameservers โ†’ Custom nameservers โ†’ Add.
  2. Enter your Pi-hole's tailnet IP.
  3. Enable "Override local DNS". This forces all tailnet devices to use this resolver.
  4. Save.

Verify ad blocking ~3 min

From any tailnet device:

nslookup doubleclick.net
# Should return 0.0.0.0 (blocked) instead of a real IP

Visit a content site that normally has lots of ads. Most banners are gone.

Phones on cellular ~1 min

Your phone, on cellular, still uses Pi-hole โ€” because the tailnet's DNS configuration applies to every connected device. Ads are blocked on Instagram, YouTube, every app.

Verify

Common issues

Variations

Caveats

Where this leads