Interview Prep/Real-World Interview/Scaling and performance

DNS resolution inside the cluster is slow and causing timeouts. How do you debug it?

IntermediateScenarioScaling and performance
Answer

Situation read → CoreDNS overload or the ndots:5 default causing several lookups per external name.

What I'd do →

  1. Test from a pod:
kubectl run dnstest --rm -it --image=busybox:1.36 -- nslookup api.example.com
kubectl -n kube-system logs -l k8s-app=kube-dns --tail=50
  1. Check CoreDNS CPU, replicas and errors; scale it (or use the autoscaler) for cluster size.
  2. ndots:5 makes api.example.com try several search-domain suffixes first. Use fully qualified names with a trailing dot, or set dnsConfig.options ndots: "2" for apps that mostly call external names.
  3. Deploy NodeLocal DNSCache to cut latency and conntrack races.
  4. On EC2, check the per-ENI limit of 1,024 packets per second to the VPC resolver.

Why → Every external lookup can turn into five queries with default ndots, multiplying DNS load.

Interview tip → ndots:5 and NodeLocal DNSCache are the two specifics interviewers look for.

All Real-World Interview questions Roadmap: Interview readiness

More on Scaling and performance