DNS resolution inside the worker seems different when worker is executed via its Custom Domain


I have a worker that’s working fine when I reach out via its worker.dev route but that’s not behaving well when we reach out on its custom domain.

Don’t get me wrong, the worker is executed. (I have logs etc.) BUT the fetch that the worker does has not the expected result.

I don’t know if there is a relation but I have a custom domain set via a CNAME (I don’t have the full zone controlled by Cloudflare).

To recap:
Scenario 1: OK

  • worker is reachable on shop-api-production.something-edge.workers.dev

  • worker does a fetch to grab data from another api: api.something.com

  • data received correctly 100% of the time

  • OK Scenario 2: FAILURE

  • same exact worker is reachable on shop-api-production.something.com

  • it does a fetch to grab data from another api: api.something.com

  • it seems to resolve or to reach another server: something else.

I have logs via the log stream, and it’s easily reproducible.

Do I miss something?

Is api.something.com also using a Worker?

no, it’s an existing api on AWS.

Cloudflare zone is set up as Partial DNS with CNAME.

it’s really like the worker, only when reached on the custom domain is resolving differently.

Is that possible?