catch potential errors resolving hosts

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
Merge pull request #154 from alfredodeza/7209

catch potential errors resolving hosts