Accessing a home server locally and remotely form the same hostname
Resolving over the internet:
-
You have a dynamic WAN IP: You'll want to make use of "Dynamic DNS" (DDNS). These services will allow you to install a small client in your LAN network that keeps a DNS server updated with your current IP. This will allow you to make contact with your server from the outside to a normal name. Some routers have built in support for DDNS.
-
You have a fixed WAN IP: Setup your DNS entries at your registrar to point to your fixed IP. If you just want the name to resolve correctly, set the A record (or AAAA record for IPv6)
Resolving in LAN:
If you do not setup DNS in your LAN, you can run into trouble with routers not supporting "NAT Loopback" (also called hairpinning). If your router does support nat loopback, you dont have to setup anything locally.
On the LAN side, setup a DNS server or forwarder or configure your routers DNS server to resolve myserver.mydomain.com to resolve to 192.168.1.200 If you want to setup your own DNS server, i suggest looking at dnsmasq. Dont setup a DNS server on the laptop.