# Resolving containers by their hostnames

**URL:** <https://forums.suse.com/t/resolving-containers-by-their-hostnames/4129>\
**Category:** Rancher 1.x\
**Created:** [September 27, 2016, 6:41pm UTC](https://forums.suse.com/t/resolving-containers-by-their-hostnames/4129 "2016-09-27T18:41:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raveekiran](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@raveekiran](https://forums.suse.com/u/raveekiran)\
**Post date:** [September 27, 2016, 6:41pm UTC](https://forums.suse.com/t/resolving-containers-by-their-hostnames/4129/1 "2016-09-27T18:41:53Z")

</div>

I am having trouble resolving containers by their hostnames, I am able to resolve some the containers but not all of them, I thought this was a host issue, I tried destroying and recreating them again, I see this pattern consistently

Here are the details of my setup

Custom - Cent OS 7.1 VMs  
Rancher v1.1.4  
Cattle v0.165.8.4  
User Interface v1.1.14  
Rancher Compose v0.8.6  
Kubernetes 1.2.4  
Docker 1.2

Any help would be greatly appreciated

Thanks

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [September 28, 2016, 7:01pm UTC](https://forums.suse.com/t/resolving-containers-by-their-hostnames/4129/2 "2016-09-28T19:01:02Z")

</div>

Can you elaborate on how this issue becomes apparent and how you are testing whether resolution works or not. For example;

- Are you just using tools like dig or nslookup
- Do applications fail because of this
- Where doesn’t resolution work

---

<div class="post-metadata">

**Author:** ![raveekiran](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@raveekiran](https://forums.suse.com/u/raveekiran)\
**Post date:** [September 28, 2016, 8:10pm UTC](https://forums.suse.com/t/resolving-containers-by-their-hostnames/4129/3 "2016-09-28T20:10:41Z")

</div>

I am using busybox container to resolve containers by their hostnames, this is what I have observed

1. I can’t ping a service by its ip even when it has end points associated with it, I can resolve the service\_name when do nslookup based on svc\_name or svc\_name.default
2. I can ping containers by their ip addresses, but I can’t resolve them by their hostnames

Current app that I am working on has a clustering feature built in, containers can’t join a cluster as they can’t resolve each other by their hostnames

Thanks for your help!
