Trouble with DNS Resolvers sticking to single IP address


If anyone wants to try out 1.8-dev2 dns resolvers, I have setup a docker demo:

You would probably need to reconfigure the hard coded IP addresses. Will get around to making it env based soon.


Asking @willy to release 1.8-dev3, so that all those changes can be easier tested in the field.


Asking myself the same question.

From the Docker Docs:

To bypass the routing mesh, you can start a service using DNS Round Robin (DNSRR) mode, by setting the --endpoint-mode flag to dnsrr. You must run your own load balancer in front of the service. A DNS query for the service name on the Docker host returns a list of IP addresses for the nodes running the service. Configure your load balancer to consume this list and balance the traffic across the nodes.

How do I actually do that with HAProxy?


Well, either you set multiple server line with the same name:
backend myapp


server s1 check resolvers mydns

server s2 check resolvers mydns

server s3 check resolvers mydns

Or you use server-template directive:

backend myapp


server s 3 check resolvers mydns

Adjust the number of servers to your need.

In each case, the resolvers should turn on one server per IP found in the response.