FireBase: Things you must know to avoid wasting time as a Beginner
Custom Domain
You have bought a new domain and now you want to use it for Firebase hosting.
Setting up custom domain can be tricky based on your domain registerer.
Custom domain can be used to host your website. And also to send custom authentication emails to the registered users.
Hosting Website
Head over to your Firebase project
Enter your domain.
Click on continue.
Firebase gives some values that you need to update in your domain account.
The underlined part is very important to remember while adding records in your domain account.
Some DNS providers use full domain name and others just use @ like Godaddy.
If your DNS provider uses full domain name instead of @, then you can add the records given by Firebase as it is.
If your DNS provider uses @ instead of full domain name, then follow this:
If you want to connect your root domain for example: example.com, then instead of adding example.com as Firebase said, use @
If you want to connect to sub domain for example: sub.example.com, then instead of adding sub.example.com as Firebase said, use sub in the name/host field.
Now open your DNS provider and add the above records to your settings.
Now head back to your Firebase project click on Finish.
Wait for specified time to get your domain live!
For Authentication Emails:
Click on Authentication -> Templates -> Click on Edit icon.
Click on customize domain.
Enter the domain you want to use.
Update the Firebase records in your DNS.
Remember about the domain and sub domain that I have said in Hosting Website?
Follow same here:
test.skreweverything.com
→ In your DNS(for example in Godaddy), usetest
firebase1._domainkey.test.skreweverything.com
→ In your DNS, usefirebase1._domainkey.test
firebase2._domainkey.test.skreweverything.com
→ In your DNS, usefirebase2._domainkey.test
So, just remember that you should not provide your root domain while entering records.