Conditional forwarding: how does it work?

I'm trying to understand what conditional forwarding actually does and looking at the settings page, I don't understand what "these requests" is referring to:

The preceding paragraph mentions (names of) devices but no requests. So I'm guessing that requests refers to "requests from devices on my local network"? But what kind of requests? Since pihole is about DNS requests, it's probably about DNS requests. (But all DNS requests my pihole receives are (almost by definition) coming from local devices... But that's just an aside).

So if this is about DNS requests from my local devices, then I don't understand what the point is in forwarding those to the DHCP server on my router. What does a DHCP server do with a DNS request? So, apparently this is not about DNS requests? And even if my router does something with those requests, how will this magically change pihole tables such as Top Clients? :thinking:

Public DNS servers do not know anything about your local network, so this information has to be sourced from within your network originally.

"these requests" refer to local hostname lookups (A/AAAA) or reverse lookups (PTR) that will not produce a name or an IP respectively if Pi-hole has no way of determining them (so, indirectly to "...won't be able to determine...").

When Pi-hole is acting as DHCP server, clients requesting an IPv4 lease will also provide a hostname, and Pi-hole's embedded dnsmasq will create the appropriate DNS records, Those records will then be considered whenever a client requests local (reverse) lookups.
Pi-hole itself will routinely check reverse lookups for known local IPs.

If Pi-hole isn't your DHCP server, your router as DHCP server may (or may not!) create DNS records upon DHCP lease negotiation in its own DNS server. Your router may also allow to label a client with additional hostnames. Pi-hole then can divert local queries to your router, which will provide an answer (if known). This is what Conditional Forwarding does.

Alternatively, you could use your router as Pi-hole's only upstream DNS server. This would also give you local hostname resolution, but subjects control and choice of public DNS server to your router's limits.

1 Like

Okay, I will have to dive into those different types of DNS requests... But I think the main reason why I couldn't see the point in conditional forwarding is because I don't think my router actually treats host names as relevant for DNS. Plus, I have manually registered all relevant host names and their IPs in pihole (e.g. portainer.lan) so that I had no problem getting those resolved (though it seems kinda slow sometimes).

Pihole doesn't seem to use those manually created dns records in its tables, though...

A post was split to a new topic: How to set Conditional Fowarding

What makes you think that?

The fact that I only see see IP addresses in my tables.

How did you register relevant host names in Pi-hole?

And could you provide an example for such an entry together with the table where it didn't resolve though you expected it to?

Okay, I am now seeing one of the local host names on the Top Clients list. I guess the reason I didn't see any there was that none of the hosts registered on the pihole made it to the top...

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