kubernetes
dns_error
ai_generated
partial
Error: Could not resolve host / nslookup failed in pod
ID: kubernetes/dns-resolution-failed-pod
82%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Pod can't resolve DNS. CoreDNS issue, network policy blocking, or service doesn't exist.
genericWorkarounds
-
92% success Check if CoreDNS pods are running: kubectl get pods -n kube-system -l k8s-app=kube-dns
kubectl get pods -n kube-system -l k8s-app=kube-dns
Sources: https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
-
90% success Test DNS from inside the pod: kubectl exec <pod> -- nslookup <service-name>
kubectl exec <pod> -- nslookup <service-name>
Sources: https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
-
88% success Use FQDN: service-name.namespace.svc.cluster.local for cross-namespace access
service-name.namespace.svc.cluster.local for cross-namespace access
Sources: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
Dead Ends
Common approaches that don't work:
-
Hardcode IP addresses in the application
80% fail
IPs change — services are designed to be accessed by name
-
Restart the pod
65% fail
If CoreDNS is broken, restarting the pod won't help
Error Chain
Frequently confused with: