I have a net with 2 DNS servers (master & slave), but I don’t want clients to ask directly to them. So, in the same net, I have a debian machine with haproxy 1.7.5 installed. I want clients to have in their /etc/resolv.conf file the IP of the proxy. I want the proxy to balance the load between the two servers.
IP DNS master = 10.10.24.2
IP DNS slave = 10.10.24.4
IP PROXY = 10.10.24.5
In the file /etc/haproxy/haproxy.cfg at the end, I added:
resolvers mydns nameservers dns1 10.10.24.2:53 nameservers dns2 10.10.24.4:53
Then I start haproxy:
haproxy -f /etc/haproxy/haproxy.cfg
If I execute in the proxy:
I get these two new lines:
udp 0 0 10.10.24.5:35000 10.10.24.2:53 ESTABLISHED udp 0 0 10.10.24.5:35000 10.10.24.4:53 ESTABLISHED
But I was expecting to receive something like this:
udp 0 0 10.10.24.5:53 10.10.24.2:53 ESTABLISHED udp 0 0 10.10.24.5:53 10.10.24.4:53 ESTABLISHED
Obviously, the DNS requests from clients to the proxy aren’t working…
Is it possible to achieve this using haproxy?