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

I've got two domains that are connected to one server (same IP). I want to domain1.example.com redirect to 1.2.3.4:12345 and domain2.example.com redirect to 1.2.3.4:12346. How can I do that? I can't do it in .htaccess because I want it to work from multiplayer game.

share|improve this question
    
What protocol are you using? DNS by itself doesn't support returning ports, http includes the url request in the headers, which is why apache is able to do redirects. Unless you say which protocol you're using, it's going to be rather hard to suggest a proper method. –  NickW Feb 12 '13 at 12:30
    
It uses TCP protocol. –  user158629 Feb 12 '13 at 12:39

2 Answers 2

This depends entirely on the protocol that the game uses. If it supports SRV records, use those. If not and it doesn't use HTTP, then you're going to have a hard time.

share|improve this answer
  • If it's just raw TCP, then you're out of luck, it can't be done.
  • If it's HTTP, then something could possibly be done maybe with a proxy to redirect traffic.
  • If it's something else, then you're going to have a hard time - it may even be impossible. To do this would require the client to include the target domain somewhere in the payload; HTTP achieves this by having a Host: header, but is primarly used so that multiple websites can be fed from the same <ip>:<port> endpoint.
share|improve this answer

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.