SAAS - Custom Domain Feature


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

To add custom domain, users define cname for 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,


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:

or like this:

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

Or do you want to require some sort of subdomain like

Hi Lucas, is just a landing page where users can signup.
Custom domains are structured like
and i want my customers to define their own custome domain as

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

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.) is another SAAS service that allows you to set up their service at your own custom domain. Here’s their instructions:

1 Like

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

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

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