Pods resolve external names slowly and some lookups fail with `i/o timeout`.
AdvancedTroubleshootingNetwork Connectivity Errors
Answer
Likely causes → CoreDNS overloaded or throttled, conntrack race on UDP DNS, custom VNet DNS servers slow/unreachable, or ndots:5 causing many search-domain lookups.
Diagnose →
kubectl -n kube-system top pods -l k8s-app=kube-dns
kubectl -n kube-system logs -l k8s-app=kube-dns --tail 50
kubectl run dnstest --rm -it --image=busybox:1.36 -- nslookup api.github.com
Fix →
- Scale CoreDNS (autoscaler config in
coredns-autoscalerconfigmap) or enable NodeLocal DNSCache-style caching where supported - Set
dnsConfig.options: ndots: "2"for apps calling many external names - Fix custom DNS server reachability or forwarders
Prevent → Monitor CoreDNS latency and errors in Prometheus.
More on Network Connectivity Errors
A VM with a public IP times out on SSH (`ssh: connect to host 20.x.x.x port 22: Connection timed out`).Beginner`nslookup kv-shop.vault.azure.net` from inside the VNet returns a public IP even though a Private Endpoint exists.IntermediateKey Vault returns `Client address is not authorized and caller is not a trusted service.` (ForbiddenByFirewall).BeginnerApplication Gateway returns `502 Bad Gateway` and backend health shows Unhealthy.IntermediateApp Gateway v2 deployment fails or goes unhealthy after a UDR `0.0.0.0/0 → firewall` was added to its subnet.AdvancedTwo VNets peered but VMs can't communicate; peering state shows `Initiated`.Intermediate