# DNS within Cluster

**URL:** <https://forums.suse.com/t/dns-within-cluster/38125>\
**Category:** k3s, k3OS, and k3d\
**Created:** [June 9, 2022, 1:44pm UTC](https://forums.suse.com/t/dns-within-cluster/38125 "2022-06-09T13:44:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspera](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jspera/32/9096_2.png) [@jspera](https://forums.suse.com/u/jspera)\
**Post date:** [June 9, 2022, 1:44pm UTC](https://forums.suse.com/t/dns-within-cluster/38125/1 "2022-06-09T13:44:35Z")

</div>

Hi I have created a deployment for 2 pods within a worker node and both of them have started successfully.

Pod A’s IP Address: 10.42.21.54  
Pod B’s IP Address: 10.42.21.55

I would like to have Pod B communicating with Pod A but since the IP assigned to Pod A (10.42.21.54) is not static, I can only do so via a hostname and letting a DNS resolve it.

Based on this [article](https://rancher.com/docs/rancher/v2.0-v2.4/en/v1.6-migration/discover-services/), the DNS record is created automatically and I should be able to access Pod A via 10-42-21-54.default.pod.cluster.local. However, this did not work when I tried pinging from Pod B’s shell. Also this approach would still require me to know Pod A’s IP beforehand.

I have tried to create a hostname in Pod A’s deployment and pinging it from Pod B (pod-a-hostname.default.pod.cluster.local) but it did not work as well. I suspect that my pods have some issues related to the DNS and hence was unable to reach any other pods within the same cluster. How can I go about fixing this issue?

---

<div class="post-metadata">

**Author:** ![jspera](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jspera/32/9096_2.png) [@jspera](https://forums.suse.com/u/jspera)\
**Post date:** [June 9, 2022, 1:47pm UTC](https://forums.suse.com/t/dns-within-cluster/38125/2 "2022-06-09T13:47:59Z")

</div>

To add on, checking the /etc/resolv.conf file within Pod B shows the following

> /data # cat /etc/resolv.conf  
> search default.svc.cluster.local svc.cluster.local cluster.local  
> nameserver 10.43.0.10  
> options ndots:5

However, when I tried to ping 10.43.0.10, I am unable to get any response.
