Problems connecting to relays and global discovery

I seem to have a problem with my Android devices being unable to connect to relays and global discovery. I was informed in the other thread (https://forum.syncthing.net/t/12931/39) that this was likely due to DNS related issues.

All the devices are connected wirelessly to the same router, and use the same Internet connection. There are no explicit DNS servers set on the devices themselves, only in the router. I have tried to change the DNS servers set in the router to different ones, but there does not seem to be any difference.

What I find strange is that this problem is only present on Android. On my Windows devices, there are no errors reported, despite the fact that these devices use exactly the same wireless router and connection as the Android devices :thinking:.

Android:

Windows:

The log on Android is being filled with these errors every 15 minutes.

2020-04-29 08:48:15 Exiting backoff state.
2020-04-29 08:48:15 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2020-04-29 08:48:15 Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:51562->[::1]:53: read: connection refused
2020-04-29 08:48:15 Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2020-04-29 08:48:15 c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.000000 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
2020-04-29 08:48:15 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2020-04-29 08:48:15 Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:60371->[::1]:53: read: connection refused
2020-04-29 08:48:15 Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2020-04-29 08:48:15 c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.999322 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
2020-04-29 08:48:15 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2020-04-29 08:48:15 Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:45778->[::1]:53: read: connection refused
2020-04-29 08:48:15 Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2020-04-29 08:48:15 Entering the backoff state.
2020-04-29 08:48:15 c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (2.998102 failures of 2.000000), restarting: false, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]

My knowledge is very weak when it comes to networking, so I would like to ask those who are more knowledgable about the topic. What can be the cause of these problems, and how could I troubleshoot them?

First guess (!) is Android uses specific DNS servers (Google’s) regardless of what’s set on your router.

Hmm, it does not seem to be the case, at least not when using WiFi. When connected to data, I would need to check, but I use Syncthing only when connected to WiFi anyway.

This is what the situation looks like now.

# getprop | grep dns
[dhcp.wlan0.dns1]: [9.9.9.9]
[dhcp.wlan0.dns2]: [8.8.8.8]
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.dns2]
[net.dns1]: [9.9.9.9]
[net.dns2]: [8.8.8.8]
[net.rmnet0.dns1]: []
[net.rmnet0.dns2]: []
[net.rmnet1.dns1]: []
[net.rmnet1.dns2]: []
[net.rmnet2.dns1]: []
[net.rmnet2.dns2]: []

Before, I had it set to 1.1.1.1 and 1.0.0.1 (i.e. Cloudflare), but the same errors were still there.

Which Android Version are you using?

Current Android Versions support (and use by default) DNS over TLS, which circumvents the configured DNS-Servers.

It is either Android 4.4 or Android 7.1, depending on the device.

So the connection error is “connecting” to the local dns daemon it seems, so you need to check why that is refusing to resolve those addresses.

The culprit was running the Syncthing Linux binary under Android. The connection problems are gone after replacing it with the proper Android binary.

I was quite convinced that I had seen these errors when using the Android wrapper too, but I guess that I was wrong. I am sorry for the confusion and the wasted time :sweat:.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.