Search code examples
google-app-enginewebdnsgoogle-cloud-platformgithub-pages

Subdomain to resolve to a different website via DNS


I have two websites: (A) one is a static website hosted on github while the other (B) is an admin page hosted on Google Cloud (app engine). Currently, the DNS is set up so that the root of the site resolves to A. I would like to set up a sub-domain such as admin.root.com/ to resolve instead to B. I don't want to simply redirect the user as I would like the URL to be the one of the site.

Is there a way to achieve this via DNS? Note: I am using CloudFlare for the DNS settings.


Solution

  • Sure you can, all you need is just to set up a CNAME record for that on the DNS which manages root.com.

    Supposing you want admin.root.com to point to somepage.github.com, the CNAME record shall consist of the following key/value pair: key: admin value: somepage.github.com.