This is how I do it under IPv4.
I have a domain mydomain.tld.
At home I have dynamic IP addresses.
My router (and my NAS) is able to configure dynamic ip addresses on several providers, dyndns.com for example.
So i configure my router to register its IP address with the dyndns service updating the corresponding A record (may be AAAA to to configure IPv6) with a name like myownname.dyndns.com.
In the dns of my domain registrar, I create a CNAME record (to have a more easy to remember name) called home and with myownname.dyndns.com as the target.
You can create as many cnames as you want with the same target (server.mydomain.tld) in order to have for example several virtual web servers installed in the NAS/server.
So when you query de dns for home.mydomain.tld it forwards a query to the DNS in dyndns.com and responds with an alias for myownname.dyndns.com and the IP address provided by dyndns.com (the last dynamic ip address updated by the router).
At home, I have a openwrt router with dhcp activated.
It serves the names under a local domain called home.
The NAS has a static lease with name server and the local ipaddress (192.168.1.200 for example).
You can stablish leases for IPv6 addresses too if you want.
So at home you access the server locally through server.home.
But this way you cannot access the outside name home.mydomain.tld or server.mydomain.tld as the dns server of your domain registrar would respond with the wan address of your router.
To be able to access the server from inside and outside with the same name (home.mydomain.tld) I create a dns record in the openwrt router (which is the dns server in my local lan, configured using dhcp).
An A record with the IP 192.168.1.200 and the name home.mydomain.tld and another one with the same address and the hame server.mydomain.tld.
I would had preferred a CNAME to point to server.home, but it seems that dnsmasq does not provide cname registers (a pity).
Thus home.mydomain.tld and server.mydomain.tld are resolved to 192.168.1.200 when queried from inside the home lan (resolved by the dnsmasq server in the openwrt router).
From the outside it is resolved to the dynamic wan address of the ISP router, by the DNS server of my domain provider.
if a query for other name like outside.mydomain.tld is made from inside the home lan, as the dnsmasq server in the openwrt router has no register for it, it forwards the query to internet and is solved by the dns server in my domain provider.
Thus I do not have to duplicate entries in two dns servers and keep them in sync, one with local address and the other with the external address.
I just create the records in the home lan for the services that are provided from a server inside the home lan.
Then you have to create the port redirections in your ISP router as usually, as WiteWulf said, depending in the ports that the service you want to provide from within your lan uses.
Be carefull as, opening ports would open sercurity holes to your lan.
It is usually a better choice to create a VPN to access you home lan resources, and only open the ports for the services you want to be public and provided from your local lan.