Network-wide DNS ad blocking configuration and notes.
Pi-hole is a network-wide DNS sink that blocks ads and tracking by answering DNS queries for known ad domains locally. Deploy it as a small Linux service, inside an LXC, or as a Docker container.
On Debian/Ubuntu:
sudo apt update && sudo apt upgrade -y
curl -sSL https://install.pi-hole.net | sudo bash
During setup:
Proxmox LXC baseline (Debian 12 recommended):
Inside the container:
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl gnupg ca-certificates lsb-release
# Ubuntu-only: free port 53 from systemd-resolved if enabled
if command -v systemd-resolve &>/dev/null; then \
sudo sed -i 's/^#\?DNSStubListener=.*/DNSStubListener=no/' /etc/systemd/resolved.conf; \
sudo systemctl restart systemd-resolved || true; \
fi
curl -sSL https://install.pi-hole.net | sudo bash
Pi-hole will listen on port 53 (DNS) and 80 (admin UI). For HTTPS, place a reverse proxy in front or terminate TLS locally.
Access admin UI:
http://<pihole-ip>/admin
# Inside the LXC
sudo pihole status
dig +short @127.0.0.1 example.com
# From a LAN client (replace <pihole-ip>)
nslookup example.com <pihole-ip>
nslookup google.com <pihole-ip>
Use a small set of curated lists to avoid false positives and keep lookups fast. You can assign lists to specific groups for granular control.
Tip: Start small, test for a few days, then add more if needed. Aggressive lists can break sign‑ins, media casting, and smart TVs.
# Refresh gravity after adding/removing lists
sudo pihole -g
# Whitelist a domain that was blocked by a list
sudo pihole -w example.com
# Temporarily disable blocking (5 minutes)
sudo pihole disable 300
# Re-enable blocking
sudo pihole enable
Consider enabling regex-based filters sparingly (Group Management → Domains → Regex) and prefer domain-level allowlists for breakages you encounter.
Recommended for privacy and validation:
sudo apt install -y unbound
sudo wget -O /etc/unbound/unbound.conf.d/pi-hole.conf \
https://raw.githubusercontent.com/pi-hole/pi-hole/master/adlists/unbound.conf
sudo systemctl enable --now unbound
Set Pi-hole upstream to 127.0.0.1#5335. Enable DNSSEC in Pi-hole when Unbound is validating.