Custom Domain Setup
Learn how to connect your custom domain to your Firebase hosting site
Before proceeding with custom domain setup, ensure you have completed the Firebase setup process as described in the Setup Firebase guide.
Overview
This guide will walk you through the process of connecting your custom domain to your Firebase hosting site. Firebase Hosting provides secure hosting with automatic SSL certificate provisioning for your custom domains.
Step 1: Access Firebase Console
- Go to the Firebase Console
- Select your project
- In the left sidebar, click on “Hosting”
Step 2: Add Custom Domain
- In the Hosting section, click on “Add custom domain”
- Enter your domain name (e.g.,
www.example.com
) - Click “Continue”
Step 3: Verify Domain Ownership
Firebase will provide you with a TXT record that you need to add to your domain’s DNS settings:
- Copy the provided TXT record value
- Go to your domain registrar’s DNS management page
- Add a new TXT record with:
- Host: Your domain name (or @ for apex domain)
- Value: The TXT record value provided by Firebase
- TTL: 3600 (or as recommended by your registrar)
Step 4: Add DNS Records
After domain verification, Firebase will provide you with A records to add to your DNS settings:
-
Add an A record for your apex domain:
- Host: @ (or your domain name)
- Value: 199.36.158.100
- TTL: 3600
-
Add an A record for www subdomain:
- Host: www
- Value: 199.36.158.100
- TTL: 3600
Step 5: Wait for DNS Propagation
DNS changes can take anywhere from a few minutes to 48 hours to propagate. You can check the status in the Firebase Console under the “Custom domains” section.
Common Domain Provider Instructions
Cloudflare
- TXT Record:
- Host: example.com
- Value: [verification value from Firebase]
- A Records:
- Host: example.com
- Value: 199.36.158.100
- Host: www
- Value: 199.36.158.100
NameCheap
- TXT Record:
- Host: @
- Value: [verification value from Firebase]
- A Records:
- Host: @
- Value: 199.36.158.100
- Host: www
- Value: 199.36.158.100
Google Cloud DNS
- TXT Record:
- Host: example.com
- Value: [verification value from Firebase]
- A Records:
- Host: example.com
- Value: 199.36.158.100
- Host: www
- Value: 199.36.158.100
Troubleshooting
If you encounter issues during the setup process:
- DNS Propagation: Wait up to 48 hours for DNS changes to propagate
- SSL Certificate: Firebase automatically provisions SSL certificates, which can take up to 24 hours
- Domain Verification: Ensure the TXT record is correctly added and propagated
- A Records: Verify that both A records are correctly configured
Status Descriptions
- Needs setup: DNS records need to be configured or updated
- Pending: Domain is verified but SSL certificate is being provisioned
- Minting Certificate: SSL certificate is being generated
- Connected: Domain is fully configured and ready to use
For more detailed information, refer to the official Firebase documentation.