Better hostname assignment