Using Pi-hole DNS resolution on Pi-hole host system

Expected Behaviour:

Pi-hole running on RPi 4 with latest builds. Pi-hole is both DNS and DHCP server. RPi is configured with static IP/DNS via dhcpcd.conf, with the DNS entries set to 1.1.1.1/1.0.0.1. Local network clients are registered in the Pi-hole DNS either via DHCP (both dynamic or reservations), or additional Local DNS/CNAME entries for static addresses.

Attempting to access local network systems (ie ping mysystem.local.domain) should resolve to the local IP address.

Actual Behaviour:

When attempting to access local network systems via dnsnames (both NETBIOS names and FQDN), the pi-hole host is unable to resolve the hosts (ie. ping system.local.domain). Resolving internet public domains (ie. ping google.com) works without issue.

Debug Token:

https://tricorder.pi-hole.net/c0mANTnU/

I might misunderstood your issue, but you provided the answer already in your question.

This is expected as the host is not using Pi-hole but

I get that, but then how do I configure the host then? Set the local host to be the DNS server in dhcpcd.conf? But then doesn't pi-hole get it's DNS forwarder from the conf, and it ends up going around in circles, and no public DNS resolution happens?

Yes, you should have localhost to be the DNS server in dhcpd.conf
static domain_name_servers=127.0.0.1

I have a similar setup, my router acts as a NAT gateway only (DHCP disabled, DNS entry 0.0.0.0), Pi-hole is installed on a Raspberry Pi acting as a DHCP and DNS server, and it fwds DNS requests from all LAN clients to Cloudflare 1.1.1.1.

It works perfect

Thanks. I've updated my dhcpcd.conf file to use 127.0.0.1, and things seem to be working correctly.
Overall, I'd say that the pi-hole installer and documentation could really use some updates when it comes to the host having pre-set static ip addressing. Everything seems to assume that the host is configured to get its IP address from other DHCP servers, which then becomes contradictory when pi-hole itself can be a DHCP server (and a better one then many at that).

You mean as described here:

and

But we are open for specific suggestions :slight_smile:

We set this during installation in older Pi-hole versions. But we stopped doing this, as it has one major drawback: if Pi-hole fails, the host does not have a working DNS setup and might prevent users from repairing their Pi-hole installation. Advances users know where to change the DNS server of the host, but beginners don't even know where to start looking.

2 quick thoughts on things:

  1. With respect to the prereqs documentation; I've never noticed pi-hole making any changes to my dhcpcd.conf file if I've set it for a static IP before installing pi-hole. If something is supposed to get added there, I'm curious what it is.
  2. For the Static IP dialog box, maybe add a note to it to inform the user they should update their host DNS settings if they want the host to take advantage of Pi-Hole's abilities.

Pi-hole offers to set your current IP as a static on your Pi host system during installation if your system runs dhcpd. You also have the ability to set an arbitrary address as static during installation. Recently we fixed a bug where we did set the current IP as static even if you had a different one already set manually. PR Allow users to skip setting static IP adress by yubiuser · Pull Request #4419 · pi-hole/pi-hole · GitHub also added the ability to skip setting a static IP at all.

I think we won't do that: while it is a valid configuration to use Pi-hole for the host system it has a big drawback: in case of Pi-hole fails for any reason the host does not have DNS resolution until you manually change the settings. Without internet access, attempts to repair (e.g. pihole -r) might fail. This is not an issue with advanced users but beginners (which are likely the biggest user group) might not be able to fix the issue.

We could discuss adding a note with a big warning here: Post-Install - Pi-hole documentation

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.