[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.