Use $SERVER variable instead of remote hostname

This allows the script to use the hostname in the serverlist, instead of using
the remote actual hostname (which may not be locally resolvable)