Firebase is a free hosting provider, through this you can deploy from simple static HTML to complex e-commerce website made on the latest tech stack. In this post, we will look into how to connect the firebase domain to the custom domain we bought from domain providers like Namecheap, Hostinger, Google Domains, etc.
We will add another post on how to deploy any website on firebase, stay tuned :)
Assuming that you already have hosted your website on firebase, do the following steps:
- Add Domain
- Go to your firebase console
Select your project from the list of projects.
After you click on the desired project, select the hosting option from the left panel
CLick on Add custom domain, you will see the following window, add your custom domain name in the text field provided(make sure the spelling is correct)
-Verify domain ownership
In your domain provider's site, locate the DNS management page. As soon as you click on continue, it will give you TXT value. This TXT value will be used by firebase to verify that you really own this domain. . In your domain provider's site, locate the DNS management page. Add this TXt value as a DNS record, you will see a bunch of options like A record, AAA record, etc. to add as a record, select TXT and then input
- Type: TXT
- Value: It must be the value provided by the firebase.
- Host/Name: it should either
@
oryourdomainname.com
(generally it's@
- it will already be prefilled) - TTL Value: Keep it either
Automatic
or to3600
Allow up to 24 hours for the propagation of your updated TXT records, then click Verify. It probably takes 15-20 mins, the trick is to continue clicking verify for few mins. eventually, it will get verified. If clicking Verify prompts an error message, your records have not propagated or your values may be incorrect.
- Go Live
After your txt record gets verified, firebase will provide you with 2 A records which you have to add into your DNS Records of your domain provider by default the QUICK SETUP MODE will be selected which is suitable for new websites.
Add A new record in your DNS Management Section, just as you added the
TXT
record, this time add anA
Record and then input.- Type: A
- Value: In this, you have to add the IP provided by Firebase, Your domain provider may list this term as "Data", "Points To", "Content", "Address", or "IP Address".
- Host/Name: it should either
@
oryourdomainname.com
(generally it's@
- it will already be prefilled) - TTL Value: Keep it either
Automatic
or to3600
Do the above step twice, since firebase provides you with 2 IPs to add to your DNS.
Common domain providers.
Here are some common domain providers and the types of input each might require. This information is kept up-to-date as much as possible, but refer to your domain provider's documentation for detailed instructions.
NameCheap
DNS TXT record inputs
- Type TXT
- Host/Name @
- Value verification value provided in Firebase console.
DNS A records inputs
- A @ 151.101.1.195
- A @ 151.101.65.195
Hostinger
DNS TXT record inputs
- Type TXT
- Host/Name @
- Value verification value provided in Firebase console
DNS A records inputs
- A @ 151.101.1.195
- A @ 151.101.65.195
Note: if in case, your domain gets not connected, it's probably due to an existing A
record in your DNS Records, just delete that then you are good to go but make sure, the firebase A records are not deleted.
CloudFare
DNS TXT record inputs
- Type TXT
- Host/Name example.com
- Value verification value provided in Firebase console.
DNS A records inputs
- A example.com 151.101.1.195
- A example.com 151.101.65.195
- A www 151.101.1.195
- A www 151.101.65.195
Google Domains
DNS TXT record inputs
- Type TXT
- Host/Name @
- Value verification value provided in Firebase console.
DNS A records inputs
- A @ 151.101.1.195
- A www 151.101.1.195
- A www 151.101.65.195
Google Cloud DNS
DNS TXT record inputs
- Type TXT
- Host/Name example.com
- Value verification value provided in Firebase console.
DNS A records inputs
- A example.com 151.101.1.195
- A example.com 151.101.65.195
- A www 151.101.1.195
- A www 151.101.65.195
Squarespace
DNS TXT record inputs
- Type TXT
- Host/Name @
- Value verification value provided in Firebase console.
DNS A records inputs
- A @ 151.101.1.195
- A @ 151.101.65.195
- A www 151.101.1.195
- A www 151.101.65.195
That's it for today!
Hope you liked the post, if you’ve got any questions your can Mail us mail@stephinreji.me
or join our Discord-server and do checkout our website forcommunity.tech