i have set up a server running Nextcloud and some other tools. To be able to access it from outside, i've already set-up DDNS and a DNS Entry for my domain nextcloud.mydomain.com referring to the DDNS, which works perfectly.
The problem is, when i use nextcloud.mydomain.com in my local network, connection is slow, because the connection is routed outside my network, using the hostname or IP everything is fine...
I checked with tracert/traceroute, and the connection is really routed one node away from my router and back.
I would have expected, that my FritzBox-Router will handle that, because it knows its own IP Address, but it doesnt...
Using /etc/hosts is not an option, because 1) that would break connection outside of the network 2) would need a setup for every device using it.
What is the best way to solve this issue?
My Traceroutes:
user@laptop:~ $ traceroute nextcloud.mydomain.com
traceroute to nextcloud.mydomain.com (*PUBLIC IP*), 30 hops max, 60 byte packets
1 fritz.box (192.168.178.1) 10.601 ms 10.808 ms 10.362 ms
2 ipservice-*PUBLIC IP*.pools.vodafone-ip.de (*PUBLIC IP*) 10.636 ms !X 10.631 ms !X 9.443 ms !X
AND
user@laptop:~ $ traceroute nextcloud
traceroute to nextcloud(192.168.178.150), 30 hops max, 60 byte packets
1 nextcloud.fritz.box (192.168.178.150) 12.357 ms 14.189 ms 14.818 ms