Using IPv6 RDNSS option with RA relay mode - is it possible?

Hi! I have OpenWrt 22.03.0 running on a Linksys E8450, but my ISP only advertises a /64 IPv6 prefix to it using SLAAC, while things like DNS servers and NTP servers get advertised through DHCPv6.

I got my devices in the LAN connected to the IPv6 internet by configuring LAN to use "relay mode" for RA-Service, DHCPv6-Service as "server mode" with "Local IPv6 DNS server" enabled, and NDP-Proxy as "relay mode". WAN6 has "relay mode" for all three of those, but it's also specified as the "Designated master".

Now, I want to advertise an IPv6 DNS server - the router itself - to Android devices, so I also want to use the RA RDNSS option (RFC 6106). However, I simply cannot find a way to do so when RA-Service is in relay mode. Any idea as to how I could accomplish that, or is it just not possible?

Have you tried the hybrid mode?

Yes, but it didn't change anything because a designated master interface is configured. Not configuring a designated master interface didn't allow IPv6 to work at all.

Then the other option would be to stop relay and do a NAT6.

I see... That's not exactly ideal, though I suppose neither is Android not supporting DHCPv6, nor is my ISP only issuing a /64 prefix.
A feature to advertise DNS with RDNSS option even when RA relay mode is enabled would be nice, but would there be any reason why that's a bad idea? My previous router (YAMAHA NVR510, not OpenWrt) was able to do that just fine, though it could only advertise the DNS server it received from upstream through either DHCPv6 or RDNSS option, regardless of the prefix length.

I am not saying it is a bad idea, but how many users are facing the same combination of issues as you do? I cannot think of another use-case that someone would need such a specific need. And if there is not a big demand for a feature, it won't attract the developers' attention.

Fair enough. Maybe it'll become a wider issue if things start to go fully IPv6-only, but for now the configuration I have here right now works fine as is. Thanks anyways!

Hold up, the docs for odchpd say this:

RD Relay mode: Router Discovery (RD) relay between master and slave interfaces.

Supports rewriting of the announced DNS server addresses.

(bold mine)
This seems like it's what I'm looking for. Do I need to configure something for it to work?

Nothing is documented, hence you could try to add some IPv6 address in DNS option and see if that works.

I dug through the odhcpd source code and found that it does in fact rewrite the DNS, but only under the condition that interface->always_rewrite_dns is true. By the looks of it (and please correct me if I'm wrong), always_rewrite_dns is left over from 6relayd and there seems to be no way at the moment to enable it from UCI in 22.03.0. Whoops, looks like it's always enabled when DNS server(s) are specified, according to this. I specified the DNS servers in "Use custom DNS servers" for the LAN interface in LuCI though, and it doesn't seem to be working for either DHCPv6 or RA RDNSS option...

If you have Linux client devise install radvdump and check if you really got rdnss.

If odhcpd should not send it you could try to install ravd or bird an the OpenWrt and send only the rdnss... But of course the better option would be to understand what piece is missing here.

Right, so I tried using radvdump, and my Linux PC is in fact not receiving any RAs with RDNSS option. Judging by the source code, I think what's going on here is that odhcpd only rewrites, and doesn't newly write RDNSS option to RAs. The router is only receiving RAs from upstream WAN with SLAAC and nothing more, so of course it can't do any rewriting.
I'm not sure why the router isn't rewriting the DNS in DHCPv6 though... According to tcpdump, my Linux PC doesn't seem to be receiving DHCPv6 packets at all for that matter, even though the relayed RAs received by it have the "other config" flag enabled, and my Linux PC appears to be sending DHCPv6 solicit messages. At least I can deal with that by putting DHCPv6 in server mode though.