<p>I followed the next guide <a href="https://computingforgeeks.com/deploy-kubernetes-cluster-on-ubuntu-with-kubeadm/" rel="nofollow noreferrer">https://computingforgeeks.com/deploy-kubernetes-cluster-on-ubuntu-with-kubeadm/</a> in BareMetal Ubuntu 20.04 with 2 nodes.</p>
<p>I chose Docker as my Container Runtime and started the cluster with <code>sudo kubeadm init --pod-network-cidr 10.16.0.0/16</code></p>
<p>Everything seems to run fine at the beginning <strong>The problem that I'm having</strong> is when a pod needs to connect to kube dns to resolve a domain name, although kubedns is working fine, so it seems that the problem is with the connection between.
I ran the debugging tool for the DNS <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/</a> and when I ran <code>kubectl exec -i -t dnsutils -- nslookup kubernetes</code> I got the following output:</p>
<p><a href="https://i.stack.imgur.com/232ly.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/232ly.png" alt="enter image description here" /></a></p>
<p>This are the logs of my kube dns:
<a href="https://i.stack.imgur.com/yegoZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yegoZ.png" alt="enter image description here" /></a></p>
<p>And this is the resolv.conf inside my pod:
<a href="https://i.stack.imgur.com/WLDEr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WLDEr.png" alt="enter image description here" /></a></p>
<p>This is my kubectl and kubeadm info:</p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.4&quot;, GitCommit:&quot;e87da0bd6e03ec3fea7933c4b5263d151aafd07c&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-02-18T16:12:00Z&quot;, GoVersion:&quot;go1.15.8&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}

kubeadm version: &amp;version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.4&quot;, GitCommit:&quot;e87da0bd6e03ec3fea7933c4b5263d151aafd07c&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-02-18T16:09:38Z&quot;, GoVersion:&quot;go1.15.8&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p><strong>[edit with extra information]</strong></p>
<p>Calico Pods Status:
<a href="https://i.stack.imgur.com/4Qw2H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Qw2H.png" alt="enter image description here" /></a></p>
<p>Querying DNS directly:
<a href="https://i.stack.imgur.com/QgCKa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QgCKa.png" alt="enter image description here" /></a></p>

<p>I use Flannel and had a similar problem. Restarting the coredns deployment solved it for me:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl rollout restart -n kube-system deployment/coredns
</code></pre>
