sanitize invalid hostnames