Repository navigation
net/dns, ipn/local: skip health warnings in dns forwarder when accept-dns is false - #18572
Conversation
94db30d to
030b26c
Compare
…-dns is false fixes #18436 Queries can still make their way to the forwarder when accept-dns is disabled. Since we have not configured the forwarder if --accept-dns is false, this errors out (correctly) but it also generates a persistent health warning. This forwards the Pref setting all the way through the stack to the forwarder so that we can be more judicious about when we decide that the forward path is unintentionally missing, vs simply not configured. Testing: tailscale set --accept-dns=false. (or from the GUI) dig @100.100.100.100 example.com tailscale status No dns related health warnings should be surfaced. Signed-off-by: Jonathan Nobels <[email protected]>
030b26c to
bcad3bb
Compare
|
Not sure if this has made its way into the unstable build yet, but, here's 1.95.65 tsbug_1.95.65_m.mp4 |
cmol
left a comment
There was a problem hiding this comment.
So this is really just skipping the health warning when someone uses the resolver, even though DNS has been disabled, right?
I think I agree with the comment that it is not a health warning per say, but what is this then?
My gut reaction if this was green field would be to not resolve at all, perhaps not respond at all (to avoid returning NX domain poisoning the OS resolver/cache), but I'm assuming that we have clients that are relying on this perhaps fault?
Perhaps this is just me being "we should own the DNS or not", and the fact that the original issue has MagicDNS disabled, to then still get magicDNS is kind of strange, but I do see the utility.
Maybe what I really think we need is an --accept-dns flag that is only valid when --set-dns=false. Then it becomes more detailed:
- Set the DNS (normal state)
- Don't set the DNS, and don't accept DNS (drop queries)
- Don't set the DNS, but accept queries
IDK, there might be reasons why we have the resolver on constantly even when we don't need to, but the above would make more sense for me from a "you're doing something funky, you have to set the flags for it so you're more aware".
This is just my thoughts of the overall idea. The PR looks good.
@luckman212 I find parts of it somewhat strange, particularly the "tailnet magicDNS enabled" and "client side MagicDNS enabled" part. If the system resolver does not have any tailscale DNS awareness (points to your local CPE resolver or some public one), I don't see how you'd get a requests over to Perhaps what I really would like now that I have looked at it a bit more is for the toggle not only to be what we do with Also, let me be clear that I know much more about how DNS is handled on Linux than on MacOS, so there might be nuances that I am not getting right here. |
But, to quickly sum: on macOS, you can set domain-specific overrides by creating files at This instructs the system resolver to forward any I choose to do this because I do NOT want Tailscale to take over control of my DNS resolution chain, however I DO still want to be able to use On Linux there are similar ways to configure scoped aka split-DNS resolution, e.g. using BIND or systemd-resolved. So I think the flow in my chart is valid and correct. |
@luckman212 I think I misunderstood your flowchart then. Your system resolver is indeed set for quad-100, but only for a specific domain. I think it's fine. I don't think we'll build for the health warning if you disable DNS, though you are welcome to submit a patch for that! |
| defer f.mu.Unlock() | ||
| f.acceptDNS = acceptDNS | ||
| f.routes = routes | ||
| f.cloudHostFallback = cloudHostFallback |
There was a problem hiding this comment.
Shouldn't we add a:
if !acceptDNS {
f.health.SetHealthy(dnsForwarderFailing)
}
here, in case acceptDNS becomes false and there's a failed dnsForwardedFailing already set?

fixes #18436
Queries can still make their way to the forwarder when accept-dns is disabled.
Since we have not configured the forwarder if --accept-dns is false, this errors out
(correctly) but it also generates a persistent health warning. This forwards the
Pref setting all the way through the stack to the forwarder so that we can be more
judicious about health warnings when the forward dns path is missing, vs intentionally
not configured.
Testing:
tailscale set --accept-dns=false. (or from the GUI)
dig @100.100.100.100 example.com
tailscale status
No dns related health warnings should be surfaced.