fix hostname detection on some linux systems