🛠 Serveur de blocage de pub réseau avec Pi-hole

Raspberry Pi Zero 2 W (2021) — Board Sheet · intermediaire · Schéma : IMG-zero-2w-intermediaire-3-pihole-blocage-pub.svg — Zero 2 W en rôle de DNS entre les appareils de la maison et la box, bannières publicitaires barrées, tableau de bord web.

Objectives

Deploy a real network service on the Zero 2 W: Pi-hole, a DNS server that filters advertising and tracking domains for the entire household. The official prerequisites (512 MB of RAM, Raspberry Pi OS) match the Zero 2 W exactly — it is its ideal use case, with a power consumption of approximately 1.8 W during operation. You will learn: static IP, systemd service, and moderated SD card logging.

Hardware

Complete Code

# IP statique recommandée (ex. via la box en bail réservé, ou :
sudo raspi-config nonint do_wifi_static_ip ...   # ou /etc/dhcpcd.conf à la main)

# Installation officielle :
curl -sSL https://install.pi-hole.net | bash
# L'installateur demande : interface (wlan0), upstream DNS (celui de la box),
# interface d'admin (web), mot de passe du tableau de bord.

# Vérifications :
pihole status                     # DNS active
dig +short doubleclick.net @127.0.0.1     # doit répondre 0.0.0.0
pihole query ad.doubleclick.net   # trace de résolution

# Pointer les clients : DHCP de la box -> DNS = IP de la Zero 2 W
# Tableau de bord : http://IP_DE_LA_ZERO2W/admin

Expected Verification

pihole status displays Status: Active; a test dig query on a blacklisted domain returns 0.0.0.0. After pointing a device to this DNS, the dashboard begins counting blocked requests in real time. CPU load remains very low: the quad-core A53 is more than sufficient for this role.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials