Calls to `api.stripe.com` from Pods are slow, and CoreDNS logs show `api.stripe.com.payments.svc.cluster.local`, `api.stripe.com.svc.cluster.local` … all `NXDOMAIN`.
IntermediateTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer
Likely causes → The default ndots:5. Any name with fewer than 5 dots is first tried with every search domain, so one external lookup becomes 4–5 failed queries (times two for A and AAAA) before the real one.
Diagnose →
kubectl exec pay-x -- cat /etc/resolv.conf
# search payments.svc.cluster.local svc.cluster.local cluster.local ec2.internal
# options ndots:5
Fix → Lower ndots for Pods that mostly call external names, or use a fully qualified name with a trailing dot (api.stripe.com.):
dnsConfig:
options:
- {name: ndots, value: "2"}
Prevent → Deploy NodeLocal DNSCache and enable CoreDNS autopath or caching; set ndots in base charts for egress-heavy services.
More on Services, DNS, Ingress and NetworkPolicy
`curl http://orders.shop.svc.cluster.local` hangs, and `kubectl get endpointslices -l kubernetes.io/service-name=orders` shows `ENDPOINTS <unset>`.BeginnerEndpoints exist, but `curl orders:80` returns `Connection refused`.BeginnerA Service works when you curl the Pod IP but times out on the ClusterIP from every node.IntermediateInside a Pod, `nslookup orders` returns `;; connection timed out; no servers could be reached`.BeginnerCoreDNS Pods are in CrashLoopBackOff with `[FATAL] plugin/loop: Loop (127.0.0.1:41823 -> :53) detected for zone "."`.IntermediateDNS lookups occasionally take exactly 5 seconds, then succeed.Advanced