Hfilter: optimize hostname check