I need to know is there any solution for solving my problem. I have a BIND DNS server and consul as service discoverer. This is what i want as simple diagram:
How can I configure this sample setup and let BIND just resolve the A record to the IP address of the healthy load balancer server?
If the client queries the DNS server for the A record of domain.example
, it must get the IP address of the Healthy (192.168.1.100
) server
The sample configuration of consul for DNS shows how to configure SRV records, not A records. How can I get it to work with A records for the healthy server.
I need to tell bind ask record from consul but how? My example zone file:
$TTL 300 ;
$ORIGIN example.com.
@ 1D IN SOA ns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; nxdomain ttl
)
www IN A 192.168.0.2 ; how can i tell bind using consul as IP resolver on this record
consul using port for resolving and how can i tell bind to use consul instead.