Replace whitespace from hotname

AWS Instance can hold white space, but hotname cannot.
So when writing config, replace white spaces(" ") into underscores("_").