# 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:** 1\
**Showing post:** 3

<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?

---

_[View the full topic](https://forum.infinityfree.com/t/php-curl-cannot-resolve-cloudflare-workers-hostname/121553)._
