Feature request for parallel queries for name servers from different protocol families (IPv4 vs IPv6)

Dmitry Karpov dkarpov at roku.com
Tue Jan 18 22:23:03 CET 2022


Hello,

Using libcurl with c-ares for dual-stack scenarios, I observed that c-ares doesn't distinguish between IPv4 and IPv6 nameservers in the name server list (i.e. listed in resolv.conf on Linux systems)  and iterates through them sequentially.
Such approach creates problems for dual-stack systems, when one stack is either not fully functional or have not responding/reachable name servers put on top of the list.

In such scenarios, problems with one stack (i.e. IPv6) may create name resolution delays and timeouts for the other fully functional stack (i.e. IPv4) if name servers from the not functioning stack go before the good stack like:

[IPv6 - BAD]
2001:4860:4860::8888
2001:4860:4860::8844
[IPv4 - GOOD]
8.8.8.8
8.8.4.4

In this scenario, it will take two resolution timeouts for bad IPv6 name servers before good IPv4 name servers are reached, and this negatively impacts Happy Eyeball implementations in client applications (i.e. libcurl) which have to wait for too long before they can start dual-stack connections.

So here is the feature request which should help dual-stack client applications to work more efficiently when name servers from not functioning stack are listed before name servers from a good stack:

  *   Split the flat name server list for both stacks into two lists for each stack.
  *   Execute parallel DNS queries for each stack list, iterating each stack list sequentially as it is currently done for the whole dual-stack list.
  *   Return the result whichever comes first.

This feature request can be also considered in a broader scope:

  *   Run parallel queries for each name server in the dual-stack list regardless of whether it is IPv4 or IPv6 address.
  *   Return the result whichever comes first.

Such broader scope will also allow to skip over bad name servers and get host resolution results much more quickly even for the same stack (i.e. when name server list for a single stack contains some not responding name servers at the top).
But in this case, it should be probably controlled by some new c-ares option, so the current sequential approach may be enforced if needed.

Thanks,
Dmitry Karpov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.haxx.se/pipermail/c-ares/attachments/20220118/81545c76/attachment.htm>


More information about the c-ares mailing list