Fixed #20338 -- Stripped ending dot during host validation

Thanks manfre for the report and Timo Graham for the review.