Hi, my pi-hole works fine but as a software engineer I'm digging deeper into the network topic.
I have some (basic) question about the DNS setup.
Some people configure the pi-hole upstream DNS back to their router. My understanding is following on LAN side:
client -> pi-hole (via DHCP) -> router (Upstream DNS) -> DNS (e.g. Google, ISP,...)
On WAN side I would get a loop because of:
client -> router -> pi-hole (DNS) -> router (Upstream DNS) -> pi-hole (DNS) ->...
Right?
What's the advantage of this approach instead of setting the DNS directly in pi-hole and get rid of the routing back through the router to the DNS server? I think that just adds latency, isn't it?
As packets would have to travel through your router anyway, the additional latency would be measurable, but likely marginal, especially if your router would employ a DNS cache.
When using your router as Pi-hole's sole upstream, there would be no need to enable Pi-hole's Conditional Forwarding, assuming that your router's DNS server can provide local hostname resolution.
That may be of advantage if the router would manage several subnets/domains (where Pi-hole's UI caters for only one entry), or in case of your router covering reverse lookups for local IPv6 addresses as well.
Also, some routers may offer a non-configurable guest network where the router is propagating itself as local DNS resolver, and if you'd be willing to filter that as well, you'd have no choice than pointing your router's upstream to Pi-hole.
You'd have to be careful about triggering partial DNS loops in such a scenario, though.