Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got two domains that are connected to one server (same IP). I want to redirect to and redirect to 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

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


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.