---
title: 'Pi-hole Setup Guide: Block Ads for Your Entire Network'
url: 'http://itlad.uk/blog/pihole-network-adblocking-guide'
markdown: 'http://itlad.uk/blog/pihole-network-adblocking-guide.md'
date: '2026-05-29'
description: 'Complete Pi-hole setup guide — install on Docker or Raspberry Pi, configure your router, add block lists and handle the whitelisting you will actually need.'
taxonomy:
  category:
    - networking
    - homelab
  tag:
    - pi-hole
    - dns
    - 'ad blocking'
    - homelab
    - networking
    - 'raspberry pi'
---

[ Home ](http://itlad.uk/)     [ Blog ](http://itlad.uk/blog)      Pi-hole Setup Guide: Block Ads for Your Entire Network    

# [Pi-hole Setup Guide: Block Ads for Your Entire Network](http://itlad.uk/blog/pihole-network-adblocking-guide)

 By [IT Lad](http://itlad.uk/about) 29 May 2026 

  [pi-hole](http://itlad.uk/blog/tag:pi-hole#body-wrapper) [dns](http://itlad.uk/blog/tag:dns#body-wrapper) [ad blocking](http://itlad.uk/blog/tag:ad%20blocking#body-wrapper) [homelab](http://itlad.uk/blog/tag:homelab#body-wrapper) [networking](http://itlad.uk/blog/tag:networking#body-wrapper) [raspberry pi](http://itlad.uk/blog/tag:raspberry%20pi#body-wrapper)  

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

```yaml
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](https://www.amazon.com/s?k=raspberry%2Bpi%2B4%2B2gb&tag=itlad-21) runs Pi-hole and handles a household DNS load with CPU to spare. Give it a static IP and a [UPS](https://www.amazon.com/s?k=mini%2Bups%2Bpower%2Bbank%2Brouter&tag=itlad-21) 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](http://itlad.uk/affiliate-disclosure).*

 [ Previous Post](http://itlad.uk/blog/best-kvm-switches-multi-monitor) [Next Post ](http://itlad.uk/blog/best-usb-hubs-docks-workstation)

#### Syndicate

 [ Atom 1.0](http://itlad.uk/blog.atom) [ RSS](http://itlad.uk/blog.rss)

---

## Navigation

- Parent: [Blog](http://itlad.uk/blog.md)
- Previous: [Best USB Hubs and Docks for Your Workstation in 2026](http://itlad.uk/blog/best-usb-hubs-docks-workstation.md)
- Next: [Best KVM Switches for Multi-Monitor and Multi-Computer Setups](http://itlad.uk/blog/best-kvm-switches-multi-monitor.md)
