print the hostname to hostname.txt