getdnsapi / stubby

Stubby is the name given to a mode of using getdns which enables it to act as a local DNS Privacy stub resolver (using DNS-over-TLS).
https://dnsprivacy.org/dns_privacy_daemon_-_stubby/
BSD 3-Clause "New" or "Revised" License
1.2k stars 99 forks source link

While using only 127.0.0.1 as DNS, after some time passes (random?), there's no connection whatsoever #277

Open Spectre503 opened 3 years ago

Spectre503 commented 3 years ago

I've had this problem for long as I can remember (probably since I started using stubby), 1 year and a half or so. The only "viable" solution is using 1.1.1.1 or 8.8.8.8 as a secondary DNS. But, to me, it defeats the pourpose of using encrypted DNS in the first place.

I tried many configurations, settings, versions, DNS's, routers, ISPs, Stubby as a Windows task, Stubby only on CMD using "Stubby -l". But all seem to have this problem after a while. I'll try to explain as best as I can. Right now I don't have any screenshots of what goes on in my computer after it happens, I never thought of taking screenshots when it happened. If it does now, i'll add them.

What happens, basically, is I'm using my computer normally (doing many different things) and all of a sudden Windows says "There's no internet connection". First thing that pops my mind is, there's actually no internet, like "ISP down". First thing I do is check my phone's wifi and do a quick speedtest, only to see everything is fine everywhere else. This seems to happen only when the computer is on for long periods of time. Sometimes I have the feeling it happens more at late hours, like past 22:00hrs. Just a feelling. But as far as i remember its on late hours when it most happens.

Some things that used to solve the problem: Rebooting the computer; disabling IPv4 and re-enabling; setting a secondary DNS and waiting a minute or so; removing the Ethernet cable and putting it back in; closing the cmd that had "Stubby -l" running, opening a new one and waiting a minute or so.

The problem doesn't seem to happen at all when I have a secondary DNS set up, like 1.1.1.1. But my problem with that is that i keep thinking that Stubby is "down" and my computer is only using 1.1.1.1. Because the only way i know i can be sure stubby is being used ~100% of the time is if i only have 127.0.0.1 as a DNS.

I don't know if this is the place to mention it but recently I started trying using Stubby Manager, mostly because of it being so easy to test different settings and whatnot. Also because it runs as a service and because i noticed it actualy uses the stable version of Stubby, the alpha part of it is just the actual GUI (as far as i noticed). The reason why i want to mention it is because the problem also happens in it. The difference is that it seems nearly impossible to solve it. Sometimes even killing the app, disabling the service, rebooting Windows and then turning everything on again doesn't solve it. I also tried many different DNS combinations with it, varying from multiple at times, to only one or only a couple. But the issue of absolutely 0 connection after a random time still happens from time to time. There's also the issue of putting the PC to sleep, but this one seems to resolve itself while waiting a few minutes. But it seems that not always.

There's also a problem which happens after PC's sleep (with Stubby Manager): that Windows show's it has no connection; but doing a Speedtest (OONI Probe), it works 100% as it should. But some things just won't work. Like opening Spotify, it shows i'm offline and i can't play anything. But browsing online works just fine. Adding 1.1.1.1 (or other like 8.8.8.8) as secondary DNS, in the IPv4 Windows settings, solves this problem in a matter of seconds. If after that is solved, i can remove 1.1.1.1 again from the secondary DNS and everything still works. Until it "breaks" again.

This happened on my old PC (4~5 yrs old) and on my brand new one with very up-today specs (and still happens).

If something is confusing I can try to explain it better, that's not a problem. Sorry for the long text.

OS: Windows 10 64-bits, 10.0.18363. Stubby versions used: i think i started using somewhere around version 0.2.0 Current Stubby version: 0.3.0 Current Stubby Manager version: 0.4.0-a2 Servers being used on Stubby: Sinodun; Sinodun1; getdnsapi.net; Cloudflare; Google. Connection settings: "Encrypt all traffic"; "Always Authenticate"; "Round Robin".

Thanks!

owah commented 3 years ago

I can confirm the same behavior on macOS: I often just close the lid of my laptop and then when re-opening it a few hours later, I can't resolve any DNS entries anymore. Manually doing so by contacting 1.1.1.1 or 8.8.8.8 works. Sometimes when waiting ~30 minutes, it will randomly start working again.

Spectre503 commented 3 years ago

I can confirm the same behavior on macOS: I often just close the lid of my laptop and then when re-opening it a few hours later, I can't resolve any DNS entries anymore. Manually doing so by contacting 1.1.1.1 or 8.8.8.8 works. Sometimes when waiting ~30 minutes, it will randomly start working again.

I think this is related to hibernating/suspension, which is a known issue. Not sure if it also affects macOS. Mine happens while I'm actively using my computer. I wouldn't mind much if it only happened after I suspended it.

Techwolf commented 1 year ago

I had this problem just happen to me a couple times. The second time I was able to see the problem, wget was trying to use an ipv6 address even though I had no ipv6 network. /etc/resolv.conf only has 127.0.0.1 as the nameserver. So stubby should NOT be returning any ipv6 addresses on any lookups, but it does and this is the problem. On browsers, this will appear as can not connect to the web servers, or on some browsers, the network is down.