Revert "Fix alias expand for hostnames, it should fix #2941"

Working on a better fix

This reverts commit 0d59cc942f2ee225eccdb375e25f58a6f04fa9c4.