Added random hostname support. Thanks to Gregor Perner for the idea.