If you only have one public IP, you can't do that for most services.
For web servers, you can try to use a reverse proxy. There are a couple packages, mod_proxy and haproxy that might be able to do this by name.
For other services, they do not differentiate based on the hostname used, only the IP address. You'd have to use different port numbers for each domain.
On the other hand, if you have multiple public IPs, just setup 1:1 NAT between the public IP for that hostname and the private IP you want it to match up with.