<p>I have successfully created a Kubernetes POD/Service using MiniKube on windows. But I would now like to ensure that DNS is working correctly.</p>

<p>The DNS service is shown as running</p>

<pre><code>.\kubectl get pod -n kube-system
</code></pre>

<p>Which shows me the kube-dns pod is running</p>

<p><a href="https://i.stack.imgur.com/bqce1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bqce1.png" alt="enter image description here"></a></p>

<p>I also have the DNS add on shown as running</p>

<p><a href="https://i.stack.imgur.com/lIIIE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lIIIE.png" alt="enter image description here"></a></p>

<p>So I then want to verify that DNS is working, Ideally I want to test that PODs that have a service on top of them can lookup the service by DNS name.</p>

<p>But I started simple like this, where I get my running POD</p>

<p><a href="https://i.stack.imgur.com/lwW0V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lwW0V.png" alt="enter image description here"></a></p>

<p>So now that I have my POD name, I want to try do simple DNS lookup in it using the following commmand</p>

<pre><code>.\kubectl exec simple-sswebapi-pod-v1-f7f8764b9-xs822 -- nslookup google.com
</code></pre>

<p>Where I am using the <strong>kubectl  exec</strong> to try and run this nslookup in the POD that was found (running I should point out above).</p>

<p>But I get this error</p>

<p><a href="https://i.stack.imgur.com/Pvazu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pvazu.png" alt="enter image description here"></a></p>

<p>Why would it not be able to find <strong>nslookup</strong> inside POD. All the key things seem to be ok</p>

<ul>
<li>Kube-DNS pod is running (as shown above)</li>
<li>DNS AddOn is installed and running (as shown above)</li>
</ul>

<p>What am I missing, is there something else I need to enable for DNS lookups to work inside my PODs?</p>

<p>To do it like this your container needs to include the command you want to use inside of the built image.</p>

<p>Sidenote: <code>kubectl debug</code> is coming to kube in near future <a href="https://github.com/kubernetes/kubernetes/issues/45922" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/45922</a> which will help solve things like that by enabling you to attach a custom container to existing pod and debug in it</p>
