better hostname matching. fixes #20