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

Just curious if this is possible. Lets assume i run a pair of irc servers (or anything else) on a system with different ports- i'd like to have something listen into a single port, and forward packets based on hostname - any connections to should be forwarded to one port, and any connections to should be forwarded to another. Most proxies seem to be for http, and well, that's not the use case i have in mind.

I'm currently running ubuntu server 9.04 and 10.04, though i'd be willing to switch to another free OS to do this.

share|improve this question

I'm assuming that and resolve to the same IP.

There wouldn't be any way to do it without some sort of Application Layer proxying. You could use an HTTP or a SOCKS proxy connection on your clients so you can switch the connection based on hostname. You could probably also set up an IRC MitM that detects the hostname the client is trying to connects to, then handsoff to the correct server, but I don't know if the IRC protocol would provide enough info to do that.

share|improve this answer

You could use SQUID as a transparent proxy to accomplish this. It doesn't have to be HTTP.

But really, you have two different hostnames. You can point them to two different IPs and DNAT the traffic accordingly.

share|improve this answer
Assuming the clients can use an HTTP proxy. – jdizzle Mar 10 '10 at 16:43
Huh?… – Warner Mar 10 '10 at 16:58
a little most detail would help. most references to squid seem to do with http proxying – Journeyman Geek Mar 10 '10 at 23:15
Is there a reason why you can't pursue the DNAT solution? – Warner Mar 10 '10 at 23:21
I have a single ip address - if i understand DNAT correctly it is forwarding to nated ip by destination?. I might be wrong- so a specific example for a similar situation might help – Journeyman Geek Mar 12 '10 at 11:15

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.