for DNS, I like to make use of https://1.1.1.1/ instead of my ISP's DNS. Therefore, I set option dns '1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001' in my /etc/config/network configuration within the config interface 'wan' section.
I imagined dnsmasq picks one of the configured DNS server addresses for its requests and switches if one is unavailable. But apparently, dnsmasq sends the queries to all four configured DNS servers simultaneously. I see four outgoing requests in tcpdump and the DNS servers answer the requests. Then, two or three of the slower responses get answered with ICMP unreachable errors.
I would like to ask you: Is this normal? That dnsmasq asks the servers simultaneously? Seems unnecessary. And that some of the responses are rejected afterwards? Is this because dnsmasq already knows the answer from the fastest response?
Good to know. I don't know how exactly I could troubleshoot this, since the config looks unsuspicious for my eyes. (But I haven't much experience with OpenWrt...) Here is the relevant config.
The thing is, I have no wan6 configuration. After setting up my wan configuration, a new wan_6 configuration automatically appears within luci when connecting, but I cannot edit it. It seems to be managed from wan configuration. Therefore, I deleted the unused wan6 interface that was present after flashing. Was this a bad idea?
iirc it was discussed on dnsmasq maling list sometime ago...
i put the following into /etc/firewall.user
# dont spam dns-servers with port-unreach
iptables -I output_rule -o $EXT_IF -p icmp --icmp-type 3 -j DROP
edit:
alternatively (from manpage)
-o, --strict-order
By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers that are known to be up. Setting this flag forces dnsmasq to try each query with each server strictly in the order they appear in /etc/resolv.conf
Maybe my described behavior was not correct. I tested again, this time issuing multiple requests rapidly from my client. Only one or two lookups were repeated as I stated originally. The others are mainly towards the same IPv6 DNS server. This conforms to the behavior described in the Debian issue as normal behavior.
So may it be the case that everything works indeed as expected? Or is there still something you consider odd, @vgaetera ?
Actually, I've managed to reproduce the issue.
Every new uncached request is forwarded to all the network resolvers.
It doesn't look like normal because this behavior contradicts description for option --all-servers in the official documentation.
May be the documentation is outdated and default behavior has changed...
Anyway this is a minor issue, and AFAIK Windows 10 resolver has similar behavior.
Maybe this option means that every request is forwarded to all servers. Since my tests seem to confirm what's stated in the Debian issue I linked, this happens often (all 30 secs or 50 requests) but not always. However...
For completion: Would you describe which config line in what file is necessary for this? I think I will stay with the default behavior but it is nice to know.
It looks like caching affects this behavior.
If you set cachesize=0, dnsmasq will use a single fastest resolver for some time.
But it still checks all the resolvers periodically supposedly looking for the fastest.