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
Prevent intermittent DNS failures when DNS server in local network is used. #55
Prevent intermittent DNS failures when DNS server in local network is used. #55
Conversation
…se dns ://127.0.0.1:5553 when a DNS server is specified either through DHCP ('.servers') or the local configuration ('.locals') since this will result in intermittent DNS lookup errors for hosts in the local network that are only known through the specified DNS servers.
|
Hi @gjdoornink, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
|
I thought I am a bit confused by the 3rd line above. Why is Correct me if I am wrong, but it looks like this will still result in the Cloudflare DNS servers being used if any of these errors are returned by the DHCP/locally configured DNS server: Maybe it makes sense to have the DNS
I run my own DNS resolver and use DNS based blocking. DNS queries sent to external servers are blocked. Home Assistant constantly tries to connect to Cloudflare and fails. Even with the change in this PR, Home Assistant would still try to connect to Cloudflare if my DNS server returned This would also benefit people who want the privacy benefits of using Cloudflare's DNS server instead of their ISP's DNS server. They could simply set the mode to I removed the Thoughts? |
No, it seems I had it backwards, sorry about that :-)
Since I had it backwards, dns://127.0.0.11 is only added if no DNS server is assigned through DHCP.
It might, but the purpose of this patch is only to fix the intermittent failures of resolving hosts in the local network.
I do assume there was and is a reason and a purpose and, after going through a lot of the related discussions, I assume it has to do with ensuring a fallback is always present. Kind regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message has ('.locals') and ('.servers') the wrong way around.
I'm not sure. I believe |
I believe that 127.0.0.11 is the Embedded DNS Server of Docker. |
|
See #56 (review) |
|
IMHO you are missing the point of this pull request. |
Since the default forward policy is configured for sequential load balancing do not use dns://127.0.0.1:5553 when a DNS server is specified either through DHCP ('.locals') or the local configuration ('.servers') since this will result in intermittent DNS lookup errors for hosts in the local network that are only known through the specified DNS servers.
To expand a bit, when a DNS server is specified either through DHCP ('.locals') or the local configuration ('.servers') the forward line will become something like: forward . 'dns://192.168.0.1 dns://127.0.0.1:5553'.
This means that DNS lookups for hosts in the local network (192.168.0.0/24) will, depending on the circumstances, be forwarded either 192.168.0.1 or 127.0.0.1:5553. When the DNS lookup for a host in the local network is forwarded to 127.0.0.1:5553, the lookup will fail.
edit: I had .locals and .servers the wrong way around, this is now fixed in the text above.