Add domain to pages project via A record

For Workes & Pages, what is the name of the domain?

truvvl.blog

What is the issue or error you’re encountering

Domain can only be added via CNAME

What steps have you taken to resolve the issue?

I run a SaaS on pages. Customers can add their own domain by setting two CNAME records (www and root-level). The pages project handles the redirect automatically (www to root-level or vice versa, depending on the customer’s choice).

This worked great when testing. But now I have a customer who bought his domain on Godaddy. Godaddy doesn’t allow adding a CNAME record at root-level.
They have an option to set up a redirect (root-level to www), but apparently some providers allow neither redirects nor CNAME at root-level (plus, some customers have existing sites on root-level with a redirect from www and wouldn’t be happy about seeing a redirect loop if the old redirect is still cached).
I would have to ask my customers to change their DNS provider which adds an extra step and makes things more complicated.

Instead, I want to instruct my customers to add an A record at root-level and CNAME for www which works with any DNS provider.

I can dig the current IP address from the CNAME record and ask my customers to set this as A record, but if this IP ever changes, my customer’s site would go offline.

Pages should provide the option to add a root-level domain via A record.

This was answered on Discord: https://discord.com/channels/595317990191398933/1261965501362602105

tldr: You can’t do it via A record because Cloudflare IPs can change and the current recommendation you currently provide to customers is the best approach.

2 Likes

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