Open fermulator opened 2 years ago
fwiw; the Python Resolver
package should be able to lookup the system nameservers. dns.resolver.nameservers
Hey ferm, thanks for this.
How we detect an active network is a long debated topic and I've moved this the the mycroft-core repo as it affects all versions not just Picroft.
One thing I added recently was configurable values for these tests via mycroft.conf that you can see here: https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/configuration/mycroft.conf#L150
For your use case, would setting your pihole as the dns endpoint work?
I think this is still something we need to address more broadly though so want to keep this issue open.
The idea with the DNS check is that it's a very quick way to get a reading on if the outside world is reachable. Pointing them to the local dns wouldn't tell the whole story about current connectivity.
That said Using the ncsi capture portal test might be a truer test and maybe could replace the socket connection + google.
And we could change the default from the MS detection portal to mozillas (used MS when I wrote that since it was the one I could find decent documentation on)?
Config for mozilla's endpoint:
"ncsi_endpoint": "http://detectportal.firefox.com/canonical.html",
"ncsi_expected_text": "<meta http-equiv="refresh" content="0;url=https://support.mozilla.org/kb/captive-portal"/>"
At one point it was discussed if Mycroft should host a capture portal detect page aswell.
Since the missing DNS should trigger fallback to the ncsi method, the connection should have been detected and startup of Mycroft should proceed. Just to verify that there's no issue with the fallback, can you clarify if mycroft works as expected or halts at boot?
Describe the bug At home, I do not allow egress 53 to any DNS lookups unless it is from my pihole. DHCP serves the proper DNS to clients using DHCP options.
Looks like there are some startup utils/tests that try to validate stuff about the network and assume it will be allowed to talk to Google DNS (8.8.8.8 or 8.8.4.4)
To Reproduce Steps to reproduce the behavior:
ssh
into it, and check the logs.Expected behavior UTs should use system DNS (not harded)
Log files
Environment (please complete the following information):
Additional context