Deploy Pi‑Hole on Debian 11
Deploy Pi‑Hole on Debian 11 so every device on your network stops seeing those annoying ads, trackers, and malware domains in one fell swoop.
Open the terminal, pull the script, and let it do its thing
Why this matters: The installer does all the heavy lifting for you—installing dependencies, setting up a local DNS server, and configuring basic security. Skipping it is like trying to build a car from scratch when a ready‑made kit exists.
curl -sSL https://install.pi-hole.net | bash
That one-liner downloads the latest Pi‑Hole installer from GitHub and pipes it straight into Bash. You’ll be prompted for a few settings: upstream DNS provider, whether to enable IPv6, and whether you want the web admin panel.
Step 1: Make sure your system is up‑to‑date
sudo apt update && sudo apt upgrade -y
Debian 11 ships with many packages pre‑installed, but a quick refresh ensures you have the latest security patches and the newest netfilter modules that Pi‑Hole relies on.
Step 2: Install the bare minimum
sudo apt install --no-install-recommends dnsmasq bind9-host -y
Pi‑Hole’s DNS service replaces dnsmasq. The bind9-host tool is only needed for hostname resolution during installation; it gets removed automatically.
Step 3: Run the installer
curl -sSL https://install.pi-hole.net | bash
During the wizard:
1. Select a DNS provider – Google, Cloudflare, or OpenDNS are solid choices.
2. Enable IPv6? – Only if your network uses it; otherwise keep it off to avoid extra configuration headaches.
3. Choose whether to install the web interface – I always do; without it you’re stuck in a terminal for every tweak.
When asked, set the static IP that Pi‑Hole will use (e.g., 192.168.1.2). This is critical: if your router hands out dynamic addresses, the DNS server might lose its spot in the network.
Step 4: Point your devices to Pi‑Hole
You can either:
- Change each device’s DNS manually to point at the static IP you just chose.
- Configure your router to hand out that address as the primary DNS.
Most consumer routers have an option under LAN settings called DNS server or DHCP DNS. Replace whatever is there with 192.168.1.2.
If you’re using a dual‑stack network (IPv4 + IPv6), remember to set both addresses. Otherwise, some devices might silently fall back to your ISP’s resolver.
Step 5: Verify it works
Open a browser and go to:
http://pi.hole/admin/
You should see the Pi‑Hole dashboard. In another terminal, run:
dig @192.168.1.2 example.com
The ANSWER SECTION should list the IP you’re querying for, confirming DNS traffic is routing through Pi‑Hole.
Common pitfalls and how to dodge them
- “Cannot resolve host name” after a kernel update – Debian 11’s newer kernels sometimes drop support for the legacy resolvconf package. If you hit that, run:
sudo apt install --reinstall resolvconf
- No internet on devices – Double‑check that your router isn’t set to use a DNS over TLS provider like Cloudflare’s 1.1.1.1. Pi‑Hole can handle plain DNS, but if the router forces encrypted queries you’re out of luck.
- Pi‑Hole crashes after reboot – Some users report a missing systemd-resolved socket when they install both dnsmasq and Pi‑Hole. The fix is to disable the built‑in resolver:
sudo systemctl disable --now systemd-resolved.service
When you might skip Pi‑Hole
If you’re only on a laptop that uses Chrome, an ad blocker extension like uBlock Origin will do the job and keep your system leaner. Pi‑Hole shines when you have multiple devices—phones, tablets, smart TVs—each needing DNS filtering without installing software on each one.
That’s it. You’ve got a local, privacy‑friendly DNS server that keeps the web cleaner for everyone in your home or office. Enjoy an ad‑free browsing experience and maybe even a snappier network (Pi‑Hole can reduce DNS lookup times).