|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69047 CURLOPT_IPRESOLVE change for next curl_exec has no effect
Submitted: 2015-02-12 22:15 UTC Modified: 2015-02-12 22:52 UTC
From: vali2015 at validom dot de Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.4.37 OS: Debian
Private report: No CVE-ID: None
 [2015-02-12 22:15 UTC] vali2015 at validom dot de
When using multiple curl_exec calls but using different CURLOPT_IPRESOLVE settings, the first setting takes effect regardless of what you set in the next calls.

Test script:
Precondition: two hosts with IPv4 AND IPv6. 
Place the script returning your remote address on one server and the test-script on the other. Execute the test-script.


The test-script eliminates cache-issues on both servers by using random additions to the URL fetched

Expected result:
CURLOPT_IPRESOLVE should take effect on each call, especially in combination with CURLOPT_FRESH_CONNECT

Actual result:
there is always the connection-type used which was used for the first connect


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-12 22:52 UTC]
-Status: Open +Status: Not a bug
 [2015-02-12 22:52 UTC]
The cURL library caches hostname lookups (in additional to reusing connections).

You can disable it globally with CURLOPT_DNS_USE_GLOBAL_CACHE=false (default true), or individually set CURLOPT_DNS_CACHE_TIMEOUT=0 (default two minutes) for the cache entry to expire when you close the connection.
 [2015-02-12 22:57 UTC] vali2015 at validom dot de
This solves it, thanks so much!
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Feb 27 10:01:24 2021 UTC