cURL / Mailing Lists / curl-library / Single Mail


Re: Can't resolve host

From: Mathieu Fregeau <>
Date: Mon, 9 Mar 2015 14:42:10 -0700

The LAN settings in Internet Explorer (which is the official configured client at my company) is set at "use automatic configuration script" and points to a .pac file on the Ethernet. The proxy parameters are left blank and are disabled.

I can run Firefox though which I needed to add a few domain names under "network.automatic-ntlm-auth.trusted-Uris" (several domain separated by comas) as well as the same settings under "network.negotiate-auth.delegation-uris" and "network.negotiate-auth.thrusted-uris"

I came to know which domain to add to these Firefox settings after I clicked a non-Ethernet link and Firefox would tell me that such and such domain wasn't on the approved list or something.

Possibly that one of these (or all) is a proxy. Can libcurl accepts a list of proxy so I can try mimicking Firefox perhaps? I guess my main question now is do I need to focus on the proxy settings or could it be another setting instead? Thanks for your inputs.


> On Mar 9, 2015, at 1:32 PM, Ray Satiro via curl-library <> wrote:
>> On 3/5/2015 7:52 PM, Mathieu Fregeau wrote:
>> library version: curl 7.41.0
>> compiler: c++, mingw32 (gcc 4.8)
>> I can't resolve my request when at the office computer, while it works well at home. I suspect something about firewall, but I can browse on the same url via a browser (firefox and ie). Is there a way to have curl use the same exact settings of the current browser? such that I can use the same channels or firewall bypass?
>> Here are my request settings:
>> curl_easy_setopt(curl, CURLOPT_URL, url);
>> curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);//follow redirection
>> curl_easy_setopt(curl, CURLOPT_REFERER, url);
>> curl_easy_setopt(curl, CURLOPT_HEADER, 0L);
>> curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);//no progress
>> curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);//1=verbose, 0=non verbose
>> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
>> curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912 Safari/535.7 Firefox/3.5.16");
>> curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L);
>> curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);//report failure for http code > 400
>> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteFunction);//function to keep response
>> curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);// keep response in variable
>> res = curl_easy_perform(curl);
>> like I said it works from my home computer but just not at work.
> Go into Internet Options > Connections > LAN settings and see if you have a proxy server. You can use CURLOPT_PROXY to set the proxy [1]. There isn't functionality in libcurl to get that proxy configuration automatically, though you can find some code that shows how to do that at [2].
> Also I'm reminded of a similar "can't resolve host" in windows question on the mailing list a week ago where the user had only partially initialized libcurl [3]. Absent that try my suggestions from that thread [4].
> [1]:
> [2]:
> [3]:
> [4]:
> -------------------------------------------------------------------
> List admin:
> Etiquette:

List admin:
Received on 2015-03-09