# Could not resolve hostname: Name or service not known

**URL:** <https://forum.ansible.com/t/could-not-resolve-hostname-name-or-service-not-known/36418>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 9, 2022, 9:54pm UTC](https://forum.ansible.com/t/could-not-resolve-hostname-name-or-service-not-known/36418 "2022-03-09T21:54:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sai\_krishna\_Chinna](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Sai\_krishna\_Chinna](https://forum.ansible.com/u/Sai_krishna_Chinna)\
**Post date:** [March 9, 2022, 9:54pm UTC](https://forum.ansible.com/t/could-not-resolve-hostname-name-or-service-not-known/36418/1 "2022-03-09T21:54:41Z")

</div>

Hi,

I am using AWX 17.1.0 docker install. Inventory Source → Amazon EC2 and updated source variables in inventory source to  
hostnames: ‘tag:Name’

It shows all the hosts but when I run a job it throws: Failed to connect to the host via ssh: ssh: Could not resolve hostname: Name or service not known.

Does anyone had the similar issue and were able to resolve this?

Thanks

---

<div class="post-metadata">

**Author:** ![Sai\_krishna\_Chinna](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Sai\_krishna\_Chinna](https://forum.ansible.com/u/Sai_krishna_Chinna)\
**Post date:** [March 16, 2022, 12:08pm UTC](https://forum.ansible.com/t/could-not-resolve-hostname-name-or-service-not-known/36418/2 "2022-03-16T12:08:26Z")

</div>

Can someone please help with this issue?

---

<div class="post-metadata">

**Author:** ![Rebeccah\_Hunter](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Rebeccah\_Hunter](https://forum.ansible.com/u/Rebeccah_Hunter)\
**Post date:** [March 16, 2022, 8:10pm UTC](https://forum.ansible.com/t/could-not-resolve-hostname-name-or-service-not-known/36418/3 "2022-03-16T20:10:13Z")

</div>

Hi there,

The team thinks you may be having troubles with internal/routable hostnames. You can work around this by picking another identifier to get the hostname of the server that should be in the inventory. (the variable for that [https://docs.ansible.com/ansible/latest/collections/amazon/aws/aws\_ec2\_inventory.html#parameter-hostnames](https://docs.ansible.com/ansible/latest/collections/amazon/aws/aws_ec2_inventory.html#parameter-hostnames)).  
The general docs for selecting the options instead of the hostname are here: [https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#amazon-web-services-ec2](https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#amazon-web-services-ec2)

cheers,  
AWX Team
