Upstream DNS & dhcpcd.conf DNS

Hi All

I've just setup PiHole and running through the installation, I've set /etc/dhcpcd.conf's

interface eth0
static domain_name_servers=9.9.9.9

And then for the Upstream DNS on GUI, I've again set Quad9's DNS addresses in the table.

My router is currently set to use PiHole's IP address as the DNS too.

Does it matter, what static dns is set to in dhcpcd.conf, or can it be set to the IP address of the router?

A lack of understanding on my behalf!

Thank you!

dhcpcd.conf solely configures the DNS servers that the Pi-hole host device is using.
Note that while this would affect Pi-hole's installation script (as that has to resolve DNS requests through the host), it wouldn't affect Pi-hole's operation itself.
Independent from the host, DNS requests as received by clients and forwarded by Pi-hole will use the upstream DNS servers as configured for Pi-hole.

You could force your Pi-hole host machine to also have its DNS requests filtered through by Pi-hole by pointing it to the 127.0.0.1 loopback address.

However, in general, it would be beneficial to have Pi-hole's host machine use another DNS server than Pi-hole itself. In case Pi-hole isn't operational for any reason, that would still provide DNS resoluton for its host machine, allowing to run OS upgrades and Pi-hole repairs.

Whether that DNS server is your router or a public one would be a question of personal preference along with your actual network configuration.

If you opt for your router, be careful not to close a DNS loop, e.g. by configuring Pi-hole to use your router as upstream while your router is using Pi-hole as its upstream at the same time.

2 Likes

Thank you for the detailed response.

Now that you've explained it, it makes a lot of sense! Leaving the DNS on the host set to Quad9 or Cloudfare is the most sensible option.

Thanks again

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