I have a dynamic DNS name for my router to access my server via port forwarding from the Internet. When I am at home at the local network I can also access this server by its local name or IP address.
But for convenience I would always like to use the same name.
However, using its fully qualified domain name for looking up its dynamic IP from a DNS server requires access to the Internet and hence I cannot reach my local server when the Internet is down. Another disadvantage is that when working at home I could not close my router for outside connections, since I depend on its port forwarding in order to access my server.
So I am wondering what is the best way to use only one name for a server when changing between a local network and the Internet.