set errno when DNS resolution fails.