<pre><code>ytong@controller-4135505:~/cka$ cat 14.15-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: busy33
  labels:
    app: 14-15
spec:
  dnsPolicy: ClusterFirstWithHostNet
  hostname: 14-15
  subdomain: ytong82
  containers:
  - name: busybox-container
    image: busybox
    command: ['sleep', '3600']
</code></pre>

<pre><code>ytong@controller-4135505:~/cka$ kubectl get pods -o wide | grep busy33
busy33                     1/1     Running     0          91s     10.36.0.1   worker3-4135521   &lt;none&gt;           &lt;none&gt;
</code></pre>

<p>I try to resolve its pod DNS records like below</p>

<pre><code>ytong@controller-4135505:~/cka$ kubectl exec -it busy33 -- nslookup -type=a 10-36-0-1.default.svc.cluster.local
Server:         10.96.0.10
Address:        10.96.0.10:53

** server can't find 10-36-0-1.default.svc.cluster.local: NXDOMAIN

command terminated with exit code 1
ytong@controller-4135505:~/cka$ kubectl exec -it busy33 -- nslookup -type=a 14-15.ytong82.default.svc.cluster.local
Server:         10.96.0.10
Address:        10.96.0.10:53

** server can't find 14-15.ytong82.default.svc.cluster.local: NXDOMAIN

command terminated with exit code 1
</code></pre>

<p>Neither of above commands work.</p>

<p>Use image <code>busybox:1.28</code> instead of other images as those images has got DNS resolution issue.</p>

<p>When you are trying to do DNS resolution using pod you need to use below command which has <code>pod</code> instead of <code>svc</code></p>

<pre><code>kubectl exec -it busy33 -- nslookup 10-36-0-1.default.pod.cluster.local
</code></pre>
