In mock exam2, I am getting marked incorrectly for pod resolution. I am using t . . .

K8ns:
In mock exam2, I am getting marked incorrectly for pod resolution. I am using the same command that I used to do nslookup for service as below . dns-test is a pod with sleep 4800 using busybox1:28 image… Could you please let me know if I did any mistake? @Tej_Singh_Rana

controlplane kubectl exec -it dns-test nslookup nginx-resolver-service > /root/CKA/nginx.svc controlplane kubectl exec -it dns-test nslookup nginx-resolver
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] – [COMMAND] instead.
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name: nginx-resolver
Address 1: 10.104.225.238 nginx-resolver.default.svc.cluster.local
controlplane $ kubectl exec -it dns-test nslookup nginx-resolver > /root/CKA/nginx.pod

Pratik Patel:
You need to export pod nslookup in nginx.pod file, not service one.

K8ns:
kubectl exec -it dns-test nslookup nginx-resolver > /root/CKA/nginx.pod

K8ns:
this one does export the pod’s nslook up right

K8ns:
pod name is nginx-resolver

K8ns:
thank you for your response @Pratik Patel

Mohamed Ayman:
Check this:
kubectl run test-svc-connection --rm -it --image=busybox:1.28 --restart=Never -- nslookup nginx-resolver-service

K8ns:
@Mohamed Ayman Thank you… it worked… but I dont understand why same command worked for service but failed for pod

Pratik Patel:
@K8ns what command exactly are you using for pod ?

K8ns:
pod:

kubectl exec -it dns-test nslookup nginx-resolver > /root/CKA/nginx.pod

service:
kubectl exec -it dns-test nslookup nginx-resolver-service > /root/CKA/nginx.svc

Pratik Patel:
For pod use ip address of pod, you can’t resolve from its name.
For example, If the ip of the pod is 192.168.0.1 then it will be nslookup 192-168-0-1.default.pod

Pratik Patel:
@Tej_Singh_Rana @Mohamed Ayman please correct me if I am wrong.

Pratik Patel:
@K8ns that is working for me in mock exam.

K8ns:
@Pratik Patel it was showing output for me. is it mandatory to use ip?

kubectl exec -it dns-test nslookup nginx-resolver
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] – [COMMAND] instead.
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name: nginx-resolver
Address 1: 10.104.225.238 nginx-resolver.default.svc.cluster.local
controlplane $ kubectl exec -it dns-test nslookup nginx-resolver > /root/CKA/nginx.pod (edited)

Pratik Patel:
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records-1

Pratik Patel:
Is it still showing wrong when you use this command ?
kubectl exec -it dns-test nslookup nginx-resolver > /root/CKA/nginx.pod

K8ns:
the grading shows it is wrong… interestingly nslookup for service using the same command it shows right… Hence wanted to double check on the regarding right approach

Pratik Patel:
I am on same question now, pod is not resolving with pod name nginx-resolver for me, its resolving with ip address with - (dashes) and showing correct answer when I end exam.

K8ns:
it failed for me now

controlplane $ kubectl exec -it busybox – nslookup nginx-resolver
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

nslookup: can’t resolve ‘nginx-resolver’
command terminated with exit code 1
controlplane $

morning, it was showing me the below output
controlplane $ kubectl exec -it dns-test nslookup nginx-resolver
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] – [COMMAND] instead.
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name: nginx-resolver
Address 1: 10.104.225.238 nginx-resolver.default.svc.cluster.local

K8ns:
I will use IP address as you have mentioned…