Acquire hostname correctly