Improved error handling in DNS calls. GitHub #219