Couldn't the machine's hostname potentially be different from its external hostname, do to DNS, etc? I chose to grab the hostname as externally as possible.