Adding MX records to Cloudflare

These instructions are for users who are hosting their domain on Cloudflare and would like to change their mail records (MX) so they can send and receive mail with Fastmail.

This guide covers three steps to setting up your domain:

  1. Add your domain to Fastmail
  2. Edit your MX records in Cloudflare
  3. Signing your domain

Advanced instructions for setting up MX records can be found here.


1. Add your domain to Fastmail

We have a setup guide to help you get your domain working as quickly and easily as possible.

After you have activated your domain at Cloudflare, log in to Fastmail and go to the Settings → Domains screen.

Add your domain(s) (e.g. mydomain.com). Using the Add Domain button brings up the new domain screen. Type your domain into the text box.

If your domain is active at Cloudflare, we will display this on the next screen. You can also choose Cloudflare from our list of supported registrars.

Follow the wizard to add your email addresses to Fastmail. To have the wizard provide you with steps to update your MX records by default, choose Yes when you are asked if you have a website.

Please note: The domain setup wizard can only set up aliases on legacy plans. If you are on a legacy plan, you will need to add users manually in order to create additional user accounts at your custom domain.

2. Edit your MX records in Cloudflare

Note: We recommend making these changes at a time that you do not expect much mail to be sent to your domain

  • Log in to your account at Cloudflare.

  • Find the domain you would like to use with Fastmail. In the menu at the top of the screen, click DNS.

  • Click Add Record, then choose MX for the Type.

  • Enter your MX record with the following details:

Name Mail server Priority
@ in1-smtp.messagingengine.com 10
  • Then add a second MX record with the following details:
Name Mail server Priority
@ in2-smtp.messagingengine.com 20
  • Leave the TTL as the default.

You should now have two MX records, in1-smtp.messagingengine.com and in2-smtp.messagingengine.com.

3. Signing your domain

Your domain should now be ready to receive messages. In order to make sure your sent messages reach your recipients, there are a couple more records to add in your Cloudflare account.

  • In your DNS control panel, click Add New Record. Add three new records, all with the type CNAME and the following information (make sure to replace mydomain.com with your actual domain name).

  • For each record, under Proxy status, click the orange cloud icon so it turns grey. This will turn off CNAME flattening.

Type Name Target
CNAME fm1._domainkey fm1.{mydomain.com}.dkim.fmhosted.com
CNAME fm2._domainkey fm2.{mydomain.com}.dkim.fmhosted.com
CNAME fm3._domainkey fm3.{mydomain.com}.dkim.fmhosted.com

You can leave any other CNAME records you have for your domain where they are.

  • Add one final new record. In the drop down for the record type, choose TXT, then enter the following information:
Type Name Content
TXT @ v=spf1 include:spf.messagingengine.com ?all

When you are finished, it should look like this (with your domain name in the blank space):

TXT record added to Namecheap

Once you have finished this step, your domain should be working with Fastmail.

To check all your settings are correct, log in to your Fastmail account and go to the Settings → Domains screen. Click Recheck DNS. Your domain should now say Active. MX records set.

Cloudflare has further instructions for using their DNS configuration panel available here.


Was this article helpful?
22 out of 36 found this helpful