if hostname is invalid on system, just use a static string also cleans up visibility of a lot of code, hopefully will help jvm optimize more.