cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: CURLOPT_DNS_CACHE_TIMEOUT and DNS queries

From: Pankaj Takawale <pankaj.takawale_at_gmail.com>
Date: Wed, 20 Apr 2011 10:02:15 -0400

>
> Message: 1
> Date: Tue, 19 Apr 2011 15:45:14 -0700
> From: Dan Fandrich <dan_at_coneharvesters.com>
> To: curl-library_at_cool.haxx.se
> Subject: Re: CURLOPT_DNS_CACHE_TIMEOUT and DNS queries
> Message-ID: <20110419224513.GA30601_at_coneharvesters.com>
> Content-Type: text/plain; charset=us-ascii
>
> On Tue, Apr 19, 2011 at 06:23:57PM -0400, Pankaj Takawale wrote:
>> My environment:
>> curl: 7.21.4
>> CURLOPT_DNS_CACHE_TIMEOUT: 30 secs
>> CURLOPT_DNS_USE_GLOBAL_CACHE: 1
>> Connection : persistent
>>
>> Server breaks connection every minute. Then I use CONNECT_ONLY to make
>> connection if its broken, so that subsequent requests always gets good
>> connection.
>>
>> I'm capturing DNS queries (filter: udp port 53). I can see DNS queries
>> to targeted server are captured when I start application.
>> But after every 30 secs, when DNS cache times out, there are no
>> further DNS queries issued by application.
>>
>> I tried putting breakpoint on lib/url.c:Curl_hostcache_prune
>> lib/hostip.c:hostcache_timestamp_remove, and I see cache entry is
>> being removed.
>> Why further request is not issuing DNS query?
>>
>> When I turn off DNS caching, I can see DNS queries captured for every request.
>
> Which DNS resolver are you using? Some system resolvers can do their own
> caching, preventing further queries on port 53.
>
There is no DNS resolver(caching) on the box where Im running curl client.
Im capturing packets on same box. So I believe I should be able to
capture all DNS packets going out of this box.
When I disbale curl DNS caching, I can see DNQ query packets for every request.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-04-20