<p>I have a kubernetes cluster setup on AWS. When i make call to elasticsearch-client.default.svc.cluster.local from a pod, i get unknown host exception occasionaly. It must have something to do with the name resolution, coz hitting the service IP directly works fine. </p>

<p>Note : I already have kube-dns autoscaler enabled. I manually tried with almost 6 kube-dns pods. SO i dont think it is because of dns pod scaling.</p>

<p>When I set the kube-dns configMap with the upstreamserver values to google nameservers (8.8.8.8 and 8.8.4.4) I am not getting the issue. I assume it is because of api ratelimiting done by AWS on route53. But I dont know why the name resolution request would got to AWS NS.</p>

<p>Here's a good <a href="https://blog.quentin-machu.fr/2018/06/24/5-15s-dns-lookups-on-kubernetes/" rel="nofollow noreferrer">write-up</a> that may be related to your problems, also check <a href="https://www.weave.works/blog/racy-conntrack-and-dns-lookup-timeouts" rel="nofollow noreferrer">this</a> one out by Weaveworks. </p>

<p>Basically there have been a number of issues during the last year created at the GitHub <a href="https://github.com/kubernetes/kubernetes/issues" rel="nofollow noreferrer">Kubernetes issue tracker</a> that has to do with various DNS latencies/problems from within a cluster.</p>

<p>Worth mentioning, although not a fix to every DNS related problem, is that CoreDNS are generally available since version <code>1.11</code> and are or will be default thus replacing <code>kube-dns</code> as the default DNS add-on for clusters.</p>

<p>Here's a couple of issues that might be related to the problem you're experiencing:</p>

<p><a href="https://github.com/kubernetes/kubernetes/issues/47142" rel="nofollow noreferrer">#47142</a></p>

<p><a href="https://github.com/kubernetes/kubernetes/issues/45976" rel="nofollow noreferrer">#45976</a></p>

<p><a href="https://github.com/kubernetes/kubernetes/issues/56903" rel="nofollow noreferrer">#56903</a></p>

<p>Hopefully this may help you moving forward.</p>
