During the network switching process, the IP resolved by DNS is still the old one, even though I have set it
DNS_CACHE_TIMEOUT is 0, but it still cannot be resolved to the correct IP in time. The IP has been refreshed when the system pings are executed.
I consulted curl official documentation
https://curl.se/libcurl/c/CURLOPT_DNS_CACHE_TIMEOUT.html
In this case it is best to call res_init
During the network switching process, the IP resolved by DNS is still the old one, even though I have set it DNS_CACHE_TIMEOUT is 0, but it still cannot be resolved to the correct IP in time. The IP has been refreshed when the system pings are executed. I consulted curl official documentation https://curl.se/libcurl/c/CURLOPT_DNS_CACHE_TIMEOUT.html In this case it is best to call res_init