-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection fails with AAAA records on IPv4 only networks #35
Comments
I think we can just ignore all AAAA records if |
Maybe we should just prefer IPv4 and only attempt IPv6 if there are either only IPv6 or all IPv4 entries failed? |
As mentioned in R11, there is an RFC about this very problem: the solution basically is to try and connect to both, concurrently, and use the connection that succeeds first. |
https://travis-ci.org/amphp/socket/jobs/274703751#L540 is probably related. |
Allows restricting to A or AAAA only via the ClientConnectContext. Relates to #35, but doesn't fully fix it. Further work needs to be done to avoid IPv6 automatically when IPv6 support is not available.
It's pretty strange that the related Travis failure only happens on PHP 7.2. |
Currently we don't resolve to the first of A / AAAA, but wait for both. That means we could sort the array of records and just prefer A records if they're available. |
How about adding a |
Working on an IPv4 only network and trying to connect to whois.donuts.co I found I was getting
Address family for hostname not supported
errors. I tracked this down to the connection attempt using the AAAA record from the DNS lookup which was then not being caught because it's a (fatal) Error, not an Exception.I've created a PR (#34) to allow limiting of the resolve type in the DNS request via a parameter in the ClientConnectionContext.
The text was updated successfully, but these errors were encountered: