revise function to get fqdn