#How to add a second-level domain name in cloudflare
8 messages · Page 1 of 1 (latest)
If you simply want subdomain.mydomain.com to display your pages website, you need to add a CNAME record. Free Plan has access to this.
CNAME subdomain.mydomain.com my-website-on-pages.pages.dev
How to access: on https://dash.cloudflare.com select Websites in the left sidebar, choose the website you want, select DNS on the sidebar, then clic the [+ Add Record] button
CNAME is a standard DNS record, you can use any domain as destination (even those you don't own)
Note: It's common to have both mydomain.com and www.mydomain.com pointing to the same HTTP server. You then configure your server to 301 redirect mydomain.com to www.mydomain.com
If you create a CNAME to Pages on its own you will get a 522 error. What you need to do instead for Pages is create a Custom Domain on the Pages project settings, which will add the necessary linking for the domain in the backend and create the DNS record automatically (which will now work)
You’ll need to ask the domain owner to add the CNAME records then?