I've asked this question previously at serverfault.com (what I believe to be the more appropriate site for this question, however, it was closed unanswered moments later and I was referred here. My question, I have 5 services running on one server. A webportal to a torrent client on port 8112, a Minecraft server on 25565, a Plex media server on 32400, and apache2 running on port 80. I currently have a subdomain of a domain I own from godaddy, pointed to my home ip address. Everything works fine that way. However, I'd like to have multiple subdomains for each service, but not have them all resolve by just changing the port. For example. Right now, if I were to go to minecraft.myaddress.com:32400, I'd be forwared to the plex media server. Is there a way to keep subdomains from resolving if not the correct name?
No, there is not. The way connections work is that the person connecting first looks up the IP address for that domain name, and only once they get the IP address do they make the connection attempt. The port number only comes into play on the second part; DNS maps domain names to IP addresses, and doesn't know or care what port you plan to connect to.
That said, depending on the protocol, you may be able to configure the server on your box to only serve to the "right" domain names. I know that Apache can be set up to serve different content from the same IP depending on what domain name was entered in, and I believe mail servers are similar. However, this is only possible because HTTP sends the domain name once the connection is established; in general, though, the domain name is only used to find the IP.