You can do:
Host hosta hostb hostc
HostName %h.mycompany.com
User usera
I believe this isn't a super-new feature -- every ssh version I've run into client-side in the last couple years has supported it.You should be able to do something like:
Host hosta* hostb* hostc*
User usera
Assuming you don't have two different machines named hosta with different domain names, it should do what you want.so, I would say that the easiest solution here is tab completion. Suitably modern bash-completion should expand entries in ~/.ssh/config (as well as ~/.ssh/known_hosts if its not hashed).
Host hosta.mycompany.com
User usera
and then type "ssh hosta<tab>" :)
The bad thing is, as the blog post shows, "Host" above is really just an alias. So if I have an entry like:
and then try to do "ssh hosta", even if hosta resolves to hosta.mycompany.com, it won't match the config entry, as config entry data is all used prior to DNS lookup.EDIT: thanks for all the suggestions below.