# How to access pods using its hostname from another pod in same namespace

**URL:** <https://discuss.kubernetes.io/t/how-to-access-pods-using-its-hostname-from-another-pod-in-same-namespace/7170>\
**Category:** General Discussions\
**Created:** [July 16, 2019, 11:31am UTC](https://discuss.kubernetes.io/t/how-to-access-pods-using-its-hostname-from-another-pod-in-same-namespace/7170 "2019-07-16T11:31:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kapil70war](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kapil70war](https://discuss.kubernetes.io/u/kapil70war)\
**Post date:** [July 16, 2019, 11:31am UTC](https://discuss.kubernetes.io/t/how-to-access-pods-using-its-hostname-from-another-pod-in-same-namespace/7170/1 "2019-07-16T11:31:58Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version: 1.12.5  
Cloud being used: (put bare-metal if not on a public cloud)  
Installation method:  
Host OS: ubuntu 16.04  
CNI and version:  
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![rata](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/rata/32/18244_2.png) [@rata](https://discuss.kubernetes.io/u/rata)\
**Post date:** [July 16, 2019, 9:56pm UTC](https://discuss.kubernetes.io/t/how-to-access-pods-using-its-hostname-from-another-pod-in-same-namespace/7170/2 "2019-07-16T21:56:28Z")

</div>

See the service documentation on kubernetes website and headless services (it’s in the same page, it might be useful for your use case. Not sure :)). That is the part that explains about it, and please come back if something is not clear 🙂
