HashiCorp · Free Practice Questions · Last reviewed May 2026
30 real exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
You have a service that requires specific routing logic based on the environment. How can you distinguish between 'production' and 'staging' instances of the same service name using metadata?
Use different service names for every environment.
Modify the service's port number.
Apply 'production' or 'staging' tags to the service definition.
Consul tags are arbitrary key-value metadata attached to a service registration, so tagging instances 'production' or 'staging' lets upstream routing, such as prepared queries or intentions, select the correct subset by tag rather than by service name alone.
Assign different Consul datacenters.
An administrator needs to query service information. Which DNS record type is commonly used by Consul to return service addresses?
TXT
MX
CNAME
SRV
Consul's DNS interface publishes SRV records that carry both the target hostname and the service port, letting clients discover where a service listens. A records return only addresses, so SRV is the record type that answers service-address queries.
A service is intermittently failing to resolve via DNS because it has multiple health checks, some of which are 'warning'. How do you ensure it is only returned when all checks are 'passing'?
Configure 'service_prefix' in DNS settings.
Use the 'stale' query parameter.
Set 'enable_tag_override' to true.
Use the 'passing' query parameter in the DNS request.
The 'passing' query parameter filters DNS responses so only instances whose health checks are all passing are returned, excluding any with warning or critical states. This satisfies the requirement that the service resolve only when every check passes.
What is the purpose of the 'service-tag' in a Consul service definition?
To provide additional categorization or versioning for services.
Service tags supply arbitrary metadata labels that Consul exposes through the catalog and DNS interface, enabling categorisation, versioning and filtered queries. This satisfies the stem's requirement to describe the tag's purpose: attaching non-functional identifiers to a service registration for discovery and grouping, rather than configuring health checks or routing behaviour.
To define the physical location of the server.
To set the priority of the service in DNS.
To encrypt communication between services.
When using Consul DNS for a service, what happens if no instances are healthy?
It returns a 500 error.
It redirects to a standby service.
It returns an empty response (NXDOMAIN or empty set).
Consul DNS suppresses unhealthy instances from service lookups, so when every instance fails its health check, the query yields no records — NXDOMAIN or an empty answer set — rather than stale addresses. This satisfies the stem's requirement by preventing clients from receiving unreachable endpoints, letting them fail fast instead of timing out.
It returns all instances regardless of health.
A service definition includes a 'meta' block. What is the intended use of this block?
To configure service discovery timeouts.
To define arbitrary key/value metadata for the service.
The meta block stores arbitrary user-defined key/value pairs attached to a service, such as version, owner or environment labels. It is purely descriptive metadata, not configuration, and does not affect health checking, routing or service discovery behaviour.
To override the default health check interval.
To store authentication credentials.
Want more Service Discovery practice?
Practice this domainWhich protocol do Consul servers use to maintain the WAN gossip pool?
gRPC
DNS
Serf (SWIM)
Consul servers use the Serf library, which implements the SWIM gossip protocol, to exchange membership and failure-detection messages across the WAN gossip pool. SWIM's infection-style dissemination lets datacentre servers converge on membership state without a central coordinator.
HTTP
In a multi-datacenter environment, what happens if the 'primary_datacenter' server cluster becomes unavailable?
Secondary datacenters elect a new primary.
Secondary datacenters continue to operate, but ACL updates are blocked.
Secondary datacentres keep serving their local workloads because each maintains its own replicated state, but ACL token and policy updates originate from the primary and cannot propagate. The outage therefore blocks only ACL changes, not ongoing operations.
All secondary datacenters immediately shut down.
The entire WAN federation is dismantled.
You have enabled ACL replication between a primary and secondary datacenter. What is the effect of changing an ACL policy in the primary datacenter?
The changes only propagate if the secondary is in maintenance mode.
The changes require a manual trigger on secondary servers.
The changes are ignored by secondary datacenters.
The changes are asynchronously replicated to all secondary datacenters.
ACL replication in Consul propagates token and policy changes from the primary to secondary datacenters asynchronously, satisfying the stem's cross-datacenter consistency requirement without blocking primary writes. Secondaries receive updates shortly after the primary commits them, so the change is not instantaneous but eventually consistent across all secondary datacenters.
You are troubleshooting a partition between two datacenters. The WAN gossip shows high latency. Which Consul CLI tool provides the best insight into the WAN gossip state?
consul operator raft list-peers
consul members -wan
`consul members -wan` queries the WAN gossip pool directly, listing every datacenter's server agents with their gossip status and round-trip latency. That satisfies the stem's need for insight into WAN gossip state under high latency, unlike LAN-scoped commands or RPC-based tooling that bypass the gossip layer entirely.
consul monitor
consul kv get
How do you enable WAN federation between two Consul datacenters that do not share a network?
By disabling ACLs.
By increasing the gossip interval.
By using a load balancer in front of the servers.
By deploying Mesh Gateways.
Mesh gateways route server-to-server RPC traffic between datacenters over the WAN, so datacenters without direct network connectivity can still federate. Each gateway proxies traffic on behalf of its local servers, satisfying the stem's no-shared-network constraint without requiring VPN tunnels or routed peering.
You are joining two Consul datacenters via WAN gossip. Which command must be executed on a Consul server in the secondary datacenter to initiate the federation?
consul members -wan
consul join -wan <remote-server-address>
The -wan flag directs the join request over the WAN gossip pool rather than the LAN pool, which is the only way to federate separate Consul datacenters. Running consul join without -wan would attempt a LAN gossip join and fail to establish cross-datacenter federation.
consul reload -wan
consul agent -join-wan
Want more Multi Datacenter Federation practice?
Practice this domainYou are monitoring service health using Consul and want to ensure that a service is automatically removed from the catalog if it remains in a 'critical' state for more than 24 hours. Which configuration key supports this?
cleanup_interval
critical_timeout
deregister_critical_service_after
deregister_critical_service_after specifies the duration a service may remain critical before Consul automatically removes it from the catalog. Setting it to 24h satisfies the requirement, unlike checks or timeouts that only affect health status without deregistering the service.
remove_service_after
A service has a TTL check configured with a 30-second TTL. If the application crashes and stops sending heartbeats, when will the service status change to 'critical'?
After 60 seconds
Once the agent restarts
Immediately
After 30 seconds
A TTL check expects a heartbeat within its TTL window. Once 30 seconds elapse without one, Consul marks the check critical, so the service status changes immediately at that expiry rather than after a further grace period.
When defining a TCP health check, what is the primary indicator that the check is 'passing'?
The port is listed in netstat
The service responds with a specific string
The service returns a 200 OK
The agent receives a successful TCP handshake
A successful TCP handshake confirms the target port is open and accepting connections, which is the sole pass criterion for Consul's TCP health check. Unlike HTTP checks, no status code or payload is evaluated, so the SYN-ACK response itself satisfies the check's passing condition.
Which HTTP status code range does Consul interpret as a passing state for an HTTP health check?
3xx
Any code less than 500
1xx
2xx
Consul's HTTP health check treats any response in the 2xx range as passing, marking the service healthy. Other ranges (3xx redirects, 4xx client errors, 5xx server errors) are interpreted as failing or warning states, so 2xx is the only range that satisfies the passing-state requirement.
You are deploying a legacy application that does not support HTTP or TCP health checks. Which Consul health check type should you configure to allow the application to signal its own health via a heartbeat API call?
TTL check
A TTL check inverts the model: the application must periodically call Consul's HTTP pass endpoint to reset the timer, and Consul marks it critical if the heartbeat lapses. This suits legacy apps lacking HTTP or TCP endpoints, since they signal health themselves.
HTTP check
TCP check
Script check
Which command line tool can you use to manually trigger a TTL check update for a specific service?
consul kv put
curl -X PUT http://localhost:8500/v1/agent/check/pass/checkID
Consul's HTTP API exposes agent check endpoints, so a PUT to /v1/agent/check/pass/checkID marks the named TTL check as passing and resets its timer. This is the documented manual method for pushing a TTL check update without waiting for the service to report.
consul agent -check-update
consul health update
Want more Health Checking practice?
Practice this domainWhat does the 'kind' field in a service definition specify for a Consul Connect service?
The proxy type (e.g., 'connect-proxy').
The `kind` field declares the service registration type, with `connect-proxy` marking a sidecar proxy instance rather than a standard service. This satisfies Consul's requirement to distinguish proxy registrations from application services, enabling Connect to route traffic through the correct proxy for mTLS enforcement.
The service version.
The datacenter location.
The language of the application.
Which component acts as the default sidecar proxy for Consul Connect?
Nginx
HAProxy
Envoy
Envoy is the default sidecar proxy that Consul Connect injects alongside services, handling mTLS and L4 authorisation between them. It satisfies the stem because Consul ships Envoy as the built-in proxy, though the interface allows alternative proxies to be registered.
Linkerd
When using 'Consul Connect native' integration, how does the application handle mTLS?
mTLS is disabled by default for native apps.
The application uses the local Consul agent API to fetch identity certificates.
With Consul Connect native integration, the application itself performs mTLS by calling the local Consul agent's API to obtain its leaf identity certificate and CA bundle, then uses those credentials directly for encrypted, authenticated service-to-service communication.
The sidecar proxy handles all mTLS.
The Consul agent performs the TLS handshake on behalf of the app.
You have a service that needs to talk to a service in a different datacenter. What configuration is required?
Direct VPC peering.
An external service definition.
A global intention.
A mesh gateway deployment.
Cross-datacenter service-to-service traffic traverses the WAN through mesh gateways, which proxy Consul's mTLS connections between datacenters. Deploying a mesh gateway in each datacenter is required so the local sidecar can reach the remote service without direct network peering.
You need to deny all traffic between 'service-a' and 'service-b' using intentions. What is the most efficient way to achieve this?
consul intention create -allow-none service-a service-b
consul intention set -action=drop service-a service-b
consul intention create -deny service-a service-b
This command directly creates a deny-type intention.
consul intention delete service-a service-b
Which command displays all active intentions in the Consul mesh?
consul connect intentions
consul kv get intentions
consul intention list
`consul intention list` queries the intention endpoint directly, returning every active intention across the mesh with source, destination and action. It satisfies the stem's requirement to display all active intentions without filtering by service name, unlike `consul intention check`, which tests a single source-destination pair.
consul services intentions
Want more Service Mesh With Consul Connect practice?
Practice this domainWhen using the Consul KV store, what is the maximum size allowed for a single value in a key?
There is no limit.
128 KB
1 MB
512 KB
Consul's KV store caps each individual value at 512 KB, a hard limit imposed by the Raft replication and storage layer. Larger payloads must be split across multiple keys or stored externally, so 512 KB is the precise maximum for a single key's value.
Which Consul API endpoint is used to create a new session that can be used for locking KV keys?
/v1/kv/acquire
/v1/session/create
Consul creates lock sessions through the session endpoint, which returns a session ID used as the lock-delimiter when acquiring KV locks. The /v1/session/create path is the documented API for this, unlike destroy or renew operations.
/v1/lock/init
/v1/session/renew
You are configuring a Consul Watch to trigger a script whenever a specific KV key changes. Which type of watch should you define in your configuration file?
event
service
key
A key watch monitors a single KV pair path and fires its handler whenever that key's value changes, matching the requirement to trigger a script on one specific key. Other watch types cover prefixes, services, nodes or checks, not individual key modification.
nodes
You have implemented a leader election mechanism using Consul KV sessions. The session has a TTL of 15 seconds. If the application crashes, how long will it take for the lock to be automatically released?
Immediately.
60 seconds.
The lock is never released until manually deleted.
15 seconds.
The session TTL defines the duration after which an un-renewed session is invalidated, releasing associated locks.
You observe that a session lock is being released unexpectedly. What is the most likely cause?
The Consul agent is in leader mode.
The index was not incremented.
The session TTL is too low, causing premature expiration.
A session lock is released when its TTL elapses, so a TTL set too low expires the session prematurely and frees the lock without any explicit release call. This directly satisfies the stem's unexpected-release constraint: Consul's lock is tied to session lifetime, not to client intent.
The KV key was deleted.
You want to perform a blocking query on a KV key to watch for updates. Which parameter must you provide in your request based on the last observed index?
consistency
wait
index
Supplying the index parameter tells Consul to hold the blocking query open until the KV store's modify index exceeds that value, returning only on change or timeout. This satisfies the stem's requirement to watch for updates based on the last observed index, avoiding repeated polling.
timeout
Want more Key Value Store practice?
Practice this domainThe vendor does not publish an exact question count for the Consul 1.15. Always confirm current details on the vendor's official exam page.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 5 domains: Service Discovery, Multi Datacenter Federation, Health Checking, Service Mesh With Consul Connect, Key Value Store. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official HashiCorp Consul 1.15 exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.