remove non-hostname characters while stripping names