-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Wireguard 0.55n has issues connecting if IP of Wireguard server has changed #1808
Comments
Thanks. I can see why this may happen. Usually though, we expect dynamic DNS records changes to coincide with network changes (need not be the case, but usually is). If so, the endpoint domain is re-queried for IP. We'll try to re-query after TTL expires. |
@ignoramous if you expect DNS record changes to coincide with network changes, that is indeed a possible explanation. But unless I overlook something, this means it will basically never work if your Wireguard server depends on a DynDNS service:
Would it be possible to add some setting which turns this behaviour off and / or accept "no network" (flight mode) and any phone boot as a network change, even if if the network ID the phone reconnects to is the same? |
Not really. Whether or not 2 things are the "same network" actually depends on how Android reports it to Rethink. Rethink cannot and does not treat different networks as "same network" unless Android tells it to.
Strange. Recommended by whom? There are a couple of ways to flush DNS caches (reddit / mirror).
It is possible to add new settings but since only power users use dyndns, I am reluctant to add it, especially since the major complaint by users of the app is the existing settings introducing complexity. Today, Rethink will reconnect/re-establish WireGuard tunnel if you tap on the "Refresh" icon at the top right-hand corner of the Configure -> Proxy screen. This refresh should also trigger a re-evaluation of Peer (endpoint) names, if any. Other than that, I think re-querying once the DNS answer time-to-live expires should be enough? |
Chip.de and Adguard for example, just as the first two results a quick search for "clear dns cache android" gave out: But there are numerous others as well.
Yes, that is a valid objection. Such a setting would need to be in some "extended settings" are which ReThink does not have today.
Okay, I admit I have never noticed that one. I would have expected such an icon to be in the Proxy connection screen since "configuration" means for me "settings only" - while all connections are activated and deactivated in this screen: I just tried that one, it does not help - see below.
I fear I need to rephrase the issue, thanks for forcing me to take another, deeper look. This is what I get: DNS (done from my computer to get the TTL values):
If I use the DNS server 8.8.4.4 Rethink obviously uses on its own after phone boot at times, I get
which means the entry should be re-queried after less than two minutes at max. ReThink seems to only pay limited care however - after I reconnected, it took about six minutes until the DNS query entry showed the current IP (unclear how old the cached entry was though, so the real TTL ReThink uses might be longer) - and interestingly enough, the DNS protocol shows all entries - both old and new - as "resolved by Cache". This means, I misjudged that and you cannot trust the "resolved by Cache" notice since the new IP must to have been resolved from somewhere else than the cache unless you did some real magic :-) But that is not not the only problem I noticed (and this is what I never noticed before): In the meantime, the DNS entry gets polled every 2 minutes. This tells me it is actually not the DNS that fails but the Wireguard reconnection itself. In this state, I can
|
Okay, after keeping an eye on this for some more days I updated the error description in the first post. The problem is that Rethink does not seem to update its Wireguard module after a DNS change of the Wireguard server. If you happen to have some new version that might solve this, I will be happy to test it :-) |
I was a bit surprised to not find this here - the closest one might be #1538 . The older issue #1367 was something different.
Therefore let me add this here:
My Wireguard server is my local router (a Fritzbox) which connects to the Internet via a DynDNS service since the IP of my internet access usually changes every day.
ReThinkDNS has an issue with finding the Wireguard server then, which results in a stalled Wireguard connection (no data comes in) and makes "Always-on" unusable. Toggling either "total blockage" or the Wireguard connection itself usually fixes the issue - until the IP of the Wireguard server changes again.
Until now, I failed to find a task on the phone which, when excluded from the Wireguard connection, would solve the issue. (Judging from AfWall+, I would have expected I need to exclude ReThinkDNS and/or the system DNS service from Wireguard, but that does not change anything)As far as you can tell from the DNS protocol it seems ReThinkDNS does a query of the WG server but is happy if it finds it in its cache and does not care further. "DNS Amplifier" is off, "Never proxy DNS" either since that option does too much since it excludes all DNS entries from cache and Wireguard proxy. DynDNS URL of WG server is added as trusted domain.
Edit: corrected error description (see below for details): ReThink does get the new IP of the Wireguard server from the DNS, but it ignores the change and does not connect to Wireguard. That also explains why e
Expected behaviour would be that ReThinkDNS will
Here is how to reproduce:
a) phone is running and the WG server changes its ip address:
b) WG server IP changes while phone is off:
The text was updated successfully, but these errors were encountered: