I am just wondering if the following scenario is possible and how to implement this.

Suppose there are 2 DNS records from one of the Domain Services. Both records point to two different servers HTTP servers. Recently I had to replace those servers very often, every replacement involves changing IP address. Therefore first I had to create new server, change DNS record pointing to the new server, wait for few days when the old servers stopped receiving traffic and then deleted the old server.

I think to create the third server (something similar to haproxy by functionality) and point all DNS record to this new server and maybe distinct the traffic by ports. This third server based on port will decide where to send the traffic to. So the next time when I will have to change server I will change it only on my third server and delete the old one. That's all.

I assume haproxy is not the right tool use for this. I mentioned it because I am familiar with it and use it in inner network.

The question is what I need to use for the third server in order to navigate the traffic.


  • You forgot to tell what protocols are running on your server. Is it a web server, FTP server, email server...? – Khaled May 9 '12 at 8:11
  • @Khaled sorry, of course, there are http servers. – com May 9 '12 at 8:13

Haproxy is a very great tool for load balancing web servers. If I understand you well, you want to direct all traffic to haproxy node which you can control it easily to change the real servers IP and configuration.

Yes, this can be done using haproxy and it is a good to hide your real web servers. You can add the needed servers and remove them simply by modifying the configuration file and reloading haproxy process.

  • Thanks a lot, but I am not sure that haproxy is a proper tool for my purpose. Actually I don't need load balancing, I just need some kind of switch from 2 outside streams to two inside streams – com May 9 '12 at 8:38
  • @com: haproxy provides both of these two for you. It has the big advantage of understanding HTTP requests. So, you can direct the traffic in many different ways and not necessarily based on IP and ports. – Khaled May 9 '12 at 9:01

If you want to forward traffic based on port, I suggest just using IPtables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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