Hosting subdomain on netlify

Hello Nelify Community,

I am trying to figure out how to I host my subdomain on Netlify.com.

for eg. I need to keep subdomain.mydomain.com url (can not use subdomain.mydomain.netlify.com)

Neltify only offers direction on changing DNS settings which works if you want to host your primary domain on netlify however since changing the DNS configs for a subdomain is not possible how would I go about it.

Thank you very much
Best regards
Maurice Oppenberger

Welcome to the Community Maurice!

For all kinds of subdomains it should be possible to use a CNAME record.
Our docs have more instructions on this: Configure external DNS for a custom domain | Netlify Docs

Hi Marcus,

Thank you for the quick response. Would you suggest only editing the CNAME? I solved my issue by editing the A record of my subdomain. However now I am faced with the issue that I lost access to my wordpress panel which was location at subdomain.mydomain.com/wp-admin.
And reading about it suggests to keep the wp installation on a separate subdomain.
Is that really the best/only option to solve that issue?

thank you for your support
Maurice

Can you describe more about what you are trying to achieve?
Netlify will not be able to host your Wordpress installation, but you seem to be aware of that.

Do you want to move to a Netlify site which is backed by data from a wordpress installation (like it is possible with Gatsby)?
If so, I’d advise you to put a DNS record in place at something like wordpress.mydomain.com pointing to your Wordpress hosting. This will be the place for editors to access the CMS UI and for the site generator to get its data from.

If there are dynamic parts of your wordpress installation that you’d still like to host along your static site you can use redirect/proxy rules: Rewrites and proxies | Netlify Docs
(Though I think you should be fine without those)

Yes, that is exactly what i am trying to archive.
my site is a gatsby/wordpress build. I added an additional DNS A record at
wp-mysubdomain.mydomain.com to netlify and waiting for the propagation.

thanks for your suggestion
Maurice

Glad I was able to help.

I can also suggest to set the TTL of your records to 60 before you are applying changes so changes apply fast. (And set them back to their default once you verified.)

awesome, thanks for the tip

Hi, After adding CNAME, my subdomain is pointing to Netlify but showing security erro as “your connection is not private”.
After i proceed, it is showing a page with “Not found” text on it.

which domain is this regarding?

I have my domain, thecodewolves.com registered DNS with Digital ocean, i want a subdomain dhome.thecodewolves.com to be pointing to my netlify website. I did that using CNAME as mentioned in the docs, but showing error because of certificates. Its urgent, i need to resolve this ASAP.

Please help!

hey @Reddemonfox, if you are using DigitalOcean for your DNS for your domain, you won’t be able to use Netlify DNS for the subdomain - is that what you are trying to do?

yes. i am. So is there a way i can just point my subdomain to netlify? because i have my other services pointing to different things so migrating my domain to netlify won’t be possible for me.

And when i started this i saw the docs, and in there it is specified that you just need to add a CNAME to your DNS provider panel, and it will start working. If i am not able to do that then i’ll be in a lot of trouble.

no, there isn’t a way to use Netlify DNS to point to a subdomain if you are not using Netlify DNS to handle the main domain, but you should be able to manage your DNS with DigitalOcean to point to the subdomain if that is what you are using to manage the main domain. Have you tried looking into that?

I bought the domain from GoDaddy,
I then changed it’s nameservers to Digital oceans servers. So i am managing my site’s DNS through Digital ocean.
Now i have created a site on netlify xxxx.netlify.app
now i want that netlify app should be hosted on a subdomain xxxx.thecodewolves.com.
So for that i added a CNAME to my digital ocean DNS management panel for this site.
This is what i saw is doable in the netlify docs.

If that’s not possible then i’ll have to rewirte complete site and CMS code from scratch again to host that on self hosted server.
Please let me know if its doable.
Thanks!

Netlify can definitely host a site on a subdomain like that.

Did you configure your netlify site to have the name applied (in our admin UI)? You would need to do that before we’d try to get a certificate,or return content for that hostname. If you’ve done that, please tell us the hostname and stop using placeholders like “xxx” which we cannot usefully advise on, please.

Sorry that was for security purpose and my many services are hosted on that domain.

is the netlify app i have created.

and dhome.thecodewolves.com is the subdomain i have pointed to this site using CNAME

Thanks!

As I tried to describe yesterday, you have to actually apply that hostname to a site in our admin UI. You do that here, for that site: Netlify App

Once you have added “dhome.thecodewolves.com” as a custom domain there, we’ll begin trying to get an SSL certificate and serving your site at that name :slight_smile:

That’s awsome !! Thank you sooo much :grinning: :smiley: :innocent:

1 Like

Hi, really sorry for bumping an oid thread but I’m having the exact same problem, I want to point a subdomain kmk.cs.ui.ac.id to kmk-csui.netlify.app . I have set a CNAME record but when I tried to register my subdomain on netlify admin I get custom_domain used even though what I entered is a subdomain.

Screenshot_20220113_122033

Welcome to the forums @garyteofanus

This is normal because ui.ac.id is a registered domain. I can see kmk.cs.ui.ac.id has a CNAME record pointing to kmkcsui.netlify.app. Click the Add domain button to continue.

Please note, kmk.cs.ui.ac.id is different to www.kmk.cs.ui.ac.id and unless you add a CNAME for www.kmk.cs.ui.ac.id as well, you cannot add it as a custom domain.