I think we should use $hostname (which defaults to $broker_hostname for all-in-one installs and will default to $node_hostname when configuring a node-only host) because that is what we configure as the actual hostname in configure_hostname().