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

DNS resolution hangs UDP for 10 sec on IPV6 networks #1022

Closed
megacct opened this issue Feb 2, 2025 · 1 comment · Fixed by #1023
Closed

DNS resolution hangs UDP for 10 sec on IPV6 networks #1022

megacct opened this issue Feb 2, 2025 · 1 comment · Fixed by #1023

Comments

@megacct
Copy link

megacct commented Feb 2, 2025

MbedUDP::beginPacket() hangs for over 10 seconds if IPV6 responses are received.

It is believed this is caused by gethostbyname() within SocketHelpers.cpp passing NSAPI_UNSPEC as the desired response type. Overriding with NSAPI_IPv4 eliminates the problem. Full details can be found here https://forum.arduino.cc/t/dns-resolution-hangs-udp-for-10-sec-on-ipv6-networks/1349444

@Vidbuf
Copy link

Vidbuf commented Feb 3, 2025

When using the HttpClient I observe the same 10 second delay resolving the DNS name as described above for the UDP class. The same workaround is effective (making my own call to gethostbyname with the NSAPI_IPv4 enum option).

Both of these related DNS problems (in the UDP and HTTP classes) occur 100% reliably on GIGA devices attached to the AT&T Fiber Optic network which supports both IPV4 and IPV6.

When the DNS server response includes both IPV4 and IPV6 addresses gethostbyname with the NSAPI_UNSPEC hangs for 10 seconds, times out and then is immediately successful returning an IPV4 address. The problem occurs both when using a DNS name like "pool.ntp.org" which returns multiple server IPs as well as simple single server names like "adventure-labs.com".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants