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 know that it is not possible to configure DNS so that different subdomains get pointed to the same IP, but with different ports. I.e.: :550 :560

Because DNS only provides names and addresses - no port numbers.

I have several subdomains, though they are not all for web applications. For example, some of them are been used for terminal servers, other are for mail servers etc.

For this reason, I need different port and I dont want to make the port fixed in the local machine .

Maybe the solution is by setting up proxy servers for those addresses. They can proxy requests or setting up server for the ports that can provide them to the client.

Can you please help me find the best solution?

share|improve this question

closed as not a real question by Sirex, Khaled, Sven, Ward, Iain Dec 24 '11 at 9:06

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

It is not clear what you are trying to do! If I access without any port, what does this mean? I should be connected to port 550? – Khaled Dec 22 '11 at 13:30
-1; question is /completely/ unreadable and sounds like gibberish even after @Khaled 's attempt at editing. I'm not even going to try giving an answer until I have some idea what the question actually is... – Shadur Dec 22 '11 at 13:36
if i the server dont give any port , the client dont have any permission to enter the service that i provide. so the server must provide an ip with port so the client access it . – steevoo Dec 22 '11 at 13:39
You need to provide more clarity on what you're trying to achieve. It helps if you work 'backwards' and tell us what you want to end up with, rather than what solution you're trying to engineer to get there. – Dan Dec 22 '11 at 13:40
@steevoo I'm afraid that makes zero sense. Ports are application dependent. If I put an IP address into an FTP client, it'll try and connect on port 21 by default. Internet Explorer will try and connect on Port 80 and so on. If you've written some custom service listening on a non-standard port then your client application will have to type that manually. There MAY be ways around that, but we'd need more detail. – Dan Dec 22 '11 at 13:41

The question is unclear, but there are knowledge bits that may help you :

  • DNS has nothing to do with ports. It returns IP adresses.
  • Unlike what you say, It's perfectly licit to have two names/domain/subdomain pointing on the same IP address.
  • It's perfectly possible to host several websites (with different names) on the same web server. it's called "multi homing" and it works with the server recognizing which site the client is trying to access because it's in the web query. See "apache multi homing" on google on how it works.
  • If you need to access other services (like mail) with different names, just use different ports. It's easy to decide that is on port 1001 and is on port 1002. What confuses you is that those services use default ports which are not expressed. But when explicitely deciding the port to use, there is no more confusion.
  • for terminal service, well, it's the same machine so who care about using different ports for different names ?

P.S. not sure about how smtp (mail) works. Maybe it's possible to do multi-homing for it, too.

share|improve this answer
so there is no way to provide the port to the client ????? – steevoo Dec 22 '11 at 14:22
@steevoo well, you just give it manually. Look at this page : google gives us the ports on which we should access its mail servers. And we put them in our software. Can you be more explicit on your requirements ? Concrete example ? – Offirmo Dec 22 '11 at 14:49

I think the answer you're looking for is "No".

There are ways to redirect ports and so on, but ultimately, your client software has to make a request on a port, whether that be entered by the user or written into code or whatever. Either way, it's a client-side issue and you can't solve it server side. They aren't able to just make a request to an IP address in general.

As an example, when you type to in your address bar, Internet Explorer is really going to

There's no magic here, it just makes the assumption that a website is going to be on port 80 as that's the official port. The developers could just have easily forced us to choose each time, but they opted to be nice.

If the website was on port 81 for some reason the request would simply fail and you'd have to manually type

share|improve this answer

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