# PHP cURL cannot resolve Cloudflare Workers hostname

**URL:** <https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553>\
**Category:** Hosting Support\
**Created:** [October 24, 2026, 2:43am UTC](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553 "2026-10-24T02:43:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkj001](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/hkj001/32/68404_2.png) [@hkj001](https://forum.infinityfree.com/u/hkj001)\
**Post date:** [October 24, 2026, 2:43am UTC](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553/1 "2026-10-24T02:43:11Z")

</div>

### Website URL

[https://santriyasalam.ct.ws/](https://santriyasalam.ct.ws/)

### Error Message

Hello InfinityFree Support,

My website is hosted at santriyasalam.ct.ws.

From PHP, cURL can connect to [https://www.cloudflare.com/cdn-cgi/trace](https://www.cloudflare.com/cdn-cgi/trace) successfully with HTTP 200. However, it fails to connect to my Cloudflare Worker:

[https://sinkron-laporan-santri.masjidarrohman21.workers.dev/ping](https://sinkron-laporan-santri.masjidarrohman21.workers.dev/ping)

The error is:

Could not resolve host: sinkron-laporan-santri.masjidarrohman21.workers.dev

The hostname resolves correctly from my local Windows computer, and the Worker is active in Cloudflare. The PHP cURL extension is available on the hosting server.

Could you please check whether the hosting server’s DNS resolver has an issue resolving this hostname, or whether outbound HTTPS connections to workers.dev are restricted?

Thank you.

### Other Information

Additional diagnostic results:

- PHP cURL extension is available.
- The hosting server can connect to Cloudflare’s regular website successfully (HTTP 200).
- The Worker URL works when opened from my local computer.
- The same Worker hostname cannot be resolved from PHP on the hosting server.

Please advise whether this is a DNS resolver issue on the hosting server or a restriction affecting this specific hostname.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 24, 2026, 2:43am UTC](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553/2 "2026-10-24T02:43:11Z")

</div>

Welcome to the InfinityFree community forum! Good to have you here.

- Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
- Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
- AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
- Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

---

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [October 24, 2026, 2:43am UTC](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553/3 "2026-10-24T02:43:20Z")

</div>

_Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look._

It’s a restriction on the hostname, not a DNS resolver problem. Cloudflare Workers is on our list of blocked services for outbound connections from free hosting.

Our article on outbound connections lists Cloudflare Workers next to Discord, Telegram and Google Apps Script. It says blocked services may not resolve at all, so you get `cURL error 6: Could not resolve host`. That matches your error. It also explains why `www.cloudflare.com` works and your `workers.dev` hostname doesn’t.

Here’s the article:

> [@Can I connect to other servers from my website? (Sockets, cURL and APIs)](https://forum.infinityfree.com/docs?topic=49348):
>
> Your website can connect to other servers, for example to call an API, load data from another website or send email through an external SMTP server. This works with functions like cURL, file\_get\_contents() and fsockopen(). However, to prevent abuse, outbound connections are limited to a small set of ports and services. Which ports can I use? Port Used for 80 HTTP 443 HTTPS 587 SMTP (sending email) All other ports are blocked. This means you cannot connect to things like: APIs …

The article suggests upgrading to [premium hosting](https://www.infinityfree.com/premium/) if you need to reach these services, or using an alternative service.

Staff have also said this block is intentional and won’t be lifted. The reason is that Workers were mostly being used to get around the Telegram block and to send spam. Another user’s topic got the same answer:

> [@Outbound DNS problem](https://forum.infinityfree.com/t/outbound-dns-problem/120368):
>
> Website URL [https://saxeknife.ryex.uk/](https://saxeknife.ryex.uk/)Error Message Outbound curl from my site suddenly fails with “Could not resolve host: saxeknifediscord.95-rui-silva.workers.dev”. Other Information (Cloudflare Worker). It worked until ~24h ago, no config changes. Can you check outbound DNS on my account’s server?

---

<div class="post-metadata">

**Author:** ![Candev](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/candev/32/68287_2.png) [@Candev](https://forum.infinityfree.com/u/Candev)\
**Post date:** [October 24, 2026, 11:55am UTC](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553/4 "2026-10-24T11:55:35Z")

</div>

Here’s the reason:

> [@Lemni](#):
>
> Cloudflare Workers is on our list of blocked services for outbound connections from free hosting.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 31, 2026, 11:56am UTC](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553/5 "2026-10-31T11:56:00Z")

</div>

Closed on October 31, 2026, 11:56am UTC

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