Skip to content
Commitpedia
Log in Join & edit

Pi-hole: network-wide ad blocking with your own DNS server

A DNS server for your home or office network that answers queries for known advertising and tracking domains with nothing, so every device on the network is protected without installing anything on it.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of Pi-hole: network-wide ad blocking with your own DNS server: 1 recorded edit
Edit history · 1 edit
Type
Repo
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Source
pi-hole/pi-hole

pi-hole/pi-hole

Stars
61.3k
Forks
3.3k
Language
Shell
Licence
NOASSERTION
Last push
11 Oct 2026

On GitHub: A black hole for Internet advertisements

Open on GitHub

Pi-hole (about 61,000 stars on GitHub) is a DNS resolver with a block list. You point your router, or individual devices, at it as their DNS server; when a device asks for ads.example-tracker.net, Pi-hole returns an empty answer instead of the real address, and the request never leaves your network. Everything else is forwarded to an upstream resolver of your choice. A web dashboard shows every query, which devices make the most, and lets you whitelist or blacklist domains with one click.

Beyond ad blocking, it is a good way to see DNS: the query log makes the concepts from the DNS article in this topic concrete, and it doubles as a local DNS server where you can give your home servers proper names.

When to use it

  • You want blocking for smart TVs, phones and guests, not just in one browser.
  • You run a WireGuard VPN and want devices on the road to use the same filtered DNS: set the Pi-hole address as the DNS server in the VPN client config.
  • You want to know which devices phone home and how often.

How to install it

It runs on a Raspberry Pi, any small Linux box or VM, or in Docker. The official installer is a one-line script; read it first if you prefer, or use the Docker image:

Check before you run this

  • Downloads a file and runs it straight away. Open the URL and read the script first.
# supported Debian, Ubuntu, Fedora and CentOS Stream releases
curl -sSL https://install.pi-hole.net | bash

# or Docker (see the pi-hole/docker-pi-hole repository for the full compose example)
docker run -d --name pihole -p 53:53/tcp -p 53:53/udp -p 80:80/tcp \
  -e TZ=Europe/Bratislava -e FTLCONF_webserver_api_password='change-me' \
  -v pihole_etc:/etc/pihole --restart unless-stopped pihole/pihole:latest

After installation, change your router’s DHCP settings so it hands out the Pi-hole address as DNS, or set it on individual devices to test first. Port 53 must be free on the host; on Ubuntu, systemd-resolved listens on 127.0.0.53 and may need to be told not to act as a stub listener, which the Pi-hole installer explains.

Credit

Pi-hole is developed by the Pi-hole team and community contributors and licensed under the EUPL 1.2. The project is funded by donations.

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0266 What is a port? A port is a numbered door on a computer that lets one machine run many network services at the same time. Beginner · Explains an idea · Any system Article DNS, IP addresses & ports 15 Oct 2026
  • 0274 What is DNS? DNS is the internet's phone book: it turns names like example.com into the IP addresses computers actually use. Beginner · Explains an idea · Any system Article DNS, IP addresses & ports 15 Oct 2026
  • 0275 What is an IP address? An IP address is the unique number that identifies a device on a network so data knows where to go. Beginner · Explains an idea · Any system Article DNS, IP addresses & ports 15 Oct 2026
  • 0341 DNS, IP addresses and ports explained for beginners An IP address says which machine, a port says which program on it, and DNS turns names into addresses. The three ideas… Beginner · Explains an idea · Linux, macOS Article DNS, IP addresses & ports 15 Oct 2026
  • 0342 Which process is using a port, and how to free it Find the program behind a busy port with ss, lsof or fuser, decide whether to stop it properly or kill it, and… Beginner · Step by step · Linux, macOS Article DNS, IP addresses & ports · Networking & firewalls 15 Oct 2026
  • 0343 Fix: Connection refused and Connection timed out, what each one means Refused means the host answered and nothing is listening there. Timed out means no answer at all, usually a firewall or wrong… Beginner · Fixes an error · Linux, macOS Article DNS, IP addresses & ports · Firewalls 15 Oct 2026

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +2,111 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?