Keeping Your Custom Email Address While Using Firebase Hosting

Credit: Samuel Zeller via Unsplash

Credit: Samuel Zeller via Unsplash

 

In my last post I praised Firebase Hosting for its speed and how easy I found deployments, however I completely neglected the fact that it doesn’t support email hosting. Almost two weeks after marking the switch I realised that my email was not working anymore (I know, I know, I should have figured it out earlier).

What Went Wrong

Short answer: I pointed my domain’s A-type DNS zone records directly to Firebase.

My email setup uses ghetu.net as a domain, with MX records pointing to Zoho Mail - this allows me to get 5GB of free storage while using a custom domain. Quite obviously, setting MX records requires a hosting provider that supports email, so when I pointed my domain to Firebase I made those MX records vanish into the abyss as well as all of my incoming emails.

How I Fixed It

The high-level solution came from the Firebase Google Group - using a hosting provider that does support email and redirecting just the http traffic to Firebase.

Instead of pointing the A-type DNS zone records directly to Firebase (from my domain name provider’s website), I switched them back to my old hosting provider (which supports email). Afterwards, from my old hosting provider’s cPanel, I removed the existing A-type records (which pointed http traffic to my old host) and added the ones provided by Firebase.

From cPanel, navigate to the Domains section and select Zone Editor

From cPanel, navigate to the Domains section and select Zone Editor

Clicking Manage takes you to all DNS records - remove A records for the domain/subdomain that you want to be hosted on Firebase

Clicking Manage takes you to all DNS records - remove A records for the domain/subdomain that you want to be hosted on Firebase

Add the A records provided by Firebase in the console

Add the A records provided by Firebase in the console

 

As a result, incoming http requests get sent to my old hosting provider which routes them to Firebase. Incoming mail requests also get sent to my old hosting provider which routes them to Zoho Mail. Happy days!

bunny rabbit chewing a letter

comments powered by Disqus