# Cant use dash with numbers as hostname

**URL:** <https://forum.ansible.com/t/cant-use-dash-with-numbers-as-hostname/33264>\
**Category:** Ansible Project\
**Created:** [June 25, 2020, 2:56pm UTC](https://forum.ansible.com/t/cant-use-dash-with-numbers-as-hostname/33264 "2020-06-25T14:56:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CWollinger1](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@CWollinger1](https://forum.ansible.com/u/CWollinger1)\
**Post date:** [June 25, 2020, 2:56pm UTC](https://forum.ansible.com/t/cant-use-dash-with-numbers-as-hostname/33264/1 "2020-06-25T14:56:53Z")

</div>

Hi all,

is there a way to escape the dash/minus in the hostname (when using numbers)

hostfile:

test1 ansible\_host=10-1  
test2 ansible\_host=“10-1”

Result:

bash-4.4# ansible-inventory -i hosts --list  
{  
“\_meta”: {  
“hostvars”: {  
“test1”: {  
“ansible\_host”: 9  
},  
“test2”: {  
“ansible\_host”: 9  
}  
}  
},  
“all”: {  
“children”: [  
“ungrouped”  
]  
},  
“ungrouped”: {  
“hosts”: [  
“test1”,  
“test2”  
]  
}  
}

The ansible-inventory made a calculation for the var …

Thanks & regards  
CWollinger
