CKA Troubleshooting Practice Question
You suspect a DNS issue inside a pod. Which command can you run to test DNS resolution from within a pod?
⚠ Common exam trap
CKA often tests whether candidates confuse observing DNS components (logs, Service descriptions) with actually exercising name resolution from the affected pod's network namespace.
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
✓
kubectl exec <pod-name> -- nslookup kubernetes.default
The correct command is `kubectl exec <pod-name> -- nslookup kubernetes.default`, which runs the DNS lookup from inside the existing pod's network namespace, using the pod's own /etc/resolv.conf and DNS policy. This directly tests whether the pod can resolve cluster DNS names through kube-dns/CoreDNS, which is exactly what a DNS issue inside a pod requires. Running nslookup from within the affected pod isolates the problem to that pod's DNS configuration rather than the cluster DNS service as a whole.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl logs coredns -n kube-system
Why it's wrong here
`kubectl logs coredns -n kube-system` streams the logs from the CoreDNS pod(s) running in the cluster. While these logs can reveal server-side errors, refused queries, or panic messages, they do not send a query from an application pod and cannot confirm whether the pod's resolver is configured correctly. Moreover, CoreDNS does not log every successful lookup unless verbose logging is explicitly enabled, so a clean log does not guarantee that a given pod can resolve `kubernetes.default`.
- ✗
kubectl describe svc kubernetes
Why it's wrong here
`kubectl describe svc kubernetes` displays the Kubernetes service object's metadata, including its ClusterIP, ports, and current endpoints. It reads from the cluster's API server, not from inside any pod, so it cannot exercise the pod's DNS resolver or its /etc/resolv.conf configuration. Even if the service were absent, this command would still succeed, making it useless for detecting DNS resolution failures from a workload's perspective.
- ✗
kubectl run test --image=busybox -- nslookup kubernetes.default
Why it's wrong here
This command creates a new pod running the `nslookup` command, which can test DNS resolution, but it requires creating a new pod rather than using an existing one. While it could work, it is not the most direct method when a pod already exists.
- ✓
kubectl exec <pod-name> -- nslookup kubernetes.default
Why this is correct
`kubectl exec <pod-name> -- nslookup kubernetes.default` runs the `nslookup` binary directly inside the target pod's network namespace. This uses the pod's own `/etc/resolv.conf`, including its `nameserver` (typically the kube-dns ClusterIP) and search domains (such as `default.svc.cluster.local`), to perform a real DNS query. It is the most direct way to verify that the pod can resolve a service name, because it replicates exactly what an application in that pod would experience.
Visual reference
Go deeper
Related to this question
Learn chapter
Kubernetes Architecture Overview
Key term
Ingress Resources
Ingress Resources are Kubernetes API objects that manage external access to services inside a cluster, typically HTTP and HTTPS traffic, by defining rules for routing requests based on hostnames and paths.
Key term
kubectl Command Reference
kubectl is the command-line tool used to interact with and manage Kubernetes clusters by sending commands to the Kubernetes API.
About these practice questions
This CKA question is part of Courseiva's 726-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CNCF exam blueprint
This CKA 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 CKA exam.