curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: IPv6 resolution problems for IPv4 resolve mode

From: Dmitry Karpov via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 20 May 2022 19:00:43 +0000

> That user had an application that wanted to first create an IPv4 (-only) connection and then an IPv6 (-only) one (separately from the previous connection). That requires that the DNS cache keeps both families even if
> I presume this is what causing you problems?

Yes, the unconditional "dual-stack" approach for DNS queries regardless the transfer resolve mode is causing the problems.
I continue stepping on occasions when DNS servers handle IPv6 queries much worse than IPv4.
Unfortunately, IPv6 is still quite frequently overlooked by some ISPs and it is not always tuned properly.

And in the cases when they didn't respond on IPv6 queries (but responded OK on IPv4 ones) IPv4-only requests failed with timeouts.
In the other cases, when IPv6 DNS responses came with delays, they negatively affected transfer performance increasing transfer start time.
That was an unexpected regression going from IPv4 only libcurl to IPv6-enabled one for IPv4-only requests.

I understand the rationale for keeping DNS entry in the cache for both addresses, but in my proposal, I suggest to use "dual-stack" DNS queries only for dual-stack and IPv6-only modes.
This will make IPv4-only requests in IPv6-enabled libcurl builds behave the same way as they do in IPv4-only builds.


-----Original Message-----
From: Daniel Stenberg <daniel_at_haxx.se>
Sent: Friday, May 20, 2022 7:14 AM
To: Dmitry Karpov via curl-library <curl-library_at_lists.haxx.se>
Cc: Dmitry Karpov <dkarpov_at_roku.com>
Subject: Re: IPv6 resolution problems for IPv4 resolve mode

On Mon, 9 May 2022, Dmitry Karpov via curl-library wrote:

> If this approach is agreed upon, I have implementation for these
> changes and can create a PR.

The most recent change in this area that I can recall introduced the unconditional request for both families even if you ask for IPv4 or IPv6 specifically for a specific reason: The DNS cache.

That user had an application that wanted to first create an IPv4 (-only) connection and then an IPv6 (-only) one (separately from the previous connection). That requires that the DNS cache keeps both families even if the transfer itself is done using only one of them.

I presume this is what causing you problems?

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-05-20