Replies: 12 comments 3 replies
|
Thanks for the bug report. Certainly this can be done better. I'll be landing some fixes that address your issues. |
|
Thank you. Anything I can do to help? Happy to try things out. |
|
If there are multiple DNS servers would you prefer it to pick a random one, or is it better to start at the top? |
|
I didn't get to fixing this yet, but there is a workaround, so you can hard code your local DNS server. I still plan to get this from the DHCP, so it's automatic. For example to use the local DNS first and then fall back to Google: Beware that this will switch to the Google DNS if there is heavy congestion on the local network and a DNS request times out. So you may want to just have just the one DNS server. |
|
I changed it so it starts with the first, rather than using randomness to pick. You have to be on the very newest release - I'm 99% sure this feature is in the latest SDK released in the new Jaguar at the end of last week. |
|
yes, I upgraded to the latest SDK and this works for me. (setting DNS once at the beginning of my code, then just using the standard resolver. Thank you! |
|
awesome. I gave it a try today. Here is what I see: Sadface. I added this to the DnsClient class (franky that should be there anyway): and logged the result out at startup: So yeah. It gets the right DNS from DHCP. But then, for whatever reason, the default DNS server is not the one that comes from DHCP but the default one internally. When I poke some more at dns.toit and add then it turns out that calling (Yes, my device reports "FreeTOS" as platform, so So I built an SDK locally and flashed a patched firmware onto the device that basically does the same call And lo and behold: so now I am stuck. The code definitely assigns a working DNS resolver to Happy to try another version, for now I am back to hardcoded DNS. |
|
any updates on this? I am comfortable with the state that my app is in right now, but I feel that this should be addressed at some point. |
|
Thanks for letting me know. @erikcorry hope you had a great time away from work and computers. :-) |
|
Unfortunately KLM has cancelled multiple flights, so I am not back home yet. |
|
I assumed that when you wrote "KLM". ;-) (sorry, too many bad memories of cancelled flights from and to Schiphol). Only Air France is worse. |
Uh oh!
There was an error while loading. Please reload this page.
I am using the mqtt library and it could not connect to my hostname. This came as a bit of a surprise; I assumed that I could just do a
transport := mqtt.TcpTransport network --host=my.mqtt-host.my-domainand be in business.Browsing through the code, it seems that the toit runtime ignores the DHCP assigned DNS servers and always goes straight to 8.8.8.8. And that is even hardcoded:
lib/net/impl.toitcallsdns.dns_lookup hostwithout a server so that falls back to the default.I could resolve hostnames myself with
dns.dns_lookupand pass in an IP of my local DNS server. Some problems:dns.dns_lookuponly takes a single server. I have two for redundancy reasons. Short of building round robin myself, is there a way to pass in an array of DNS servers (I guess not).Right now I am looking at hardcoding the IP of my local mqtt server in config. Not ideal.
All reactions