Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have a [game] server (CentOS) that has about 10 used ports. For one game in particular, I have 2 servers: a private one and a public one.

The IP for them is the same, so to differentiate between them the user must use[portnumber].

Is there a way that I can configure CentOS to automatically take something like and transform it to[portnumber] or simple localhost:[portnumber]?

Is this what a DNS is for?

share|improve this question

migrated from Sep 11 '11 at 2:56

This question came from our site for professional and enthusiast programmers.

If it is completely your application and you have control over your DNS, you can define a SRV record for your game. Your clients have to understand then that you have defined a SRV record in order to give the user a way to use to access the server at the right port.

Sounds complicated and nearly unfeasible if you just use an existing game server and host it, but it is the only way to include a port number in DNS.

If this is not possile, just take the "normal" port for the public server (so that the user does not have to worry about), and the "other" port for the private server (where you have to specify the port, but the user base is limited s the "total sum of worries" is smaller.)

share|improve this answer
The important takeaway here is that the client would need to understand it must request an SRV record, meaning generally this type of setup must be accounted for when the client is designed. – Bacon Bits Sep 11 '11 at 4:23

Is this what a DNS is for?

No, not really. DNS is for resolving domain names to IP addresses. Port numbers are determined by the application.

If you need to run multiple instances of a service on the same port, typically you need to employ a server that understands multiple instances (such as Apache with VirtualHosts), a superserver of some kind, multiple IP addresses, or a firewall capable of deep packet inspection which can determine the correct Port Address Translation to use (but in that case the firewall must understand the application protocol being used).

share|improve this answer

Your Answer


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