No problem.
Computers use DNS (domain name system) to resolve host names to IP addresses. When you setup the TCP/IP properties for a network connection, you either specify the DNS server statically, or you set up your DHCP server to give out the DNS server address when it hands out host IP addresses.
So, when you type, for example,
www.google.com in your browser, your computer sends a query to whatever DNS server it is pointed to and asks what the IP address is. If that DNS server doesn't know, it will usually forward the request up a root DNS server or other server to try to resolve the address. If your computer receives an IP address in response, then it goes ahead and forward the request for the google web page off to that IP address. If it gets no IP address, you get the server cannot be found error in your browser. Thus, when you say that putting the IP address in the terminal server page works, but using the hostname doesn't, it makes me suspect a DNS lookup problem.
Now, you say that putting in
www.mydomain.com works for external users to get to your terminal server which should be true as you say that you have registered your domain and that host with your provider. So external look up are fine. But when you put the hostname in the terminal server box, that is where it fails. So the terminal server is not connecting the hostname with the IP address.
So, the question now is how is your terminal server set up for DNS.
If you have a Windows active directory domain structure, then you will have at least one internal server that is running DNS. You can't setup a Windows domain controller without one. So if you have a Windows domain, then your terminal server is probably pointing at your internal DNS server.
Now, this wouldn't cause a problem if your internal domain is different from your public domain name. So, your Windows domain could be something like mydomain.local, but all of your public-facing servers are mydomain.com. In that case, when you terminal server asks your DNS server for the IP address of
www.mydomain.com, your DNS server says "I don't know, but I only know the addresses for mydomain.local. Let me send that off to try to find the IP address for you." And then it eventually gets a response back from your DNS hosting provider and gives you the correct IP address.
But, if your internal domain name is mydomain.com and your public-facing domain name is also mydomain.com, then when your terminal server asks your DNS server for the IP address of
www.mydomain.com, your DNS server says "I don't have a record of a host named 'www'. I'm in charge of this domain so if I don't have this record then no one does. Therefore there is no such server." This problem can be overcome by manually entering host records on the internal DNS server for all of your public-facing servers -- basically duplicating all of the entries you have your DNS hosting company make.
Anyway, that is all assuming that your internal network is a Windows domain with a DNS server. If you only have this one server, and it is pointing out to a DNS server on the internet somewhere, then there is another problem, but probably still related to DNS.