🛠 Pi-hole : bloqueur de pub DNS sur Zero W
Objectives
Transform the Zero W into a Pi-hole filtering DNS server: 512 MB is more than enough, and Wi-Fi eliminates the Ethernet dongle required by the Zero without radio.
Hardware
- 1 Raspberry Pi Zero W connected to Wi-Fi (connection tutorial) and up to date
- Static IP address of the board on the LAN
Steps
- Install the official installer:
curl -sSL https://install.pi-hole.net | bash(read the prompts: the resolution interface will listen onwlan0). - Set the address: static DHCP lease on the router, otherwise the DNS will follow a ghost IP.
- Point clients to the board: either via DHCP option 6 on the router, or manually (DNS = Zero W's IP) on a test device.
- Monitor activity:
pihole -cin the terminal displays blocked/allowed queries live; the web interface is athttp://<ip>/admin.
free -m # le démon pihole-FTL reste sous ~100 Mo
pihole -g # met à jour les listes de blocage
Verification
nslookup doubleclick.net 127.0.0.1 returns the Zero W's IP (0.0.0.0 depending on configuration): filtering is working.
Common Errors
- Forgetting to update the DNS on the client side: nothing passes through Pi-hole.
- Not monitoring RAM: with 512 MB shared between CPU/GPU, avoid adding a heavy web server alongside it.
- Congested Wi-Fi: perceived latency comes from the radio link, not from Pi-hole.
Other tutorials for this board
- Premier démarrage headless de la Zero W (Wi-Fi + SSH)
- Suder le header 40 broches et faire clignoter une LED
- Se connecter au Wi-Fi en ligne de commande (nmcli)
- Gadget USB : Ethernet sur le port OTG + relais Wi-Fi
- Balise BLE : diffuser un beacon avec le CYW43438
- Nœud capteur autonome sur batterie : énergie et fiabilité
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash