Fix return value on dns resolution issue

Closes #393
Merge pull request #394 from comodit/fix_393

Fix return value on dns resolution issue