DNS inside the cluster is failing intermittently. Debug it.

AdvancedHands-onLive debugging tasks
Answer
kubectl -n kube-system get pods -l k8s-app=kube-dns -o wide
kubectl -n kube-system logs -l k8s-app=kube-dns --tail=50
kubectl run dnstest --rm -it --image=nicolaka/netshoot -- bash
#   cat /etc/resolv.conf          # nameserver, search domains, ndots:5
#   dig api.default.svc.cluster.local
#   for i in $(seq 50); do dig +short google.com >/dev/null || echo fail; done
kubectl -n kube-system top pods -l k8s-app=kube-dns

Common causes: too few CoreDNS replicas (CPU throttling), conntrack races on UDP, ndots:5 multiplying external lookups, or NetworkPolicy blocking port 53 egress. Fixes: scale CoreDNS or use NodeLocal DNSCache, set dnsConfig.options ndots: 2, and use FQDNs with a trailing dot for external names.

Key trick → ndots:5 means api.stripe.com is first tried against every search domain, so one lookup becomes 4 to 5 queries. Mentioning it shows real production experience.

All Real-World Interview questions Roadmap: Interview readiness

More on Live debugging tasks