Underscores aren't valid in hostname, so convert to hyphens like we do everywhere else.