"Could not find host" with mobile client on android 11 and nextcloud pi / duckdns.org

Nextcloud version (eg, 18.0.2):
Operating system and version (eg, Ubuntu 20.04): raspbian / nextcloud-pi, kernel 5.4.79-v7l+ on a rpi4
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Raspbian)
PHP version (eg, 7.1): PHP 7.3.19-1~deb10u1

phone: pixel 3a
android: 11
android nextcloud client: 3.14.1

The issue you are facing:

Since recently, potentially since the upgrade to android 11?, my phone’s nextcloud client does not connect to my nextcloud pi server anymore. All I get is “Testing connection…” followed by “Could not find host” (when trying to create a new account). I completely removed the app, wiped the cache and all - still to no avail. This used to work fine previously and I’m totally stumped as to what’s going on.

I tried with another server (demo1.nextcloud.com) and it seems to work.

I tried the android app “Ping & Net” and it can properly lookup my nextcloud server just fine. I can also use a browser like firefox or chrome on the phone to access the nextcloud instance.

Some more notes:

  • the iOS phone client works just fine
  • it also works just fine using the linux desktop client

Is this the first time you’ve seen this error? (Y/N): yes, but it’s been bugging me for days.

Steps to replicate it: just start the nextcloud app and try to login to my nextcloud pi server.

I’m not attaching any logs, as both the nextcloud log as well as the apache2 access log don’t show any activity when I try to connect from the nextcloud android app to my server - it seems like DNS resolution fails early - which is all the more strange as it works fine with other apps on the same phone.

Can someone please tell me how to get more debug information from the android nextcloud client? I’d say the problem is on that side. I’m also fine with sharing the host address with a developer. (Kevin O, are you reading this? Hey!)

I finally found the solution to my problem: For some reason, the wrong IPv6 address was registered on DuckDns. Seemingly all other clients fell back to ipv4 and then resolved the server address. Only the android client didn’t do that, so it tried via IPv6 and then failed. Fixing the address on duckdns made it work!