cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to disable name lookup for a given request?

From: A. Zatoon <abozizo_at_gmail.com>
Date: Thu, 6 Oct 2005 07:51:50 -0700

    Thanks for your reply. However I have a few points to clarify.
- I read the whole manual, and I understand that the time_namelookup
variable is the time it
took until the "name resolving" was finished. Given and IP address,
there shouldn't be any
"name resolving." I have verified that by looking at the network traffic.

Given the above facts, then how come in my trace
---------------------------------------------------------
$ curl -A 'Mozilla/5.0' -s -o /dev/null -w
%{time_total},%{time_namelookup},%{time_connect},%{time_pretransfer},%{time_starttransfer},%{size_download},%{http_code}
http://68.142.226.53

2.209,2.164,2.169,2.169,2.190,43034,200
$
--------------------------------------------------

it took more than 2s to "resolve the name"? Does is mean that the
initialization phase of the name resolution procedure sometimes is
high (due to context switching, for example)?

Thanks a lot for you time and effort.
::Zatoon::

On 10/6/05, Daniel Stenberg <daniel-curl_at_haxx.se> wrote:
> On Wed, 5 Oct 2005, A. Zatoon wrote:
>
> > I wanted to disable the name resolution, so I wrote the IP address of the
> > web server in the curl command. However, when I output the
> > %{time_namelookup} variable, its value is not zero.
>
> Did you read the man page explanation for 'time_namelookup' ?
>
> The time, in seconds, it took from the start until the name resolving was
> completed.
>
> It simply cannot be zero to follow this.
>
> > Any suggestion on how to disable the namelookup part?
>
> Using the IP-only address disables the name lookup. You could easily verify
> this by snooping on the network when you invoke curl, and you shall see that
> there is no DNS traffic happening.
>
> This topic reminded me of a document I write this summer that I've forgotten
> about, which explains the timings libcurl reports (which are pretty
> straight-forward translated to single -w variables):
>
> http://cool.haxx.se/cvs.cgi/curl/docs/libcurl/getinfo-times?rev=HEAD&content-type=text/vnd.viewcvs-markup
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2005-10-06