Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup domain & its sub domain to different Firebase hosting projects

Suppose my domain is mydomain.com, and subdomain subdomain.mydomain.com. I got it from Godaddy.

What I want

I want to run different websites on each.

mydomain.com -> Website 1

subdomain.mydomain.com -> Website 2

How I setup so far

Website 1 is hosted on Firebase project 1 and accessible via default URL firebase-projectid.firebaseapp.com.

Website 2 is hosted on Firebase project 2 and accessible via default URL.

Both Firebase projects are on same Google account.

What I have done successfully so far

I started with mydomain.com -> Website 1

Verified domain by adding TXT record provided by Firebase project 1.

Added couple of A records to point domain to Firebase project 1 hosting.

So far so good, and mydomain.com is working fine.

What is not working

Now I want to host subdomain.mydomain.com -> Website 2 with Firebase project 2.

I started with custom subdomain, added subdomain.mydomain.com. Firebase had already verified domain and directly provided me ip address for A records. I added both A records on my domain registrar.

As far as I understand, these are only steps needed. But subdomain.mydomain.com is not working and Firebase still shows status of subdomain as Needs Setup.

Observations

Two things I observed seems strange to me.

  1. IP address provided by Firebase for both projects mydomain.com and subdomain.mydomain.com are same. Not sure if this is normal or not.
  2. subdomain.mydomain.com with A records, is not propagating when checked on https://dnschecker.org/. However, if subdomain is added via Godaddy Forwarding option, then it start propagating in few minutes.

Questions

  1. BTW, is it really possible to host domain and its subdomain on Firebase running different websites?
  2. If yes, then is there any other step which I am missing?
  3. Any idea why subdomain.mydomain.com is not propagating. I checked just after 10 mins. May be I need to wait longer?
  4. Anything wrong I am doing to setup subdomain.

I tried exploring other threads but couldn't understand what I am doing wrong. Any help will be appreciated.

like image 591
Khawar Avatar asked Jul 28 '18 07:07

Khawar


1 Answers

After scratching my head for few more hours I found issue at Godaddy side. While adding subdomain A record, I was providing host as subdomain.mydomain.com, which was wrong.

Instead of subdomain.mydomain.com host should have been subdomain only. After updating host it started propagating in few seconds, and status on Firebase is Pending. After a minute, subdomain.mydomain.com is working fine.

like image 63
Khawar Avatar answered Sep 26 '22 22:09

Khawar