How to Configure Conditional Forwarding with IPv4 and IPv6 Simultaneously

pihole 5.1.1, default installation, no special adjustments

Summary

The release notes of pihole 5.1 mention, that the conditional forwarding now works with IPv6.
But the webGUI only allows to specify either IPv4 or IPv6.

Expected Behaviour:

Settings > DNS > Conditional Forwarding
There should be a second row of input boxes for the IPv6 network.

Actual Behaviour:

Only one row of input boxes is shown.
This way, we can either configure an IPv4 subnet or an IPv6 subnet, but apparently not both.
The explanations on that page do not specify how to add multiple subnets.
Can we specify a comma separated list of subnets?

Workaround:

Set up the IPv4-settings in the webinterface and create a file called /etc/dnsmasq.d/90-reverse-ipv6.conf with the content
server=/0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f.ip6.arpa/192.168.178.1

Here, fd::/64 is my ULA and 192.168.178.1 is the IP of my router (DHCP server).

This solves the issue and enables conditional forwarding for IPv4 and IPv6 simultaneously.

2 Likes

Thanks for the report.

You might want to vote here:

Thank you. I didn't even find that thread, because I always searched for the term "IPv6", which is not discussed there.

Just FYI, a lot of people seem to miss the rev-server option of dnsmasq. Oddly enough, it’s right under the server option in the dnsmasq manpage.

But take a look at it. It will do the IPv4 and IPv6 reverse expansion for you which is especially useful for IPv6 reverse. For example, you can use this:

rev-server=fd::/64,192.168.178.1

Instead of:

server=/0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f.ip6.arpa/192.168.178.1

I know your request is for adding IPv6 conditional forwarding fields in the web UI, so I’m not proposing this instead of your request. But for others like myself with multiple dual-stack VLANs, this rev-server option is nice.

2 Likes

Ah, thank you for the hint.

I didn't look at the manpage, but took the server option from another post here on discourse.

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