Add domain to pages project with A record

I run a SaaS on pages. Customers can add their own domain by pointing two CNAME records (www and root-level) to customer.mydomain.com. The deployed page handles redirects from non-www to www or www to non-www, depending on the customers choice. The problem is that some customers use a domain registrar/DNS provider that does not allow adding a CNAME record at root level. In this case I tell them to create a CNAME record only under www and create a permanent redirect to www at the root level. Which is a problem if their previous setup redirects www to the root level. In this case I recommend them to switch their DNS provider. Both is more complicated than adding an A record. Is there a way to let my customers add an A record instead of the CNAME at root level?
6 Replies
Hello, I’m Allie!
Sort of? You can dig the CNAME target and use those IP Addresses for the DNS Record, but I don't think we offer any guarantees that those IP Addresses won't change later on That or just having them bite the bullet and redirect the root to www anyway, and wait out the redirect cache
jpphotography
jpphotography2mo ago
Thanks! If there's no guarantee that the IP addresses won't change that would be a huge problem if they stop working, since all my customers' sites wouldn't work anymore
Hello, I’m Allie!
Yeah. I don’t think they change very often, but iirc they can change at some point
jpphotography
jpphotography2mo ago
So I guess the best way is to ask my customers to configure a redirect with their dns provider? I think not every DNS provider offers the option to create redirects though
Erisa
Erisa2mo ago
Yeah your recommendation (use www and have apex redirect to it) is the best step forward for those with providers that dont support CNAME/alias on apex, you shouldn't ever hardcode Cloudflare IPs unless you're an Enterprise customer paying for Static IPs. While it's unlikely they'll change, they can and if they do it will completely screw up your operations.
jpphotography
jpphotography2mo ago
The problem is that some registrars, including GoDaddy, don't support https for redirects, only http. This means that all existing links for my customer would be broken. I'll try setting up my own server that handles redirects, but it would be much better if this was supported by Pages. I don't think I'm the only one having this problem - any SaaS on Pages will sooner or later encounter a customer who uses a registrar like GoDaddy.
Want results from more Discord servers?
Add your server