<p>i have <code>2 pods</code>(pod1,pod2) with <code>2 services</code>(service1 links pod1, service2 links pod2) in the same namespace.</p>
<p>Within pod1 i performed below testing. i entered into pod1 using <code>kubectl exec ...</code> and</p>
<ul>
<li><p>Invoked restapi exposed in pod2 using <code>wget pod2ipaddress</code> - success</p>
</li>
<li><p>Invoked restapi exposed in pod2 using <code>wget service2ipaddress</code> - success</p>
</li>
<li><p>Invoked restapi exposed in pod2 using <code>wget service2Name</code> - failure with message <code>Could not resolve host: pcgamesapp-service</code></p>
</li>
<li><p><code>curl https://www.google.com</code> - failure with message <code>Could not resolve host: www.google.com</code></p>
</li>
<li><p>Executed below <code>nslookup</code> command , but received <code>connection timeout error</code> as shown in below screenshot
<a href="https://i.stack.imgur.com/OF5u1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OF5u1.png" alt="enter image description here" /></a></p>
</li>
</ul>
<p><strong>Setup</strong></p>
<ul>
<li>Initalised k8s cluster (v1.22.9) with 1 masterNode and 1 workerNode on <code>ubuntu 20.04</code> using <code>kubeadm</code> in AWS EC2 virtual machines</li>
<li><code>weavenet</code> plugin for networking</li>
</ul>
<p>i tracked the <code>kube-dns</code> logs but the request information of <code>curl serviceName</code> doesnot showup in the <code>kube-dns</code> logs
<code>kubectl logs --namespace=kube-system -l k8s-app=kube-dns</code></p>
<p>i followed the steps mentioned in <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/" rel="nofollow noreferrer">dns-debugging-resolution</a> documentation, but i'm not able to figure out a solution</p>
<p>From reading the previous answers i assume that there is some issue with <code>coredns</code> or <code>iptables</code> ...etc . But i'm unable to figure out a solution for this issue.
Please suggest</p>

divine
<p>i received the solution from a member named <code>felix-dpg</code>(@fdpg in stackoverflow) through another platform. i have added the solution details below</p>
<p>The information related to &quot;which ports has to be opened for master node and worker node&quot; are in <a href="https://kubernetes.io/docs/reference/ports-and-protocols/" rel="nofollow noreferrer">this link</a></p>
<p>The <a href="https://www.weave.works/docs/net/latest/kubernetes/kube-addon/" rel="nofollow noreferrer">weavenet</a> port details are in <a href="https://www.weave.works/docs/net/latest/faq/#:%7E:text=The%20Weave%20Net%20daemon%20listens,be%20opened%20to%20other%20hosts." rel="nofollow noreferrer">this link</a></p>
<p>Initially i didnot open (6783,6784)TCP,(6783,6784)UDP ports for Weavenet and port 53 for UDP(to enable inter-communication among the nodes in the cluster). The issue which i reported in this question got resolved by opening the ports for Weavenet and UDP</p>
<p><strong>Ports opened for Master node</strong>
<a href="https://i.stack.imgur.com/NFtXh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NFtXh.png" alt="enter image description here" /></a></p>
<p><strong>Ports opened for Worker node</strong>
<a href="https://i.stack.imgur.com/SRWO9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SRWO9.png" alt="enter image description here" /></a></p>
<p>Please let me know if you have any doubts or concerns with the above details. Thank you</p>
