# Problem connection with hosts

**URL:** <https://forum.ansible.com/t/problem-connection-with-hosts/26032>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [November 15, 2017, 1:43pm UTC](https://forum.ansible.com/t/problem-connection-with-hosts/26032 "2017-11-15T13:43:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio\_Jimenez\_Rami](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@Antonio\_Jimenez\_Rami](https://forum.ansible.com/u/Antonio_Jimenez_Rami)\
**Post date:** [November 15, 2017, 1:43pm UTC](https://forum.ansible.com/t/problem-connection-with-hosts/26032/1 "2017-11-15T13:43:38Z")

</div>

Hi,

I have a ssh connection problem with a host when I launch a template.

" **“msg”: “Failed to connect to the host via ssh: ssh: Could not resolve hostname xxxxx: Name or service not known\r\n”,**

But when I connect from the hosts where it is running awx connect without problems.

I am dns in the machine where de Aex is ok.

Attach logs,

Identity added: /tmp/awx\_37\_E7foF2/credential\_2 (/tmp/awx\_37\_E7foF2/credential\_2)

ansible-playbook 2.4.1.0

config file = /etc/ansible/ansible.cfg

configured module search path = [u’/var/lib/awx/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]

ansible python module location = /usr/lib/python2.7/site-packages/ansible

executable location = /usr/bin/ansible-playbook

python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

Using /etc/ansible/ansible.cfg as config file

Parsed /tmp/awx\_37\_E7foF2/inventory inventory source with script plugin

PLAYBOOK: dns.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

1 plays in dns.yml

PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
14:29:11

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
14:29:11

Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py

Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py

ESTABLISH SSH CONNECTION FOR USER: soporte

SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=soporte -o ConnectTimeout=10 -o ControlPath=/tmp/awx\_37\_E7foF2/cp/%h%p%r dliwebfe01 ‘/bin/sh -c ‘"’“‘echo ~ && sleep 0’”’"‘’

ESTABLISH SSH CONNECTION FOR USER: soporte

SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=soporte -o ConnectTimeout=10 -o ControlPath=/tmp/awx\_37\_E7foF2/cp/%h%p%r dliwebfe02 ‘/bin/sh -c ‘"’“‘echo ~ && sleep 0’”’"‘’

(255, ‘’, ‘ssh: Could not resolve hostname dliwebfe01: Name or service not known\r\n’)

(255, ‘’, ‘ssh: Could not resolve hostname dliwebfe02: Name or service not known\r\n’)

fatal: [dliwebfe01]: UNREACHABLE! =\> {

“changed”: false,

“msg”: “Failed to connect to the host via ssh: ssh: Could not resolve hostname dliwebfe01: Name or service not known\r\n”,

“unreachable”: true

}

fatal: [dliwebfe02]: UNREACHABLE! =\> {

“changed”: false,

“msg”: “Failed to connect to the host via ssh: ssh: Could not resolve hostname dliwebfe02: Name or service not known\r\n”,

“unreachable”: true

}

Regards,

---

<div class="post-metadata">

**Author:** ![Bruno\_Casano](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@Bruno\_Casano](https://forum.ansible.com/u/Bruno_Casano)\
**Post date:** [January 17, 2018, 6:57pm UTC](https://forum.ansible.com/t/problem-connection-with-hosts/26032/2 "2018-01-17T18:57:28Z")

</div>

> 

Hi Antonio,

I have a similar problem with servers that are not in DNS. Haven’t found a solution yet, but I’ll let you know when and if I do.

Regards,

Bruno

---

<div class="post-metadata">

**Author:** ![Abhinav\_anand](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Abhinav\_anand](https://forum.ansible.com/u/Abhinav_anand)\
**Post date:** [July 30, 2018, 7:47pm UTC](https://forum.ansible.com/t/problem-connection-with-hosts/26032/3 "2018-07-30T19:47:32Z")

</div>

did you guys happen to get the solution?

---

<div class="post-metadata">

**Author:** ![walkafwalka](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@walkafwalka](https://forum.ansible.com/u/walkafwalka)\
**Post date:** [July 30, 2018, 9:28pm UTC](https://forum.ansible.com/t/problem-connection-with-hosts/26032/4 "2018-07-30T21:28:18Z")

</div>

How did you test DNS functionality from the AWX host?

I would do something like this:

cat /etc/resolv.conf

host dliwebfe02

docker exec -it awx\_container /bin/bash

cat /etc/resolv.conf

host dliwebfe02

Jul 30, 2018, 12:47 PM by [anand.avinab@gmail.com](mailto:anand.avinab@gmail.com):
