Skip to content
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

IPv6 not working for hosts with both A and AAAA entries #12917

Closed
ylangisc opened this issue Feb 24, 2022 · 0 comments · Fixed by #12919 or #13399
Closed

IPv6 not working for hosts with both A and AAAA entries #12917

ylangisc opened this issue Feb 24, 2022 · 0 comments · Fixed by #12919 or #13399
Assignees
Labels
Milestone

Comments

@ylangisc
Copy link
Contributor

According to the documentation you can prioritize IPv6 over IPv4 for hosts that have both A and AAAA DNS entries. This setting in turn sets the JAVA system property java.net.preferIPv6Addresses to true.

InetAddress.getByName(hostname) does return an IPv6 address for hosts with an A entry only. For hosts with both entries the IPv4 address is returned. The system property above does not have any effect in that case. Also refer to https://stackoverflow.com/a/11974740 which proposes to use InetAddress.getAllByName(hostname) or a 3rd party library.

Affected code in Resolver class.

@ylangisc ylangisc added the core label Feb 24, 2022
@dkocher dkocher linked a pull request Feb 24, 2022 that will close this issue
@dkocher dkocher added this to the 8.2.4 milestone Mar 2, 2022
dkocher added a commit that referenced this issue Mar 4, 2022
ylangisc added a commit that referenced this issue Mar 7, 2022
@dkocher dkocher reopened this May 17, 2022
@dkocher dkocher modified the milestones: 8.3.0, 8.4.0 May 17, 2022
@dkocher dkocher linked a pull request May 17, 2022 that will close this issue
dkocher added a commit that referenced this issue May 17, 2022
Register custom DNS resolver to handle IPv6 preference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants