[Custom domain] Can I point to cname.myapp.com instead of myapp.onrender.com?

Hey team,

I know I can add a custom domain, say for admin · myapp · com. I need to add a CNAME and point admin to myapp · onrender · com.

But the thing is, I want to point the admin subdomain to something like cname · myapp · com. So I added an ALIAS record and made cname · myapp · com an alias of myapp · onrender · com.

But it didn’t seem to work correcrly, the certs can never be issued. But once I point admin to myapp · onrender · com, everything starts to work again.

Can anyone give me some hint one how to make cname · myapp · com work?

Thanks,
Damon

Hey Damon, if I understand correctly,

  1. You have myapp.onrender.com
  2. You have a CNAME record for cname.myapp.com targeting myapp.onrender.com
  3. You have a ANAME or CNAME record for admin.myapp.com targeting cname.myapp.com

Is that correct?

For 2, I actually set an ALIAS record for cname·myapp·com targeting to myapp·onrender·com

For 3, not only I want my own subdomain like admin·myapp·com targeting to cname·myapp·com, but also I would like to have my clients target their own website to cname·myapp·com, like let my client have a CNAME record for myapp·client-web·com targeting to cname·myapp·com

Thanks for taking a look!

That setup should work. However, it looks like you have the wildcard custom domain *.myapp.com set up already for your service. You should be all set to use admin.myapp.com on that service without adding it as a separate domain.

There should be no issue having your clients use a CNAME for myapp.client.web.com targets cname.myapp.com, so long as cname.myapp.com ultimately targets myapp.onrender.com and you’ve added myapp.client.web.com to your service as a custom domain.

There should be no issue having your clients use a CNAME for myapp.client.web.com targets cname.myapp.com , so long as cname.myapp.com ultimately targets myapp.onrender.com and you’ve added myapp.client.web.com to your service as a custom domain.

Is there a Render API to programmatically add myapp.client.web.com as a custom domain to a web service? Ideally could allow us to provide a “custom domains” feature for our own product without having jump into the Render dashboard.

Hi Nick,

There is unofficial GraphQL API to create custom domain Using the API | Render · Cloud Hosting for Developers.
We will roll out official public API soon Render API | Feature Requests | Render

Hao-Ji

Thanks, this is awesome!

Hey everyone - I am going through a similar process for my app.

A couple of questions

  • Where are you with this process?
  • Are you able to provide custom domain for your customers and verify them within your application using the API?
  • Any issues in production? or some gotcha’s that one should be aware of?

Render’s REST API is now available in early access. With custom domain provided by REST API you can add and get custom domain status, including verified or not, in your application.

1 Like

@Hao-Ji_Wu just sent an email in! Look forward to getting some early access.

I was able to follow the steps in this thread and get things working the way I wanted. I gotcha that was not obvious was that I was using namecheap as the provider, and that caused issues. I switched to Cloudflare and it worked as expected.

There should be no issue having your clients use a CNAME for myapp.client.web.com targets cname.myapp.com, so long as cname.myapp.com ultimately targets myapp.onrender.com and you’ve added myapp.client.web.com to your service as a custom domain.

We tried this and it doesn’t work with SSL. Though, we didn’t add the customer’s domain (myapp.client.web.com) to our service.

when you say

you’ve added myapp.client.web.com to your service as a custom domain.

Do you mean we need to add it via API and ask the customer to do the DNS verification? If that’s the case, it’s much easier to ask the customer to directly point myapp.client.web.com to onrender.com as mentioned here Adding a Custom Domain

What we want to achieve is - allowing customers to map their own domains to a service that we host (say myservice.onrender.com). We have a wildcard subdomain (*.myservice.com) pointed to myservice.onrender.com. Customers access their accounts via customer-1.myservice.com, customer-2.myservice.com, etc. Now we want them to be able to use their own domains to access the service with SSL. We can use APIs to programmatically add custom domains. And we can either ask them to:

  1. point their domain to customer-1.myservice.com. We tried this but it didn’t work.
  2. point their domain to myservice.onrender.com. This is easier to do but exposes render.com as a hosting provider.

Though, we didn’t add the customer’s domain (myapp.client.web.com) to our service.

I think that’s your problem. If you want your service to respond to a custom domain, it needs to be added to the service.

Alan

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