Pi-hole intercepts DNS queries from every device on your network and blocks requests to ad-serving and tracking domains. Your TV, phone, laptop and smart speaker all benefit without any app installs.

Install on Docker

version: "3"
services:
  pihole:
    image: pihole/pihole:latest
    container_name: pihole
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
    environment:
      TZ: 'Europe/London'
      WEBPASSWORD: 'changeme'
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    restart: unless-stopped

Run docker compose up -d. Access the admin panel at http://your-server-ip/admin.

Point Your Router at Pi-hole

Log into your router. Find the DHCP settings and set the Primary DNS to your Pi-hole's IP address. Leave Secondary DNS blank — if you set Google as a fallback, blocked domains will resolve through Google when Pi-hole is unreachable.

Block Lists Worth Using

In Pi-hole, go to Adlists and add these URLs:

https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://big.oisd.nl
https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/multi.txt

After adding, run Tools > Update Gravity to pull the lists. The combined count lands around 1.5–2 million blocked domains.

Whitelisting You'll Actually Need

Some services break when Pi-hole blocks their telemetry endpoints. Common things to whitelist:

  • s.youtube.com — YouTube history tracking; blocks break certain video features
  • clients1.google.com — Chrome update checks
  • *amazon.com patterns — shopping cart features on some pages

Pi-hole logs every query, so blocked services are easy to identify: check the query log, find the blocked domain, whitelist if needed.

Upstream DNS

Under Settings > DNS, choose your upstream resolver. Options:

  • Cloudflare 1.1.1.1 — fast, privacy-focused
  • Quad9 9.9.9.9 — blocks malware domains upstream, extra layer
  • Your ISP DNS — usually slowest and least private
  • Unbound (self-hosted) — resolves directly from root servers, no upstream dependency

I run Unbound in a second Docker container alongside Pi-hole and point Pi-hole at it.

Hardware

A Raspberry Pi 4 2GB runs Pi-hole and handles a household DNS load with CPU to spare. Give it a static IP and a UPS so DNS stays up when the power flickers.


As an Amazon Associate, IT Lad earns from qualifying purchases made through links on this page. Read the full affiliate disclosure.

Previous Post Next Post