Interview Prep/Networking/DNS resolution failures

In Kubernetes, external lookups from pods are slow and CoreDNS logs show many NXDOMAIN queries like `api.stripe.com.default.svc.cluster.local`.

IntermediateTroubleshootingDNS resolution failures
Answer

Likely causes → ndots:5 in pod resolv.conf. Any name with fewer than five dots is tried with every search domain first, so one external lookup becomes up to 4–5 queries times A and AAAA.

Diagnose →

kubectl exec -it pod -- cat /etc/resolv.conf
kubectl -n kube-system logs -l k8s-app=kube-dns | grep NXDOMAIN | head

Fix → Use fully qualified names with a trailing dot (api.stripe.com.), or lower ndots per pod:

dnsConfig:
  options:
    - name: ndots
      value: "2"

Prevent → Deploy NodeLocal DNSCache and enable CoreDNS autopath if it fits; set ndots in workload templates.

All Networking questions Roadmap: Networking for DevOps

More on DNS resolution failures