问题原文
原帖链接 · Mohammad Hossein Fattahizadeh · CC BY-SA 4.0
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.
社区高分解答
原帖链接 · Tommiie · CC BY-SA 4.0
I believe everyone focusses too hard on the BIND server. According to the Consul documentation, you only need BIND to forward the DNS queries from port 53 to port 8600 which Consul uses. Consul is the DNS server in this setup.
Consul uses checks to determine which of the two (or more) servers is (are) the "healthy" one(s).
Next it can respond with both A and SRV records as can be seen in the documentation.
So instead of asking us to read through the entire Consul documentation and come up with a working configuration for you, why don't you provide us with your configuration files and tell us what is not working as expected. That way we can more easily help you solve the issue at hand.
I need to tell bind ask record from consul but how?
The answer to that exact question is given in the documentation! PLEASE read the documentation!
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
