MirrorNest
← Todos os guias

Pi-hole

A free, open-source network-wide DNS sinkhole that blocks ads and trackers for every device on your network at the DNS level -- no per-device app or browser extension needed.

Destino: Any Docker hostNetworkingDNSSite oficial ↗Documentação oficial ↗
Este guia foi elaborado a partir da documentação oficial do Pi-hole, ligada acima — verifique sempre lá os nomes exatos dos pacotes/versões antes de executar estes comandos num servidor de produção, uma vez que as versões da distribuição e do projeto mudam com o tempo.
  1. 1Run the Pi-hole container

    docker run -d \ --name pihole \ --restart unless-stopped \ -e TZ="Etc/UTC" \ -e FTLCONF_webserver_api_password="changeme" \ -v /my/own/pihole-etc:/etc/pihole \ -p 53:53/tcp -p 53:53/udp \ -p 80:80/tcp \ --dns=127.0.0.1 --dns=1.1.1.1 \ pihole/pihole:latest

    Port 53 must be free on the host -- disable systemd-resolved's stub listener first if it's already bound (common on Ubuntu). Replace "changeme" with a real admin password.

  2. 2Open the admin UI

    http://<the-server's-ip>/admin
  3. 3Point your router (or individual devices) at it

    For network-wide blocking, set this server's IP as the DNS server in your router's DHCP settings -- every device on the network then picks it up automatically. To test on one device first, set that device's DNS manually instead.