IDN custom domain fails to connect to worker

If you add a Internationalized Domain Name as a Custom Domain to a worker you will see a 522 Connection Timed Out error when trying to open the page.

We have tested this with a simple hello world worker which works fine when requesting directly via its worker hostname but fails when accessed through the custom domain. It also works fine when using a non-IDN custom domain.

There is also a bug in the Cloudflare dashboard where you can’t set an IDN as a custom domain for a Cloudflare Pages project. The interface will incorrectly say that the domain is not valid (but accepts it just fine in other areas of the dashboard). When trying to use the xn-- encoded version it will accept it but then fails after setting the DNS records with an Unknown Error.

Hi there, sorry to hear about this.

Are you able to share the domain in question so we can look at why it is failing?

Failing that, as a workaround could you try creating a Worker Route instead of a custom domian?

Hi Erisa!

Thank you for your reply. We have tried the Worker Route method you suggested but it results in the exact same issue (522 error). We removed the Custom Domain, made sure that the WORKER DNS record did not exist anymore, added a fake proxied fallback A record to and added Worker Routes for* as well as ** pointing to the hello world worker.

I can share the domain name but would like to not do so publicly. Can I DM you somehow or reach you by email?

There are actually two IDN Custom Domains set as triggers for this Worker and one seems perpetually stuck in “Initializing” while the other switched to “Active”. Both result in the same errors though.

The other bug for the Custom Domain in Pages can be easily reproduced with any kind of IDN btw. Try for example to enter €.com and you will see the dashboard claims it’s an invalid domain.

Again thank you for your help.

So for this Pages issue, you will need to enter the “Punycode” form of the domain (Usually starting with xn–)

I have sent a DM you can use to share the domain.

Having the exact same problem. I am able to add the domain with the Punycode equivalent.

Custom domain says it is “active”

However when going to the domain I get a “Connection timed out, Error code 522

I can DM the domain if that helps.