Nextcloud disconnected when on local DNS

Support intro

Nextcloud version: 29.0.0
Operating system and version: Ubuntu 22.04
No proxy manager
Pihole as Local DNS

I have a Nextcloud 29 on docker container running well. I set it without proxy manager. I just access it directly from 192.168.3.77 and expose it public via Cloudflare tunnel to cloud.mydomain.com. Everything runs fine

I want to have a split DNS, so I set up a pihole running on an armbian device (192.168.3.55) and set as local DNS resolver.
I add A name record to pihole → cloud.mydomain.com : 192.168.3.77

and suddenly, my nextcloud desktop app on Mac OS and Fedora Linux can’t connect. both are disconnected.

I also can’t login from nextcloud on android and iOS devices

When I delete the A name record, reopen the nextcloud app, everything works fine…

what did I do wrong? How to solve this problem?
Note: I also set local DNS for immich, and no problem in connecting.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. set up local dns with pihole, add A name record
  2. close and reopen nextcloud desktop app or logout from nextcloud mobile app

Thank you

Updating the Trusted Domains in the configuration file might provide the solutions

https://docs.nextcloud.com/server/latest/admin_manual/installation/installation_wizard.html#trusted-domains

I could imagine your local Nextcloud has no TLS so oyu only can access it using plain http. https website usually prevent http access (search for HSTS header) to avoid security issues. Likely you need to add a TLS cert locally to utilize splitbraindns.