PHP Curl has a dns cache, that is enabled by default:
CURLOPT_DNS_USE_GLOBAL_CACHE
http://php.net/manual/en/function.curl-setopt.php
I can't seem to find any resources on how to clear this cache (aside from apache restart).
Navigate to All Programs > Accessories and select Command Prompt. In the command line interface, run ipconfig /flushdns . You should receive a confirmation message once the DNS cache is flushed.
It is not possible to manually clean DNS cache from PHP. But you can use CURLOPT_DNS_CACHE_TIMEOUT
Pass a long, this sets the timeout in seconds. Name resolves will be kept in memory and used for this number of seconds. Set to zero to completely disable caching, or set to -1 to make the cached entries remain forever. By default, libcurl caches this info for 60 seconds.
You can set option to 0
for next request to force curl's DNS cache to be flushed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With