When executing a basic curl request in PHP to a plain text web page (http://whatismyip.org/) it takes more than 10 seconds to respond.
After looking at the info from curl is tells me that the namelookup_time is 10 seconds. I can see the exact same result when executing curl from the command line (Terminal).
Why does it take so long for the name lookup, from what I've read it's more than likely something relating to the server/my computer from which the PHP file is hosted.
Here's my code:
$ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, "whatismyip.org"); curl_exec( $ch ); $ci = curl_getinfo($ch); print_r($ci);
Here's the info:
[url] => HTTP://whatismyip.org [content_type] => text/plain [http_code] => 200 [header_size] => 45 [request_size] => 53 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 10.549943 [namelookup_time] => 10.100938 [connect_time] => 10.300077 [pretransfer_time] => 10.300079 [size_upload] => 0 [size_download] => 14 [speed_download] => 1 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 10.549919 [redirect_time] => 0 [certinfo] => Array ( )