<p>I recently created a kubernetes cluster of one master and one slave (2 laptops) running Ubuntu 18.04 using Kubeadm and flannel for the network. I was able to deploy 2 microservices as 2 pods and created 2 services for either of them. I was able to call both API of both services using the node IP and the service port. But the pods were unable to communicate with each other using the service domain name.
Then I followed the  <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/" rel="nofollow noreferrer">debugging DNS issue page in official kubernetes website</a>.</p>
<p>On running <code>kubectl exec -ti dnsutils -- nslookup kubernetes.default</code> in the terminal
I keep getting</p>
<blockquote>
<p>;; connection timed out; no servers could be reached. command terminated with exit code 1</p>
</blockquote>
<p>All the rest of the steps in the above mentioned page works as expected. Towards the end, there is mention about the problem with resolv.conf in ubuntu and how to mitigate that. But I'm lost there and don't know how to implement that. Has anyone come accross this issue ? Can you help me fix it ?</p>

<p>If you are accessing a service from different namespace then you need to add the namespace where the service is <code>my-svc.my-namespace.svc.cluster.local</code> and if you are accessing it from same namespace then you can use <code>my-svc.svc.cluster.local</code> without any need to mention namespace.</p>
