The problem you are encountering is that in general, IP addresses are not fixed. Each time a router connects to the Internet it may receive a new IP address. Dynamic DNS is used to get around this. In essence, a software client runs on the Qnap which reports its IP address to a central server. The Dynamic DNS service re-maps the domain name of the server to a new IP address every time it changes. Hence, given the correct router configuration, it is then possible to use a fixed domain name to access the server whatever its actual externally visible IP address may be.
What you need to do are two things. First, register with a free Dynamic DNS service to obtain a suitable domain name. I use the service provided by
http://www.dyndns.com myself, but several other Dynamic DNS services are also supported by Qnap servers. Once you've registered with them to create an account and obtained your domain name, you can then configure the Qnap server. Note that Dynamic DNS may also be supported on your router, in which case you may also choose to configure the service on that device instead. As long as you configure either the router or the Qnap server, the service will work properly.
To set DDNS up on the Qnap server, log in to the admin interface and go to System Administration, then select the Network option.The second tab on the right hand page is labelled DDNS. Open this and tick the 'Enable DDNS service' checkbox. Make sure that your chosen DDNS provider is selected in the pop-up menu, then type in your DDNS service user name and password, and the host name that you picked when you registered with the DDNS provider. Finally select a time interval for the IP address check. I use the maximum of 1 hour myself, and have never had any problem with the DDNS service receiving too many updates from my network. If you're happy, click the Apply button and you should see your current external IP address appear if it is all configured correctly.
The second thing you need to do is to make sure that the media service is visible to the outside world. This configuration may not be required if your router and the server both support something called 'UPnP IGD' but it is worth stating anyway. The reason you have to configure the router here is because, the actual IP address of your Qnap server is not visible by default from the outside world. Your router has to understand that it has to forward packets it receives that are destined for your server or any other machine on your network. Normally, a computer or other device on your network first makes a request to a web server (say). The router then notes this and forwards the request, substituting its externally routable IP address for the private, (non-routable) address of the server. The reply packet has its destination address changed by the router to the internal address of your server and all is well. However, where the connection is incoming to a server on the internal network, the router doesn't know in advance what to do with the packet unless it has been told previously to send it to that server. This is what 'port forwarding' does. It uses the destination port number of the packet (this is 9000 for Twonkymedia, 9001 for Squeezeserver, both by default) to look up the internal IP address, if any, to forward the packet on to. So, by knowing what type of packet it is (as told by the port number) it can forward the request to the server.
This is what happens for all TCP and UDP protocols, which use port numbers. The whole story is that there are many possible transport protocols, most of which don't have the concept of a port number associated with them.
In summary:
1. Register a DDNS domain name with a DDNS provider.
2. Configure the Qnap or the router with the DDNS update information.
3. Make sure that the appropriate services are enabled on the Qnap.
4. Configure the router with the protocol and, if needed, port numbers associated with the services you want to enable. (TCP 9000 for Twonkymedia) so that it forwards packets with the desired protocol and port information to your Qnap server.
5. Connect to the server from the outside world using its DDNS domain name.
Hope this is useful.
Steve