-
-
Notifications
You must be signed in to change notification settings - Fork 79
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 lookup fails with SocketException #1008
Comments
Looks like this is a problem with |
If my understanding is correct, mDNS is a bit different than DNS. And mDNS packet structure described here: https://en.wikipedia.org/wiki/Multicast_DNS |
Not long ago, I was working with mDNS. I've tried to set up HomeAssitant server with mDNS on board. Everything works just fine from Windows machine, but Android phone was not able to resolve address. I've switched to normal DNS and it's working since. BTW. I doubt that mDSN lookup will be visible in normal DNS server, from wikipedia |
it is most likely an ESP issue regarding the comments from other sources. Still, let's keep this issue open up to the point the root cause is properly identified or that there is no interest. |
I've had exactly the same problem. It has nothing to do with .local. It also happens with .com. I believe it is due to a DNS request timeout that is too short. And it depends on the hardware. I have several ESP32 Devkit-C V4 boards. The same code works on some, throws an exception on others. |
Currently we don't expose any setting related with the DNS execution timeout. Nor are we setting anything about this from the defaults in lwIP. |
this idea with timeout is just a feeling of mine. A DNS query can take a certain amount of time depending on the DNS server. But the exception comes very quickly, too quickly. I would like to record the network traffic but currently it works without an error. |
I can't reproduce this... always get the resolved address if it exists and an exception if it doesn't. Worth pointing out that a SocketException it's the expected outcome when pretty much anything fails, so it may be hard to trace if this is because of a timeout or an issue with the resolution failing for a particular address. Until we have a consistent way of reproducing this it will be hard to even start looking at what could be wrong. |
No further details provided. Closing as resolved. Feel free to reopen if this is still happening. |
Target name(s)
ESP32_REV0
Firmware version
1.8.0.6
Was working before? On which version?
N/A
Device capabilities
ESP32 (ESP32-D0WDQ6 (revision 1))
Features WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Flash size 4MB unknown from (manufacturer 0x216 device 0x16406)
PSRAM: not available
Crystal 40MHz
Description
I'm getting a SocketException during
Dns.GetHostEntry
that is traced to the NativeSocket::getaddrinfo call (call stack below). The DNS entry does exist and can be retrieved using this call in a normal .NET Core app.WiFi is connected with a valid IP and DateTime and the address being looked up is
infrastructure.local
. A .NET Core app can lookup the address fine, but not the ESP32. There is no trace of the request hitting the DNS serverHow to reproduce
.local
address as an A record to a local server.local
addressExpected behaviour
The DNS entry resolves to an IP address
Screenshots
No response
Aditional information
No response
The text was updated successfully, but these errors were encountered: