The conditional forwarding is set to use 192.168.1.1 as the resolver to convert IP addresses to FQDNs for your local domain. Does the DNS server at 192.168.1.1 have records mapping IP to FQDN for your clients?
The way conditional forwarding works is to send queries for your local domain and pointer records to a DNS server that can answer the questions. Normally all queries go to your upstream selected resolver but upstreams on the Internet will not know about your local clients. So somewhere there needs to be a DNS server that can map your local IPs to DNS names. If the Pi-hole is the only DNS server on the local network the only way to map is via HOSTS files.
Maybe I'm missing something here,
Router DHCP configuration is that the DNS is the pihole,
DHCP holds all the IP reservations while pihole is the DNS when a request is getting out of the LAN (and internally), I can create a script that will add new records to dnsmasq.conf every time DHCP definition is being changed, I would like it to work without workaround, is there a way to do that (out of the box solution)?
If the router is set as the DHCP server then it should have the mapping of client to IP. The test would be to run dig @192.168.1.1 <hostname> from the Pi-hole device. That is what conditional forwarding would do, if the DHCP server / router does not answer then conditional forwarding will not work.
; <<>> DiG 9.10.3-P4-Raspbian <<>> @192.168.1.1 bar-nas.barnet
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
Seems that it's not working
I wrote a deep integration between the router to the home-assistant that I'm using including updating InfluxDB / Grafana, pretty sure it will not work the same, so if the trade off will be to maintain the hosts file, i prefer that...
It looks like the DHCP server is not exposing the IP to FQDN mapping so the only way will be to use a hosts file as the authoritative source of that information.