|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vali2015 at validom dot de
New email:
PHP Version: OS:


 [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: Fri Mar 05 11:01:23 2021 UTC