use hostname for hostname, fqdn and localhost as aliases, handle nil fqdn