In resolve_hostname_to_ip(), limit the scope of the variable 'dns_retries'.