conditional forwarding not working in v6

Expected Behaviour:

Conditional forwarding working like it did in v5. Here is my entry in the new settings. My router is at 192.168.0.1.

true,192.168.0.0/24,192.168.0.1

Actual Behaviour:

Client names are not resolved like they did in v5

5 posts were split to a new topic: Conditional Forwarding to Fritzbox doesn't work in v6

@tkuraku

Can you please also generate a Debug Log?

Here's another debug log. Having the same issue, Conditional forwarding is setup but not updating.

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

Sorry it took me a while to get back home. Here is the debug log: https://tricorder.pi-hole.net/c75FOOio/

Aren't you missing the Domain name ?

true,192.168.0.0/24,192.168.0.1,domain.home
1 Like

@tkuraku, @FirstGeekDanny:
Your debug logs both show you are missing the domain name:

   revServers = [
       "true,192.168.0.0/24,192.168.0.1"
     ] ### CHANGED, default = []

v6 treats this as an error:

-rw-r----- 1 pihole pihole 6.7K Feb 20 02:34 /var/log/pihole/FTL.log
   -----head of FTL.log------
   (…)
   2025-02-20 01:23:40.141 UTC [56M] ERROR: Skipped invalid dns.revServers[0]: true,192.168.0.0/24,192.168.0.1

As a result, v6 ignores the settings and does not add them to dnsmasq.conf at all.
While being incomplete, v5 would still have added
rev-server=192.168.0.0/24,192.168.0.1
which at least would have allowed reverse lookups for that IP range to be conditionally forwarded.

This seems like a bug in v6, as the documentation clearly puts the domain in brackets, marking it as optional:

The expected format is one server per line in form of <enabled>,<ip-address>[/<prefix-len>],<server>[#<port>][,<domain>]

Fortunately, addressing this should be simple, as you just have to add your local domain name (as distributed by your (router's) DHCP server) to your Conditional Forwarding line.

Thanks for the looking into this. I this is definitely a bug. In v5 I never specified a domain and never setup any domain with my router. Typically just the hostnames would show up. On the web interface it is also explicitly stated that the domain is optional.

You can also specify a local domain name (like fritz.box) to ensure queries to devices ending in your local domain name will not leave your network, however, this is optional. 

Is it helpful to open an issues on GitHub?

Yup, simple. Added the domain to the router and pihole and bam!

I made a github issue https://github.com/pi-hole/pi-hole/issues/5947

I'm also having issues getting this to function properly.

Expected Behavior:

Conditional forwarding working. My router is at 192.168.68.1.

true,192.168.68.0/24,192.168.68.1,Buckeyes

Actual Behaviour:

Client names are not resolved, but remain in xxx.xxx.xxx.xxx format.

Here is my debug log: https://tricorder.pi-hole.net/5j5Acqpp/

Does dig <client_name> @192.168.68.1 show a client name <> IP address result?

And can you do an arpa query for an IP address as well?

dig -x 192.168.68.1 @192.168.68.1

kalon74@raspberrypi:~ $ sudo dig iPad @192.168.68.1

; <<>> DiG 9.18.33-1~deb12u2-Debian <<>> iPad @192.168.68.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 5083
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;iPad. IN A

;; AUTHORITY SECTION:
. 30 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2025030400 1800 900 604800 86400

;; Query time: 63 msec
;; SERVER: 192.168.68.1#53(192.168.68.1) (UDP)
;; WHEN: Tue Mar 04 08:49:37 CST 2025
;; MSG SIZE rcvd: 108
kalon74@raspberrypi:~ $ sudo dig -x 192.168.68.1 @192.168.68.1

; <<>> DiG 9.18.33-1~deb12u2-Debian <<>> -x 192.168.68.1 @192.168.68.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 30686
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;1.68.168.192.in-addr.arpa. IN PTR

;; AUTHORITY SECTION:
168.192.in-addr.arpa. 30 IN SOA prisoner.iana.org. hostmaster.root-servers.org. 1 604800 60 604800 604800

;; Query time: 11 msec
;; SERVER: 192.168.68.1#53(192.168.68.1) (UDP)
;; WHEN: Tue Mar 04 08:50:57 CST 2025
;; MSG SIZE rcvd: 131

Tested using the client ip address instead of the client name (Client name is Ring-90486C2B5FF6, FYI):

kalon74@raspberrypi:~ $ dig 192.168.68.126 @192.168.68.1

; <<>> DiG 9.18.33-1~deb12u2-Debian <<>> 192.168.68.126 @192.168.68.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43371
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.68.126.                        IN      A

;; ANSWER SECTION:
192.168.68.126.         86400   IN      A       192.168.68.126

;; Query time: 19 msec
;; SERVER: 192.168.68.1#53(192.168.68.1) (UDP)
;; WHEN: Tue Mar 04 11:09:49 CST 2025
;; MSG SIZE  rcvd: 62

The DNS server at 192.168.68.1 does not know how to resolve iPad to an IP address. (NXDOMAIN)

It also does not know how to answer a PTR query for that IP address to a hostname.

That's not going to show anything of value, you'd never ask for the IP address of an IP address.

The reason you are seeing so many PTR queries (arpa) is because the DNS server you have set up as the resolver for your conditional forwarding can not answer any of the queries sent to it by conditional forwarding.

So is there anything to be done or is this just not going to work on my system? I just did a fresh install of RPi OS, Pihole, and got Unbound up and running. No other modifications.

As your router obviously isn't capable of answering DNS requests for local domains correctly, there is no benefit in enabling Pi-hole's Conditional Forwarding.

If you want local names to resolve, you could consider to add the respective Local DNS records to Pi-hole.

1 Like