I have HostA and HostB which both register service XXX with Consul. The hosts both pass the health checks so a DNS query for “XXX.service.consul” returns 2 IP addresses in round-robin order.
Is there a way to tell Consul that HostB is really a backup/failover service, so while HostA is alive and healthy, HostB’s IP address should not show in DNS (i.e. should be excluded from DNS responses)?
It’s true I can assign different weights but this does not affect A records, only SRV records.