Hashicorp Certified Consul Associate 002 · Free Practice Question Medium
Question 14
Assuming Consul default configurations, which of the following DNS records would be used to access the service referenced by the following configuration:
- {
- "Name": "retail-app",
- "Service": {
- "Service": "inventory-app",
- "Tags": ["v1.2.3"],
- "Failover": {
- "Datacenters": ["dc2", "dc3"]
- }
- }
- }
-
A
inventory-app.query.service.consul
-
B
retail-app.query.consul
-
C
retail-app.service.consul
-
D
inventory-app.query.consul
Reveal correct answer
Correct answer: B
Explanation
The configuration provided in the question is a prepared query. The name of the prepared query is retail-app, therefore the DNS record used to query this prepared query is retail-app.query.consul since all prepared queries use the query namespace.
Technically, you could access the service directly by using inventory-app.service.consul and it would connect the user directly to the inventory-app without taking the prepared query into account.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
