How to add a subdomain using Firebase and Namecheap? - firebase

I am trying to add a subdomain for my firebase app but it is not working. I've looked at Firebase site's Subdomain setup and this other SO post How do I make a custom subdomain on Firebase? but they didn't really help me.
I have a firebase app that is currently running: myawesomesite.com. I have another firebase app that I want to create the subdomain for awesome.myawesomesite.com.
I own the domain name myawesomesite.com via Namecheap. myawesomesite.com has been up for over a year.
Here is what it looks like on Firebase Hosting for the awesome app:
It has been showing "Needs setup" for the past 4 days.
Went I went through "Add custom domain", Firebase verified myawesomesite.com domain. Then I told Firebase that I wanted awesome.myawesomesite.com. Firebase then gave me two A Record values:
I also noticed that the A Record values for my subdomain request (awesome.myawesomesite.com), 123.456.7.890, are exactly the same A Record values for my domain myawesomesite.com.
This is what it looks like on my Namecheap dashboard:
I am pretty sure I did something wrong because Firebase give the same A Record values for both my domain (myawesomesite.com) and my subdomain (awesome.myawesomesite.com). I expected them to have different values. But Firebase gave me those values when I'm on my awesome project requesting for "Add custom domain". It has been 4 days and awesome.myawesomesite.com hasn't been active yet.
How can I correctly add a subdomain awesome.myawesomesite.com using namecheap and firebase hosting? Is this even possible on Firebase in 2021?

I had the same task at hand and proceeded as follows:
In Firebase console, click to add a new custom domain to your hosting project and enter the subdomain with main-domain. E.g. 'sub.domain.com'.
Copy the value ("google-site-verification=something").
In Namecheap, go to the advanced DNS menu and add a new TXT record.
Host*: #
Value: google-site-verification=something
Save and wait for 5~15 minutes.
Back in Firebase Hosting, click to verify your domain. (If not ready yet, try again until verified).
After this, Firebase gave me one A record. Not two as normally stated in the docs! Might be because it is the year 2023, or because it is a subdomain, or both.
Enter this record in Namecheap.
Host: the subdomain name you want to use (e.g. sub)
Value: the address Firebase gave you (e.g. 111.222.333.444).
I did not(!) delete any other A or AAAA record as stated in the docs or the Firebase console.
Save and wait for 1~24 hours. Your subdomain should now be verified and activated.
*I usually saw docs and help desk entries that state, that for a subdomain, the TXT record's Host value should include the subdomain (e.g. only "sub", or "sub.domain.com", etc.), but that didn't work for me, so I changed it to "#" and got verified shortly after.

Related

Firebase: custom auth domain verification failed

I have a firebase project setup, and a domain, matoitechnology.com. Im trying to customize my domain through google domains so the emails dont go in the spam folder, but the dns authentication failed.
I blurred out everything, but I just copy and pasted the values given.
Firebase auth details
google domains:
domains screenshot
The one thing that I feel i may be doing wrong is that firebase seems to have two separate text records, but google domains will only allow me to create one record with multiple values. If i try to add another text record, it will try to replace my current text record. Any ideas?
Google Domains seems to append your domain automatically to whatever record you paste in. So if you paste firebase1._domainkey.yourdomain.com into the record in Google Domains (as instructed by directions in Firebase), your actual value will likely be firebase1._domainkey.yourdomain.com.yourdomain.com. It's easy to overlook, and was the issue for me.

Using Microsoft nameservers, Google Domains, and Firebase hosting

I have a client who is using Office 365 for email and has changed the nameservers on Google Domains to point to Microsoft nameservers (ns1.bdm.microsoftonline.com, etc), so he can utilize the #domainname.com email extension (and other Office products). Unfortunately, this is messing with my normal groove on how to link my Firebase React projects with Google Domains via adding resource values (i.e. # A record with a value of 111.111.1.111) because as Google warns me right there:
It looks like you've changed your name servers. All settings for your domain (including website, email, synthetic records and resource records) are currently disabled. To enable these settings, you will need to restore the Google Domains name servers.
I can't restore these nameservers to Google, because it will mess/disable his emails. So what to do? I have exhausted my Google searches for an answer, and unsure of what direction to look for an answer. How do I link up my app with Firebase hosting with my Google Domain's domain while still maintaining Office 365 #domainname.com email extension for my client? Maybe I need to add the records on Microsoft's side? Do I need him to transition to GSuite? I'd prefer not to tell him he needs to, but maybe that's the only solution!
It's a bit misleading. The domain is with Google Domains, and Google is saying "All settings for your domain that you might expect us to manage via Google Domains" are disabled - meaning you can't manage them in Google Domains. Instead, they have to be managed in Office 365 (or wherever the nameservers are).
You can get the ip addresses Firebase gives you, send them to your client, and instruct them to update the domain's main A record and www A record (or CNAME) to point to the Firebase ip addresses.
Everything will work just fine - it's just Google telling you that it no longer manages the DNS for the domain.

Where to find DNS A records information in Firebase Hosting for a previously connected custom domain?

When you add a custom domain in Firebae Hosting, at the end of the process you see two DNS A records that you should add to your DNS configuration.
https://firebase.google.com/docs/hosting/custom-domain#go-live
QUESTION
But after you're done with the process of adding the new custom domain, where in the Firebase Console can you find the information about those DNS A records again?
I didn't find it in the Firebase Hosting section nor in my Project Settings.
I haven't seen anything within the Firebase console that shows the record information, but the A records are outlined in their per-provider docs lower in the documentation you provided:
https://firebase.google.com/docs/hosting/custom-domain#dns-records-cloudfare
I just found out that if the DNS A records have already been detected by Firebase, they will no longer be accessible from the Firebase Console.
But if the records haven't been detected by Firebase yet, you be able to see them by clicking on your custom domain on your console's Firebase Hosting section. It will be marked with "View Setup" or something like that (don't remember the exact phrase).
If it's marked as "pending", it's because the records have already been detected and it's waiting for propagation across the DNS network.
It it's marked as "conected", it's because it's already up an running.

Firebase hosting says connected but when I try to open URL it says site not found

As my firebase console image says the custom domain is connected. I purchased the domain at domain.google.com and changed the custom resource record to the A records provided by firebase. It's been a day and I'm waiting for it to work but when I try to go to ammarkhandwala.com or www.ammarkhandwala.com it says the site can't be reached.
Any idea on how to resolve this?

Firebase Hosting Custom Domain

I recently bought a domain and tried to connect it to my running firebase app.
Since the site I bought the domain from doesn't provide a management tool, they set the DNS records for me. Now the domain has status 'Connected' on the hosting dashboard but when I open the page, nothing is shown.
Do I have to keep something in mind here?
The domain I am talking about has some files on the ftp like index.php.
Do I have to delete all of this?
Thanks for your help!
Fixed by waiting 48 hours, didn't think the DNS propagation would take that long.

Resources