-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
SocketWrapper - use DNS of specific netif, not global #849
Conversation
DNS IP address assigned by DHCP was not used. Instead DNS serves hardcoded in Mbed were used.
Uh, thanks. I will check it ASAP. |
@JAndrassy Did you try it? Currently, you need to use the following code to apply the DNS received from the DHCP server to the network stack.
The patch that we would need should be able to do this stuff when we receive the DNS configuration from the DHCP server, otherwise we will end using https://github.com/manchoz/mbed-os/blob/f6d6cdfcefc77d0bf333cf60812a1d0b7282a5f5/connectivity/netsocket/source/nsapi_dns.cpp#L116. |
I tried it with WiFi. before and after the fix. I didn't try Ethernet. you wan to copy the DNS servers specific for the netif to global DNS servers list? EDIT: @manchoz sorry, maybe you missed that this is a PR, not an issue? |
Is this still broken in Release 4.1.1? I'm having a heckuva time on an Opta with very simple stuff that Just Works™ on ESP32. I'm attaching a simple case of what I think should be working fine but isn't. This code does print the correct DNS server address (so #809 is fixed) but it can't find the MQTT broker (which can by found by other devices on the same network by the same hostname using identical code). |
I am also having DNS issues running 4.1.1 on the Opta. Specifically, I cannot get a local DNS via DHCP. The IP's I get are shown below. My code file is attached below. I even updated the four files associated with this PR manually in the packages folder. Same issue. I also tried the onNetworkConnect() function recommended by @manchoz as well as the work-around in https://forum.arduino.cc/t/ethernet-dhcp-issue/1231893. ETH: Local IP: 192.168.0.179 |
This is an update to my comment from two days ago. I discovered that setting the DNS server IP is not possible via a DHCP ethernet connection. I found a work-around to my problem by doing the following.
Regards, Mark |
@JAndrassy Unfortunately, that did not work. |
@manchoz which way?
your PR #809 would indicate 1) and the Arduino API DNS functions are methods of the specific network interface so it is simple to manage them that way. with 2) there are a few problems:
|
@markwestm I think the changes from this PR solve your problem but for some reason they where not applied to your test |
@JAndrassy Is there any information (code snippets, serial monitor output, etc.) I can provide to help determine if these changes were applied to my test. Thanks for your support. Regards, Mark |
without these changes you can see in Wireshark that it uses 8.8.8.8 for a DNS request. With the changes it uses the DHCP assigned DNS server IP |
@JAndrassy I can confirm that the changes in this PR are working. Thanks so much! @pennam and @manchoz, it would be awesome if this could get merged in... thanks! :) |
This is great news! How soon before it gets released?
Regards, Mark
|
DNS IP address assigned by DHCP was not used.
Instead DNS servers hardcoded in Mbed were used.
error report https://forum.arduino.cc/t/ethernet-dhcp-issue/1231893