strip newlines and URI encode fqdn