Pi-hole installieren
# Ubuntu/Debian (oder Raspberry Pi)
curl -sSL https://install.pi-hole.net | bash
# Docker (empfohlen für Proxmox LXC)
cat > docker-compose.yml << 'EOF'
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
ports:
- "53:53/tcp"
- "53:53/udp"
- "8053:80/tcp"
environment:
TZ: "Europe/Berlin"
WEBPASSWORD: "SICHERES_PASSWORT"
PIHOLE_DNS_: "1.1.1.1;9.9.9.9"
DNSMASQ_LISTENING: "all"
volumes:
- "./etc-pihole:/etc/pihole"
- "./etc-dnsmasq.d:/etc/dnsmasq.d"
restart: unless-stopped
EOF
docker compose up -d
Netzwerkweite Konfiguration
Methode 1: DHCP-Server anpassen
In OPNsense/pfSense/Router:
DHCP → DNS-Server: 192.168.1.10 (Pi-hole IP)
Methode 2: Pi-hole als DHCP-Server
Pi-hole Dashboard → Settings → DHCP
DHCP-Server aktivieren
Alle Geräte im Netz nutzen dann automatisch Pi-hole als DNS!
Blocklisten hinzufügen
# Pi-hole Admin: http://pi-hole:8053/admin
# Empfohlene Blocklisten:
# Settings → Blocklists → Add
# Standard (sehr gut, wenig False Positives):
# https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
# Tracking/Telemetry:
# https://oisd.nl/downloads/domainsbig.txt
# Zusätzlich:
# https://raw.githubusercontent.com/nicehash/NiceHash-Blocklist/main/blocklist.txt
# https://github.com/hagezi/dns-blocklists/raw/main/domains/pro.txt
# Blocklisten aktualisieren
pihole -g # oder im Admin-Panel: Tools → Update Gravity
Eigene Domains blocken/erlauben
# Domain blocken
pihole --blacklist werbung-domain.de
pihole --regex ".*.werbung..*"
# Domain erlauben (Whitelist)
pihole --whitelist wichtige-seite.de
# Über Admin-Panel:
# Blacklist → Add / Whitelist → Add
# Lokale DNS-Einträge (Custom DNS)
# Pi-hole Admin → Local DNS → DNS Records
# → nas.local = 192.168.1.100
# → proxmox.local = 192.168.1.101
Statistiken und Monitoring
Pi-hole Dashboard zeigt:
- Queries heute (total / geblockt)
- % geblockte Queries (typisch: 15-30%)
- Top geblockte Domains
- Top anfragende Clients
- Letzte 24h Grafik
# CLI-Statistiken
pihole -c # Chronological (tail -f)
pihole -s # Status
pihole status # Dienst-Status
# Logs
tail -f /var/log/pihole.log
# Dienst neu starten
pihole restartdns
Pi-hole mit Unbound (rekursiv, kein Drittanbieter-DNS)
# Unbound = eigener rekursiver DNS
# Kein Google/Cloudflare DNS nötig!
apt install -y unbound
cat > /etc/unbound/unbound.conf.d/pi-hole.conf << 'EOF'
server:
verbosity: 0
interface: 127.0.0.1
port: 5335
do-ip4: yes
do-udp: yes
do-tcp: yes
do-ip6: no
prefer-ip6: no
harden-glue: yes
harden-dnssec-stripped: yes
use-caps-for-id: no
edns-buffer-size: 1472
prefetch: yes
num-threads: 1
cache-min-ttl: 0
cache-max-ttl: 86400
# Validierung
root-hints: "/var/lib/unbound/root.hints"
auto-trust-anchor-file: "/var/lib/unbound/root.key"
EOF
# Root-Hints herunterladen
curl -o /var/lib/unbound/root.hints https://www.internic.net/domain/named.cache
systemctl enable --now unbound
# Pi-hole → Custom DNS: 127.0.0.1#5335
FAQ
Bricht Pi-hole HTTPS auf?
Nein. Pi-hole ist nur DNS-Level. Es beantwortet Anfragen für geblockte Domains mit 0.0.0.0 – der Browser zeigt "Seite nicht erreichbar".
Fazit
Pi-hole ist die effektivste Methode netzwerkweit Werbung und Tracking zu blocken – auch für Smart-TVs und IoT-Geräte ohne Browser-Extensions.
Netzwerk-DNS und Datenschutz für KMU in Heidelberg, Mannheim und der Rhein-Neckar-Region. Beratung anfragen.