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 am looking for good practices for using load balancer haproxy.

There are few DNS records to the same haproxy server, haproxy has few backends with bunch of servers.

The question is what the best practice to manage few backend clusters:

  • 1st approach. On DNS server transfer all request to haproxy server IP port 80, and then on single common frontend routing traffic by using cal. This approach might became very complicated with even few backends, because for every backend we need to set acl.

  • 2st approach. On every single DNS record set the same haproxy server IP and different port for specific backend, then on haproxy set fronted for every IP:port interface. This approach seems like more simpler approach, but if there are any drawbacks.

What is the preferable solution for managing many backends on haproxy?

share|improve this question
There are a few DNS records ... ? What type of records? SRV? AAAA? Second problem/personal peeve: You use the pronoun it, bad idea in "IP port 80 and then it" – ArrowInTree Dec 25 '12 at 15:16
there are A records – com Dec 25 '12 at 16:08
IP Port 80 is an application layer service aka Layer 7 in 7 layer network model. DNS is layer 3. Keeping these layers separate is VERY important. see this… – ArrowInTree Dec 25 '12 at 18:21
@ArrowInTree, Thank you very much for the comment, what does it mean in context of my problem, should I separate it by assigned port and make dedicated frontend for each backend? – com Dec 25 '12 at 18:58
What I am trying to say is http is dependent on dns, unless you give an explicit address: eg <code>" "</code>. DNS is typically configured with a primary and a secondary server (google's eg and This should not require a failover on your part. What you do seem to need is forwarding or tunneling. Tunneling can be done with ssh. – ArrowInTree Dec 25 '12 at 19:34

HAProxy is about the application layer, #7 in the 7 layer OSI model. DNS is below this level. DNS has its own scale up model: secondary servers. Google's DNS has a primary at and a secondary at . These addresses are very well know on the internet, so they do not need resolving. DNS for the record operates at level 4, Transport see this diagram: here

But HAProxy's documentation does mention bind, a DNS Server implementation, here.

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.