Posted: Mon Oct 03, 2022 4:13 Post subject: IPv6, dnsmasq and local resolution don't get along
I have no problems with local network DNS resolution for local hosts on IPv4, but I can't seem to get IPv6 local DNS resolution to work. I get my IPv6 network allocation from my ISP, and with it gets set the IPv6 DNS servers that are on the IPv6 tab. Those IPv6 name servers always override dnsmasq local name resolution and I can't figure out how to fix it.
I'm using 'DHCPv6 with Prefix Delegation' to get my IPv6 range from Xfinity, but I have Cloudflare DNS set up in 'Static DNS 1' and 'Static DNS 2'. If I don't set nameservers here, IPv6 doesn't seem to work.
I know I'm missing something basic, and I haven't been able to find it anywhere in the forums.
I'm no expert in IPv6 with DD-WRT or otherwise. I'm trying to learn more myself after taking IPv6 training at work and would like to help if I can. I'm not clear on what you're trying to do so I am going to try to restate and you can confirm if I am correct.
Are you trying to set local IPv6 DNS servers on your client so you can perform local DNS queries?
If so, would something like this work in the Additional DNSMasq Options textbox under the Services>Services tab?
Posted: Wed Nov 02, 2022 18:30 Post subject: Re: IPv6, dnsmasq and local resolution don't get along
foobarfoo wrote:
I have no problems with local network DNS resolution for local hosts on IPv4, but I can't seem to get IPv6 local DNS resolution to work. I get my IPv6 network allocation from my ISP, and with it gets set the IPv6 DNS servers that are on the IPv6 tab. Those IPv6 name servers always override dnsmasq local name resolution and I can't figure out how to fix it.
I'm using 'DHCPv6 with Prefix Delegation' to get my IPv6 range from Xfinity, but I have Cloudflare DNS set up in 'Static DNS 1' and 'Static DNS 2'. If I don't set nameservers here, IPv6 doesn't seem to work.
I know I'm missing something basic, and I haven't been able to find it anywhere in the forums.
When you say local name resolution over IPv6, are you referring to a host with the name myhost.local or something else?
I've learned that there are several ways IPv6 can be configured on DDWRT, the primary way being either with radvd running OR using dnsmasq sending out router advertisement messages and the clients configuring themselves using SLAAC based on the RA messages. A picture or complete description of your IPv6 page in DDWRT would better explain your configuration.
I would check what addresses are present in the RDNSS section of the router advertisement, the radvdump tool run from a dd-wrt terminal works even if dnsmasq is generating the RAs. If the only addresses present are for cloudflare then that will explain why you can't find local network resources via DNS queries sent via IPv6. I don't have an equivalent setup to you, instead I have smartdns enabled in the services page so the auto-generated /tmp/dnsmasq.conf gets the following lines:-
server=127.0.0.1#6053
no-resolv
The no-resolv ignores any addresses in /etc/resolv.conf so you need to ensure they get into the dnsmasq configuration file as server= entries or if you use smartdns or similar into the appropriate upstream utility's configuration file.
To ensure you advertise your dd-wrt router's address in the RDNSS section of the RA (and also available via DHCPv6) setup your option6 dns-server value. To provide clients with the global address on the lan interface use the [::] value, I think by default it sends a link-local address
dhcp-option=option6:dns-server,[::]
I think if you specify multiple dns-server addresses here your clients will sometimes go directly to the Internet for DNS instead of to dnsmasq first. If you have a Windows client running ipconfig /all lists all the DNS addresses