cURL / Mailing Lists / curl-library / Single Mail


Reducing the number of DNS queries in the multi handle.

From: Tsachi <>
Date: Wed, 26 Nov 2008 12:41:01 +0200

(I am using "libcurl 7.19.1" with c-ares 1.5.3 (over linux)).
I am writing a program that uses the libcurl to fetch a bundle of urls
using the multi interface.

Now, many of the urls I am fetching belongs to the same domain.
Example: , ,

I can see that all DNS requests are sent at the beginning (probably
right after calling curl_multi_perform()) that's b/c I am using
asynchronous name resolves.
I have noticed that the libcurl issues a different dns request for
every URL in the multi handle although many of them share the same
This means that for the example above I get to see 3 DNS requests for

I am wondering if there is an option that I can use to tell the
libcurl to issue only one DNS request for and only when
response arrives perform the HTTP requests for all the URL's sharing
the same domain ?

Received on 2008-11-26