TransWikia.com

Main domain hosted on Google servers and registered with Google domains, but I want a subdomain ONLY to point to Netlify

Webmasters Asked by Robolisk on March 8, 2021

Been trying to this for a few days after countless tutorials and I can’t seem to figure it out.

The desired outcome is this:

www.example.com is my main react app hosted on Google Cloud Servers.

blog.example.com is my Gatsby blog hosted on Netlify.

More Detail:

I have a robust react app that is hosted on www.example.com, on a Google cloud server. The domain is registered with Google domains.

I want to add a new subdomain, blog.example.com and have it point to Netlify, where I host a simple Gatsby blog.

Everything I find always leads me to change my apex/main domain to netlify servers, but this is not the desired outcome as it will no longer point to my main app, and the email accounts associated with it stop working as well.

I have no idea how to do it.

From my understanding, we can add an A record on Google domains:

blog.example.com A 1.2.3.4

or add a CNAME:

blog CNAME → theNetlify-app-name.netlify.app

Neither of these solutions seem to work.

Any suggestions?

One Answer

You can use a CName to map your desired sub domain to your Netlify site as per their documentation:

Mapping an existing sub-domain

The important thing is that both ends (Google Domains and Netlify) need to know about the new domain.

In summary you need to configure your external DNS provider to point your domain to Netlify:

On your Netlify control panel, select the "Custom domains" panel, select "Check DNS configuration" next to the custom domain to open customized details about the DNS records you need to configure.

To point a subdomain such as blog.petsofnetlify.com to your site on Netlify, you must first create a CNAME record with your DNS provider.

For example, if your site’s domain is blog.petsofnetlify.com and your Netlify subdomain is brave-curie-671954.netlify.app:

  • Find your DNS provider’s DNS record settings for your apex domain, petsofnetlify.com.
  • Add a CNAME record with your subdomain, blog, as the host.
  • Point the record to your Netlify subdomain, brave-curie-671954.netlify.app.
  • Save your settings. It may take a full day for the settings to propagate across the global Domain Name System.

Once you've completed those steps with Google Domains, you then need to complete the steps in the Netlify control panel to assign the custom domain to your site:

Select "Add custom domain" at the bottom of the "Custom domains" panel, and enter your domain name. Select "Verify".

Pressing verify will check that the DNS settings you've entered in Google Domains are correctly configured and pointing at the Netlify site - if they are, then your new domain should be configured and serving pages as expected.

Answered by Zhaph - Ben Duguid on March 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP