fixed the error handling of failed DNS resolution