Make this work on Illumos/Solaris

Remove getdomainname and setdomainname as they are not POSIX.

Some system implement sethostname(char *...) instead of const char *.
Since, a passing in const char * will cause an error on those platforms
and passing a char * will not cause an error on any platform, prefer the
latter.