# hostname has to be exactly the same as in the host file

**URL:** <https://forum.ansible.com/t/hostname-has-to-be-exactly-the-same-as-in-the-host-file/12407>\
**Category:** Ansible Project\
**Created:** [February 22, 2013, 10:18pm UTC](https://forum.ansible.com/t/hostname-has-to-be-exactly-the-same-as-in-the-host-file/12407 "2013-02-22T22:18:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [February 22, 2013, 10:18pm UTC](https://forum.ansible.com/t/hostname-has-to-be-exactly-the-same-as-in-the-host-file/12407/1 "2013-02-22T22:18:37Z")

</div>

When you use ansible-playbook with the -l option, if the hostname is not exactly the same, it fails.

Differences could be  
-upper/lower case  
-DNS aliasf  
-qdn vs. just hostname

Would it make sense to change that so that, as long as it ends up resolving to the same name, it just works?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 22, 2013, 10:21pm UTC](https://forum.ansible.com/t/hostname-has-to-be-exactly-the-same-as-in-the-host-file/12407/2 "2013-02-22T22:21:59Z")

</div>

No, because it also matches groups. There is no sane reason why  
groups should be case sensitive, but we shouldn't break compat on  
this.

And it doesn't fail, it works exactly like it should and doesn't match  
anything 🙂
