SAAS - Custom Domain Feature

Hi,

I am building a Saas platform (www.saas.com) where user have unique subdomains such as user1.saas.com, user2.saas.com etc. And give them a feature to add their own custom domain.

To add custom domain, users define cname for app.saas.com and A record for public id in cloudways.

If i want to move from Digital Ocean to AWS at some point, then public ip is going to change. So custom domains wont work until users change their A record.

I wonder if is there a better way to give custom domain feature to user instead of adding A record, or how can i handle this kind of situtations in CW?

Thanks in advance,
Anil

2 Likes

Yes, this is my concern too. Any help would be highly appreciated.

I’m also interested for that.

i am also interested … waiting for cloudways reply

Is your custom domain structured like this:
user2customdomain.saas.com

or like this:
saas.userdomain.com

Do you want your customers to be able to access your service at the root of the domain like
userdomain.com

Or do you want to require some sort of subdomain like
saas.userdomain.com

Hi Lucas,

saas.com is just a landing page where users can signup.
Custom domains are structured like user2customdomain.saas.com
and i want my customers to define their own custome domain as userdomain.com

You’re coming up against DNS specifications where a naked domain cannot point to a FQDN and must instead point to an IP address.

This is a restriction that your customer will come up against in the configuration of their domain and there’s not a lot you can do. I would suggest that you require your customers to use a subdomain (even if it’s www).

If you require your customers to use a subdomain, you can tell them to set up a record like this:
appsubdomain in CNAME user2customdomain.saas.com

Then when you later change your IP address, you can update your A record (or preferably a subdomain wildcard) to the new IP without requiring your customer to change any DNS.

If you need your customers to be able to have a CNAME at the root of their domain, the best you can do is direct your customers to switch DNS. (This might be a hard sell.)


Zenfolio.com is another SAAS service that allows you to set up their service at your own custom domain. Here’s their instructions:

1 Like

https://help.zenfolio.com/customer/portal/articles/408210-using-your-own-custom-domain-name

You could also consider keeping an iptables forwarder on your old DO server so that requests made to your current IP will be forwarded to your AWS IP…

1 Like

Thank you, i read all articles and it is more clear right now. It looks like many saas platform uses CNAME and A Record together for custom domain feature. And iptables could be a solution for server changes.
Just wonder how google made this by using only CNAME. I found a topic as following. You can add your custom domain for your google site by adding CNAME record

https://support.google.com/sites/answer/9068867?hl=en

The Google support article you reference requires that the customer use a subdomain and a CNAME to point to ghs.googlehosted.com

It appears they do not offer the service for root domains, so using just a CNAME is sufficient for this setup. An A record points to an IP address and can be used at the root of the domain. A CNAME can point to another domain, but must be used on a subdomain (unless the client is using Cloudflare or DNS Made Easy or similar)

1 Like