Open nirvana-msu opened 11 months ago
The reason trust-dns still uses Ipv4thenIpv6
is given here, which is basically a performance concern and the lack of streaming API (which would allow to first return IPv4 records and then IPv6 if resolution takes longer).
Not sure what's the best way to address this, but when host is IPv6-only or if explicitly binding to a local IPv6 address, the resolver should query for AAAA records by default...
Trust-dns changed default IP resolution strategy from
Ipv4AndIpv6
toIpv4thenIpv6
, which means that if domain name hasA
record (IPv4), it will not attemt to queryAAAA
records (IPv6).So if we bind reqwest client to a local IPv6 address, it will not be able to connect because trust-dns will not return any IPv6 records (if domain has both A and AAAA records)!
returns error:
As a workaround, connection does work if I override DNS resolution manually:
At best this is a very confusing behavior (expecially so when explicitly binding to a local IPv6 address!). It should be possible to connect over IPv6 with default settings,
P.S. Please ignore original issue description, I first thought the root cause was different.