Hello
I understand you have a laptop at home/office.
You have a dynamic IP address.
You configured Duck DNS on it and have domain name eg. exampledomain.duckdns.org.
Being away from home/office you want to connect by NoMachine to this laptop ?
NoMachine does not need to be configured.
First you need on your router to forward port 4000 to port 4000 and the IP address of your laptop. Of course it can be any port eg.5234 forwarding to port 4000 on your laptop.
Then in the external network to connect to your laptop use the domain name you set up in Duck DNS and port you configured on your router.