大网数据广告活动
服务器运维问答

DNS layer with service discover as resolver not SRV

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-08-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。