Unable to set wildcard subdomains for pages custom domain

For domains managed by Cloudflare DNS, I would like to see Cloudflare pages when accessing with any subdomain.

Domain notation here

  • hostzone-domain.com: domain managed by Cloudflare DNS
  • mydomain.pages.dev: The domain of Cloudflare pages

○Wthat I want to achieve
access with (Any subdomain).hostzone-domain.com
→display the web page of mydomain.pages.dev

○What I tried 1
I tried to add a wildcard subdomain in the CustomDomain settings of Cloudflare pages as shown below.
However, I got an invalid domain error and could not add it. (Error message: “Please enter a valid domain.”)
* .hostzone-domain.com

○What I tried 2
Added DNS management domain in CustomDomain settings as below.
Then, in the Cloudflare DNS management settings, I added a wildcard CNAME as shown below.
Name: *, Content: hostzone-domain.com
However, when I actually accessed aaa.hostzone-domain.com , I got a 522 Connection timed out error and could not display the page.

I tried the above two, but I couldn’t realize it.
Is there a way to display Cloudflare pages in any subdomain for the root domain of Cloudflare DNS management? Please kindly advise.

Only if you use a Worker to fetch the pages.dev zone really - Pages custom domains don’t support wildcards.

1 Like

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