Bird
0
0

A pod cannot reach a service by its DNS name. You run kubectl exec pod1 -- nslookup myservice and get a timeout. What is the most likely cause?

medium📝 Troubleshoot Q14 of 15
Kubernetes - Troubleshooting
A pod cannot reach a service by its DNS name. You run kubectl exec pod1 -- nslookup myservice and get a timeout. What is the most likely cause?
AThe pod is missing the DNS policy or DNS is misconfigured
BThe service has no endpoints, so DNS resolves but no response
CThe service selector labels do not match any pods
DThe pod is running in a different namespace without DNS search path
Step-by-Step Solution
Solution:
  1. Step 1: Analyze DNS timeout symptom

    A DNS timeout means the pod cannot resolve the service name, indicating DNS issues.
  2. Step 2: Identify DNS misconfiguration causes

    Missing DNS policy or broken DNS config in pod causes nslookup timeout, unlike no endpoints which still resolve DNS.
  3. Final Answer:

    The pod is missing the DNS policy or DNS is misconfigured -> Option A
  4. Quick Check:

    DNS timeout = DNS config issue [OK]
Quick Trick: DNS timeout means DNS config or policy problem, not endpoints [OK]
Common Mistakes:
  • Confusing DNS resolution failure with no endpoints
  • Assuming label mismatch causes DNS timeout instead of no response
  • Ignoring namespace DNS search path issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes