Bird
0
0

You want to debug why a pod cannot reach a service by DNS name. Which two commands help diagnose this issue?

hard📝 Application Q9 of 15
Kubernetes - Troubleshooting
You want to debug why a pod cannot reach a service by DNS name. Which two commands help diagnose this issue?
Akubectl logs pod and kubectl get pods
Bkubectl exec pod -- nslookup <service-name> and kubectl get endpoints <service-name>
Ckubectl describe service and kubectl get nodes
Dkubectl get configmaps and kubectl get secrets
Step-by-Step Solution
Solution:
  1. Step 1: Use nslookup inside pod

    nslookup tests DNS resolution of service name from pod.
  2. Step 2: Check endpoints for service

    Endpoints confirm if service routes to pods exist.
  3. Final Answer:

    kubectl exec pod -- nslookup <service-name> and kubectl get endpoints <service-name> -> Option B
  4. Quick Check:

    DNS + endpoints = diagnose service reachability [OK]
Quick Trick: Use nslookup and get endpoints to debug service DNS issues [OK]
Common Mistakes:
  • Checking logs unrelated to DNS
  • Getting nodes instead of endpoints
  • Checking configmaps and secrets irrelevant here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes