Changing getHostName to os module

os.hostname() doesn't use exec, should be a little faster.