DNS in pod Kubernetes Origin: Platform & cloud Last updated 14 Oct 2026

DNS not working inside a Kubernetes pod (could not resolve host / nslookup: can't resolve)

Pods can’t resolve service names or external hosts — CoreDNS is down, blocked by NetworkPolicy, or the upstream resolver fails.

Exact message you may see could not resolve hostnslookup: can't resolve 'kubernetes.default'Temporary failure in name resolutionno such host;; connection timed out; no servers could be reached
Seen on: Kubernetes

Meaning

Pods use CoreDNS (kube-dns service). Problems: CoreDNS pods crashing or overloaded, NetworkPolicies blocking UDP/TCP 53, wrong ndots search behaviour causing slow lookups, or the node’s upstream DNS failing.

Common causes

  • CoreDNS pods not running/crashlooping (often a loop with host resolv.conf)
  • NetworkPolicy blocks egress to kube-dns port 53
  • Upstream DNS unreachable from nodes
  • Using short names across namespaces (svc instead of svc.namespace)

⚡ Quick fix

  1. Test from a debug pod: nslookup kubernetes.default
  2. Check CoreDNS pods and logs
  3. Allow DNS egress in NetworkPolicies

Detailed fix by platform

Kubernetes

  1. bash
    kubectl run dns-test --rm -it --image=busybox:1.36 --restart=Never -- nslookup kubernetes.default
    kubectl -n kube-system logs -l k8s-app=kube-dns --tail=50

How to diagnose

  1. CoreDNS — Pods Running? Logs?
  2. Policy — Egress to port 53 allowed?
  3. Name — Using svc.namespace.svc.cluster.local?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

1000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)10001001 — Cloudflare Error 1001: DNS resolution error (Cloudflare)10011002 — Cloudflare Error 1002: DNS points to Prohibited IP / Restricted (Cloudflare)1002actively refused it — HttpRequestException: No connection could be made because the target machine actively refused it (localhost:5001) (.NET)actively refused itcURL error 6 — cURL error 6: Could not resolve host: api.example.com (PHP)cURL error 6default backend - 404 — Ingress returns "404 Not Found" / "default backend - 404" (ingress-nginx) (Kubernetes)default backend - 404ENOTFOUND — Error: getaddrinfo ENOTFOUND host / Name or service not known (API)ENOTFOUNDERR_NAME_NOT_RESOLVED — net::ERR_NAME_NOT_RESOLVED (This site can't be reached — server IP address could not be found) (JavaScript)ERR_NAME_NOT_RESOLVEDDNS in pod

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.