added more portable (perl) hostname fetching to pass to the C code, updated docs