Hello,

I have a question regarding Peers .  I am currently trying to set up 2 HaProxy 
instances as Docker containers.  Please see my peers configuration below:

resolvers dns-resolver
  parse-resolv-conf
  nameserver dns1 127.0.0.11:53
  resolve_retries       3
  timeout resolve       1s
  timeout retry         1s
  hold other           30s
  hold refused         30s
  hold nx              30s
  hold timeout         30s
  hold valid           10s
  hold obsolete        30s

peers haproxy-peers
  bind *:65000
  log stdout local0 debug
  default-server check resolvers dns-resolver init-addr last,libc,none 
resolve-prefer ipv4
  server "$HOSTNAME" # local peer
  server haproxy_node_2 haproxy_node_2:65000

I know the DNS resolver is correct as it points to 127.0.0.11 which is the 
Docker internal DNS IP.

My question is, can I setup peer entries using the DNS name and not the IP?  
The reason I rather want to use DNS is because I can't control the IP that is 
assigned the Docker container on the internal Docker network.

Any suggestions or advice?

Let me know if you require any additional information.

Kind regards,
Marthinus Kruger

Reply via email to