# win\_ping Name or service not known

**URL:** <https://forum.ansible.com/t/win-ping-name-or-service-not-known/21264>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 25, 2016, 6:06pm UTC](https://forum.ansible.com/t/win-ping-name-or-service-not-known/21264 "2016-04-25T18:06:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [April 25, 2016, 6:06pm UTC](https://forum.ansible.com/t/win-ping-name-or-service-not-known/21264/1 "2016-04-25T18:06:21Z")

</div>

Centos 7  
Ansible 2.1  
Windows 7 on remote node

My inventory file (/etc/ansible/hosts) contains…  
[windows]  
[123.123.123.123.mycompany.com](http://123.123.123.123.mycompany.com)

My /etc/ansible/group\_vars/windows.yml file contains…

```auto
ansible_user: username
ansible_password: password
ansible_port: 5985
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore

```

```auto

```

```auto
 But when I try to run win_ping I get this:

```

```auto

```

```auto
**$ansible windows -m win_ping -c winrm --vvv**

```

```auto
**No config file found; using defaults**

```

```auto
**<123.123.123.123.mycompany.com> ESTABLISH WINRM CONNECTION FOR USER: username on port 5985 TO 123.123.123.123.mycompany.com**

```

```auto
**123.123.123.123.mycompany.com | FAILED! => {**

```

```auto
 **"failed": true.**

```

```auto
 **"msg": "plaintext: 500 WinRMTransport. [Errno -2] Name or service not known"**

```

```auto
**}**

```

```auto

```

```auto
What config file am I missing?

```

```auto
Where should it be located?

```

```auto
What should it contain?

```

```auto

```

```auto
Any suggestions are appreciated.

```

```auto

```

```auto
Jonathan

```

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 26, 2016, 9:49am UTC](https://forum.ansible.com/t/win-ping-name-or-service-not-known/21264/2 "2016-04-26T09:49:48Z")

</div>

Hi,

Could be a few things going on here but ‘Name or service not known’ can mean that it can’t find the host.

Can you ping **[123.123.123.123.mycompany.com](http://123.123.123.123.mycompany.com/)** from your ansible controller? Also if you do an nslookup on its ip address, do you get the correct hostname back?

Did you run the [https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1](https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1) script on the Windows 7 machine.

Also, if I recall, Windows 7 came with Powershell 2.0. You’ll need to upgrade it to at least Powershell / Windows Management Framework 3.0 (although I would go straight to 4.0 if possible).

Hope this helps,

Jon
