CKAD Services and Networking Practice Question
A pod in namespace 'default' cannot resolve the service name 'db' in namespace 'data'. Which DNS name should the pod use to reach the service?
⚠ Common exam trap
A common mix-up: candidates confuse the order of service and namespace in the DNS name, incorrectly placing the namespace before the service (as in option B) or misplacing 'svc' (as in option D), instead of remembering the correct pattern <service>.<namespace>.svc.cluster.local.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
db.data.svc.cluster.local
Kubernetes DNS resolves a service in another namespace using the format <service>.<namespace>.svc.cluster.local. Since the service is named 'db' in namespace 'data', the fully qualified domain name (FQDN) is db.data.svc.cluster.local. This allows cross-namespace service discovery without needing to modify the pod's DNS configuration.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
db.default.svc.cluster.local
Why it's wrong here
The DNS name `db.default.svc.cluster.local` tells the resolver to look for a Service named `db` in the `default` namespace. However, the Service you are trying to reach is actually in the `data` namespace, so this FQDN points to the wrong namespace and will not resolve to the correct ClusterIP. When a Service is in a different namespace, the namespace portion of the FQDN must exactly match that namespace; otherwise the lookup fails.
- ✗
data.db.svc.cluster.local
Why it's wrong here
This option reverses the required order of the Service name and namespace. Kubernetes DNS for Services follows the pattern `<service>.<namespace>.svc.cluster.local`, so placing `data` before `db` makes the resolver look for a Service named `data` in a namespace named `db`, which does not exist. The correct FQDN must always list the Service name first and the namespace second.
- ✓
db.data.svc.cluster.local
Why this is correct
This FQDN correctly follows the Kubernetes DNS schema for cross-namespace Service discovery: `<service-name>.<namespace>.svc.cluster.local`. Here `db` is the Service name and `data` is the namespace, so a pod in the `default` namespace can resolve this name to the Service's ClusterIP. Using the full FQDN is required when the Service is in a different namespace than the pod, as a short name would only work within the same namespace.
- ✗
db.svc.data.cluster.local
Why it's wrong here
The token `svc` is a fixed part of the DNS hierarchy that must appear after the namespace, not before it. Placing it as `db.svc.data.cluster.local` creates the structure `<service>.<svc>.<namespace>.cluster.local`, which does not match the standard Kubernetes DNS pattern and therefore will not be resolved by the cluster's DNS service. The order of labels in an FQDN is significant, and any deviation from the expected schema results in a DNS resolution failure.
Visual reference
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 826-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.