Generate hostname for host networking and fix hostname generation in all cases