Simple curl request is not working: "Could not resolve host"

I have a webiste hosted on ipage. My website is active on cloudflare. The following curl request fails.
The same curl request used to work with another site hosted on the same ipage with cloudflare. I am not sure why it stopped working recently. Any help would be appriciated.

$url = ‘’;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ‘api_option=paste&api_user_key=’.$api_user_key.’&api_paste_private=’.$api_paste_private.’&api_paste_name=’.$api_paste_name.’&api_paste_expire_date=’.$api_paste_expire_date.’&api_paste_format=’.$api_paste_format.’&api_dev_key=’.$api_dev_key.’&api_paste_code=’.$api_paste_code.’’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);

bool(false) string(36) “Could not resolve host:

Note: The same request is working in my local machine.

It would seem as if the server cannot resolve that hostname.

Whats the output of


Do you have SSH access?

Hi Sandro,

Thank you for helping me on this.

Here is the output:
array(6) {
string(12) “
string(16) “
string(14) “”
string(12) “”
string(13) “”
string(13) “”

I do not have an SSH access for this.

Yeah, it cannot resolve that host name. You need to contact your host for that.

So it is nothing to do with Cloudflare? My hosting was not able to help me with this.
I failed to explain the issue clearly to the hosting team. Can this example will explain the issue to the hosting team? Again, Thank you for helping me with this.

Nothing at all, thats purely hosting related.

Tell you host that you cannot resolve that host for whatever reason on their machine, whereas other hosts appear to work.

Thank you, Sandro.

I will contact the hosting team for this. :+1::+1:

1 Like

Hi @sandro,

I contacted my hosting provider on this issue. (
They do understand the issue. But they didn’t know where exactly or how exactly to fix this. They don’t know whether any special configuration needs to be enabled to connect with

Here is their recent reply.

I was able to replicate the error at The curl and API are enabled in our server. It appears that the API request is not accepted by ‘’. Please contact the hosting provider for ‘’ and check regarding this issue.

I am contacting to get their support. Is there anything else to figure out where exactly or how exactly to fix this? either on my hosting or on

Thank you very much.

Ohh, Christ, where do these companies find these people :roll_eyes:

No, that has nothing to do with cURL or the API or Pastebin. The host name does not resolve and there is nothing Pastebin can do about that. There is some issue with your host’s DNS resolver and only they can tell whats wrong and potentially fix it.


I will check with my hosting again. thank you :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.