curl_easy_perform: Couldn't resolve host name
<p>I'm having a bit of an odd issue with <code>libcurl</code> - it's refusing to resolve a particular URL, returning the error message "Couldn't resolve host name." It has no issues resolving other hosts. I suspect the reason is that the URL which fails returns a 302 redirect, but I've set appropriate options for it to be followed.</p>

<p>The URL in question: <a href="http://servermods.cursecdn.com/files/922/48/worldedit-bukkit-6.1.3.jar" rel="noreferrer">http://servermods.cursecdn.com/files/922/48/worldedit-bukkit-6.1.3.jar</a></p>

<p>The relevant code:</p>

<pre><code>CURL* curl;
FILE* data;
std::string url;

// ...

curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl, CURLOPT_FILE, data);
curl_easy_setopt(curl, CURLOPT_URL, url);

curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);

CURLcode res = curl_easy_perform(curl);
</code></pre>