Pi-Hole

Revision as of 16:40, 29 January 2026 by O5-J (talk | contribs) (Add very minimal Pi-Hole Example for others to expand)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Pi-Hole is a DNS service that functions as network ad-blocker.

Minimal Configuration Example

services.pihole-ftl = {
    enable = true;
    openFirewallDNS = true;              # To open port 53 for DNS traffic

    # Settings documented at <https://docs.pi-hole.net/ftldns/configfile/>
    settings = {
        dns.upstreams = [ "1.1.1.1" ];   # To use Cloudflare's DNS Servers
        hosts = [                        # Optionally resolve local domains
            "192.168.178.188 some.domain"
        ];
    };

    # Lists can be added via URL
    lists = [
        {
            url = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.txt";
            type = "block";
            enabled = true;
            description = "Sample blocklist by hagezi";
        }
    ];
};

At your option, a web interface can be enabled via services.pihole-web.enable = true;. You will have to open the corresponding ports when doing so.

Now, setting your routers DNS server to your IP will direct your traffic to the Pi-Hole. Blocked domains will not be resolved.