firebase logo and name

How to Link Your Firebase Hosting Website to a Domain Name

So, you've created a fantastic website using Firebase Hosting, and now you want to give it a custom domain name to make it truly your own. In this step-by-step guide, we'll show you how to link your Firebase Hosting website to a domain name, so visitors can access your site with ease.

Step 1: Purchase a Domain Name

The first step in linking your Firebase Hosting website to a custom domain is to purchase a domain name. You can do this through various domain registrars like GoDaddy, Namecheap, or Google Domains. Choose a domain name that represents your brand or website well.

Step 2: Configure DNS Settings

Once you've purchased your domain name, you'll need to configure the DNS (Domain Name System) settings. Here's how:

  • Log in to your domain registrar's website.
  • Find the option to manage or edit your DNS settings. This might be labeled as "DNS Management," "Domain Management," or something similar.
  • Look for the DNS records section. You'll need to add or modify DNS records to point to Firebase Hosting.

Step 3: Get Firebase Hosting IP Addresses

To link your domain to Firebase Hosting, you'll need to find the IP addresses for Firebase Hosting. Here's how:

  • Open your Firebase project in the Firebase Console.
  • Click on "Hosting" in the left sidebar.
  • Go to the "Connect domain" tab.
  • You'll find the IP addresses under the "DNS Records" section. There will be two IP addresses (IPv4 and IPv6). Note them down.

Step 4: Add DNS Records

Now, it's time to add DNS records that connect your domain to Firebase Hosting. Here's a typical setup:

  • Create an A record (IPv4) with the "@" symbol as the host and set it to one of the IPv4 addresses you noted from Firebase Hosting.
  • Create an AAAA record (IPv6) with the "@" symbol as the host and set it to the IPv6 address you noted from Firebase Hosting.
  • Create a CNAME record with "www" as the host and set it to your Firebase Hosting subdomain (e.g., your-site.firebaseapp.com).

Step 5: Verify DNS Configuration

After adding DNS records, it may take some time for DNS changes to propagate across the internet. This process can take up to 48 hours, although it's usually faster.

You can use online DNS checking tools to verify that your DNS records have propagated correctly.

Step 6: Configure Custom Domain in Firebase

Once your DNS records are set up and propagated, it's time to configure your custom domain in Firebase Hosting:

  • Open your Firebase project in the Firebase Console.
  • Click on "Hosting" in the left sidebar.
  • Go to the "Connect domain" tab.
  • Enter your custom domain name (e.g., www.yourdomain.com) and click "Continue."

Step 7: Verify Domain Ownership

Firebase will provide a TXT record that you'll need to add to your DNS settings. This step verifies that you own the domain.

Step 7.1(Optional): Configure Mint SSL Certificate

Once the domain is verified, firebase will give you an option to mint an SSL certificate for your domain. Add the acme challenge TXT record provided and click on verify. After it is configured, it might take upto 24 hours for the certificate to be valid, until then you might get a Bad Certificate error.

Step 8: Complete the Setup

Return to the Firebase Console and click "Continue." Firebase will verify your domain, and once successful, your custom domain will be linked to your Firebase Hosting website.

ANubit solutions banner

Free consultation

Contact Now

Conclusion

Congratulations! You've successfully linked your Firebase Hosting website to a custom domain name. Now, visitors can access your website using your own unique domain, enhancing your online presence and branding. Enjoy the benefits of a professional and memorable web address for your Firebase-hosted website.