0

I am trying to get my project domain mypage.com to be hosted at and point to a firebase project A, and also have a sub domain, admin.mypage.com, point to and be hosted at firebase project B.

I have my mypage.com domain registered at domains.google.com.

I have successfully connected mypage.com to project A, but creating a new A record with name admin and pointing it to the IP address within firebase project B overrides the initial A record, connecting the mypage.com domain to project A. problem is that Firebase assigns the same IP address for all my projects it seems.

Is there a way for me to achieve this with google domains service?

My current DNS looks like this:enter image description here

Later on I tried using the CNAME record, and pointing it to project B's auto generated Firebase domain project-b.web.app. Will see if that works.

Jousi
  • 121
  • 4

2 Answers2

2

This is my DNS setup on Cloudflare. Perhaps this can be a helpful example for you. I have two A records. One pointing to the production server and the other one points the staging one.

So for this setup, the URL to the production server is knct.me while the URL for the staging server is staging.knct.me. The 2 A records work without problems though staging.knct.me looks like it is a CNAME record of knct.me

The IPs in the picture are changed to random ones for security reasons.

enter image description here

Aviv Lo
  • 297
  • 1
  • 8
  • Interesting so you dont use the @ in any A record, just the full domain name? Because the @ is how firebase tells me to set it up. I am unsure of what it does/means so I blindly follow it...maybe I will read up on it and see. – Jousi Sep 27 '20 at 19:09
  • @Jousi That is just how CloudFlare displays it. They display the domain name instead of @. It's a bit confusing at first. They both mean the same thing. – Michael Hampton Sep 27 '20 at 19:17
  • Oh I see. Either way, the problem is that Firebase assigns the same IP address for all my projects it seems, so I dont think this is going to work. I did read about how the different types work and a solution might in the end be the CNAME that will point to one of the Firebase generated project B domains. I have added the admin.mypage.com CNAME record which now points to projectB.web.app. Will see what happens. – Jousi Sep 27 '20 at 19:32
  • @Jousi let us know. – Aviv Lo Sep 27 '20 at 19:44
0

Ok so after trying all the above, the way it worked for me was using a CNAME record pointing to the auto-generated firebase domain for the project.

Looks something like this:

admin       CNAME       1H       my-project.firebaseapp.com
Jousi
  • 121
  • 4