nwrap: Use hash for host search query

This commit is draft now. Lot of memory leaks left.

Signed-off-by: Robin Hack <hack.robin@gmail.com>