Consul
Consul DNS reference
This page provides reference information for using Consul’s Domain Name System (DNS). You can use the Consul DNS to format network addresses, lookup information about specific service instances, and configure failover strategies.
If you run Consul on Kubernetes, you can use KubeDNS instead of Consul DNS. Refer to onboard services in transparent proxy mode for more information.
Consul DNS syntax
The following table lists elements of a Consul DNS address, how to format the element, and their default values. Elements are listed sequentially according to their order in a properly configured DNS address. Unless explicitly modified, all Consul DNS requests address the .consul
domain by default.
Network element | Consul DNS syntax | Default value | Requires Enterprise License |
---|---|---|---|
Service Record (SRV) | _<service>._<protocol> | None | ❌ |
Custom tag | <tag>. | None | ❌ |
Service | <service>.service | None | ❌ |
Service mesh enabled service | <service>.connect | None | ✅ |
Virtual service | <service>.virtual | None | ✅ |
Ingress-enabled service | <service>.ingress | None | ✅ |
Node | <node>.node | Node where the DNS query runs | ❌ |
Namespace | <namespace>.ns | default | ✅ |
Admin partition | <partition>.ap | default | ✅ |
Prepared query | <query>.query | None | ❌ |
SRV prepared query | <query>._<protocol>.query | None | ❌ |
Datacenter | <datacenter>.dc | Datacenter where the DNS query runs | ❌ |
Cluster Peer | <cluster-peer>.peer | None | ❌ |
Sameness group | <sameness-group>.sg | None | ✅ |
Domain | .<consul> | consul | ❌ |