Fix return value on dns resolution issue

Closes #393