Root Domain Setup Issue – CNAME Only Works for Subdomain (Using Cloudflare)

Viewed 71

Hi,

I’ve successfully deployed my app on your platform and everything works great—thank you for that!

However, I’m facing a problem when setting up a custom root domain (example.com). Your documentation recommends pointing a CNAME to your platform’s domain, which works fine when I use a subdomain like (www.example.com).

The issue is that CNAME records aren't supported at the root domain level (RFC limitation), and since I’m using Cloudflare to manage DNS, I can't set a CNAME directly on the apex/root domain.

Could you please advise:

Is there a recommended alternative, such as using A or AAAA records to point the root domain to your platform?

Any other configuration (via Cloudflare or otherwise) that would make root domain routing work properly with your platform?

I’d like to use the root domain (without www) for my app, and would appreciate any guidance or best practices you can share for this setup.

Thanks in advance!

1 Answers

Cloudflare provides a feature called CNAME Flattening, which lets you set up a CNAME-like behavior on the root domain. Here's how:

In Cloudflare DNS settings, set an A record for @ (root) pointing to any placeholder IP (e.g., 192.0.2.1).

Then, set a CNAME for www.example.com pointing to your ClawCloudRun app’s target domain.

In Page Rules or Cloudflare Redirect Rules, set up a 301 redirect from example.com to www.example.com.

This ensures:

Visitors going to example.com are automatically redirected to www.example.com

Your app continues working with the CNAME target.