CKAD Services and Networking Practice Question
You have a headless Service for a StatefulSet. What is the DNS resolution behavior for the StatefulSet pods?
⚠ Common exam trap
Many candidates confuse headless Services with regular Services, assuming they still provide a single virtual IP for load balancing, or mistakenly think DNS is disabled, when in fact headless Services rely entirely on DNS for direct pod resolution.
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
✓
Each pod gets a DNS A record pointing to its individual IP.
For a headless Service (clusterIP: None) associated with a StatefulSet, DNS resolution returns individual A records for each pod, mapping the pod's hostname (e.g., pod-name.service-name.namespace.svc.cluster.local) to its unique pod IP. This is because headless Services disable load-balanced cluster IPs and instead rely on DNS to provide direct pod-to-pod connectivity, which is essential for StatefulSet workloads like databases that require stable network identities.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
DNS is disabled for headless Services.
Why it's wrong here
Headless Services do not disable DNS; they change how DNS records are published. While a regular Service creates a single A record for its ClusterIP, a headless Service (spec.clusterIP: None) is still registered in CoreDNS/kube-dns, but the Service name resolves to multiple A records — one for each ready pod's IP. For a StatefulSet, each pod also gets a stable pod DNS name that resolves to its individual IP, so DNS is clearly active.
- ✗
The Service name resolves to the IP of the first pod only.
Why it's wrong here
A headless Service does not resolve to a single 'first' pod IP; DNS returns every ready pod IP as a separate A record for the Service name. The set of records contains all pod IPs, and the client (or DNS resolver) may choose one, but there is no ordering or preferred first pod defined by the Service. The per-pod stable DNS names (pod-name.service-name.namespace.svc.cluster.local) are what identify individual pods, not a single-IP resolution of the Service.
- ✗
All pods share a single cluster IP via the Service.
Why it's wrong here
That behavior describes a regular ClusterIP Service, which fronts all pods with one virtual IP that load-balances traffic via kube-proxy. A headless Service explicitly sets clusterIP: None, so no single virtual IP exists. Each pod in the StatefulSet retains its own unique IP, and DNS directly exposes those IPs instead of routing through a shared gateway, so all pods do not share a cluster IP.
- ✓
Each pod gets a DNS A record pointing to its individual IP.
Why this is correct
With a StatefulSet bound to a headless Service, Kubernetes publishes a stable DNS A record for each pod in the format pod-name.service-name.namespace.svc.cluster.local, pointing to that pod's specific IP address. This works because the StatefulSet gives each pod a stable hostname (e.g., mydb-0, mydb-1) and the headless Service's selector causes the DNS controller to create an A record for each ready pod. These records persist even if the pod is rescheduled, because the pod name (and hence its DNS entry) stays the same, providing consistent network identity for the stateful workload.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.