Newbie question: automatically forward query to all datacenters?

I am like three days old/new to consul. Say I have two data centers separated across WAN - sjc and nyc. And I want to be able to do a dns SRV query in sjc for a service thats registered in nyc. But i dont know exactly that the service is in nyc, so I dont want myself to to do a query to each data center one by one - can consul do a local dc lookup and if that fails just query all other DCs ?

As a “hack” I tried configuring both the sites as a single DC and configured wan join on the servers, it joined all fine, and I expected that within a data center all the servers will sync the services even if its over wan gossip, but that doesnt seem to happen.


Sounds like a Jobs for failover with prepared queries:

Thanks. Yes I saw the prepared query section where I can specify an order of DCs to forward the query to. So we cant achieve the same with the standard DNS / SRV lookup ?


Hi @gopakumarce ,

Prepared Queries support both A and SRV record DNS lookups. See for more info.

Hi All,

This is a newbie question sorry for that.

I have a two different understanding of consul

  1. Is consul a network tool
  2. used as a persistent storage for Vault HA support.

Can someone please point me with a doc that has deep explaining or help me understand it.

Hi @ks5564,

This video should be helpful in understanding Consul as a service networking platform.

Consul can be used as a data store for Vault, but that barely scratches the surface of the functionality Consul offers.