I'm hosting a server on my LAN with a port exposed publicly by the router. myserver.mydomain.com
is pointing to the static IP of my router. So I can access the server from the the internet.
To make myserver.mydomain.com
work when connected to my LAN I added an entry to the DNS server of my router, so it redirects to the private IP address of the server. This works fine for most devices connected to my LAN, except for my Android phone, where myserver.mydomain.com
still resolves to the public IP of my router, even when connected to my Wi-Fi. So I suspect android always uses google DNS servers or something.
When I'm out and about connecting to some random Wi-Fi network this seems like highly desirable behavior, but when at home this creates the said issue.
I know I could configure my own DNS servers on my phone but I don’t want to configure that manually each time I connect to my LAN.
What would be the best approach here? Maybe I need to set up local access to my server differently?