Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been running a small game server for a while and want to set up a second one on the same server. The issue is that these servers don't support domain names; if a request comes in on the right port (22565)it doesn't matter what domain was being visited unlike say apache with its vhosts).

So my only option is to setup one game server on the default port (25565), and the other on another port (25564).

So to my question: is it possible to remap a port (in this case 25565 to 25564) if it comes in from a specific domain? (I have two subdomains both pointing to my server: mc, mcold; and would like to redirect all traffic sent to 25565 to 25564 if the user came from the subdomain mcold).

Thanks for any help,
Max

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

tl;dr: No.

In order to do this sort of thing, the game client would need to support it, and it's highly unlikely that it does. In the case of web serving, the clients (a web browser) send the domain name along in the HTTP request as a host header. This way, the server knows which domain was used.

In the case of your game, however, this is not possible. The clients look up the domain name when they start up and then all subsequent access is via IP only.

Your best bet is to see if you can obtain an additional static IP address for the server.

share|improve this answer
    
Could you give a quick sentence how how to do it if I had a second IP? –  mazzzzz Aug 20 '12 at 19:34
    
One game server instance would listen on one IP and the other would listen on the other IP. One domain would point to one IP and the other would point to the other IP. –  EEAA Aug 20 '12 at 19:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.