sanitize invalid hostnames

:+1: added that