If you use a custom domain in your project, consider also using your custom
domain in the emails sent for authentication events, such as email verification,
address change, and password recovery flows. You can configure your project to
use your custom domain in the emails'
From field and action links.
By configuring custom domains for authentication emails, users will see the same domain for your web address and the user management emails.
There are broadly two steps to setting this up:
- Add the domain to your email templates in the Firebase console.
- Verify your domain by adding DNS records in your domain registar.
Adding the domain to your email templates
In the Firebase console, open the Templates page of the Authentication section.
For each email template, do the following:
- Click the edit icon ( ).
- Click customize domain.
- Enter the domain you want to use.
You'll then see a table of DNS records to add to your domain registrar to verify that you own the domain.
Verify the domain
Add or update the TXT and CNAME DNS records given in the Firebase console. The procedure for doing so depends on the registrar.
You can have only one
v=spf1... TXT record for a particular domain. If you
need to specify multiple email addresses, combine them into one record.
It can take up to 24 hours for the domain to be verified. When it is, the Templates page in the Firebase console will show a green "Verification complete" message. Then, you can click the Apply Custom Domain button to put your changes into effect.