Smart hostname matching.