vendor: Improve hostname detection

Change-Id: If8d8961ab7f49081f83b32c27116d207399b760a