[lib] test hosts to be sure they are valid IP addresses