Proton Mail + Cloudflare

Set up Proton Mail on Cloudflare

The records Proton Mail needs, written with the field names Cloudflare uses (Name, Mail server, Content, Target), in the order to add them.

  • 5 steps
  • 8 DNS records

Before you start

  1. Have your Proton Mail account ready. Some values are unique to your account and come from the Proton Mail settings (Domain names) .
  2. Open DNS at Cloudflare: Sign in to the Cloudflare dashboard and select your domain. Open the DNS Records page.
  3. Keep both tabs open and add the records below one at a time.

Proton Mail on Cloudflare: what to know

How long changes take

Cloudflare says changes to your DNS records take effect worldwide within 5 minutes, usually much less. A record you replaced can stay cached until its old TTL runs out.

Source: FAQ (Cloudflare DNS Docs)

Records to add

Copy each value with the button next to it. Rows marked “Copy from Proton Mail settings (Domain names)” are unique to your account.

Domain verification Proves you own the domain Type TXT Name @ Value Copy from Proton Mail settings (Domain names) Looks like: protonmail-verification= followed by a code Priority n/a TTL Auto
MX records Where incoming email goes Type MX Name @ Value mail.protonmail.ch Priority 10 TTL Auto
MX records Where incoming email goes Type MX Name @ Value mailsec.protonmail.ch Priority 20 TTL Auto
SPF record Which servers may send as you Type TXT Name @ Value v=spf1 include:_spf.protonmail.ch ~all Priority n/a TTL Auto
DKIM A signature on every message Type CNAME Name protonmail._domainkey Value Copy from Proton Mail settings (Domain names) Priority n/a TTL Auto
DKIM A signature on every message Type CNAME Name protonmail2._domainkey Value Copy from Proton Mail settings (Domain names) Priority n/a TTL Auto
DKIM A signature on every message Type CNAME Name protonmail3._domainkey Value Copy from Proton Mail settings (Domain names) Priority n/a TTL Auto
DMARC record What to do with fakes · recommended Type TXT Name _dmarc Value v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com Priority n/a TTL Auto

Step by step in Cloudflare

Verify your domain

Your email provider needs proof that you control this domain before it accepts email for it.

Type
TXT
Name
@
Content
Copy it from Proton Mail settings (Domain names) (see below)

Where to find your value

In Proton Mail open Settings → Domain names, add your domain and copy the verification value.

It looks like: protonmail-verification= followed by a code

In Cloudflare

  1. On the DNS Records page, select Add record.
  2. Choose TXT as the Type.
  3. Fill in Name and Content.
  4. Select Save.

Point your MX records

MX records tell other mail servers where to deliver your email. How MX works

Type
MX
Name
@
Priority
10
Mail server
mail.protonmail.ch
  • Delete any other MX records, or make sure Proton's have the lowest priority number.
Type
MX
Name
@
Priority
20
Mail server
mailsec.protonmail.ch

In Cloudflare

  1. On the DNS Records page, select Add record.
  2. Choose MX as the Type.
  3. Fill in Name, Mail server and Priority.
  4. Select Save.
  5. Delete any other MX records: select Edit on each one, then Delete, and confirm.
  6. Repeat for each MX record above.

Add the SPF record

SPF lists the services allowed to send email as you. How SPF works

Type
TXT
Name
@
Content
v=spf1 include:_spf.protonmail.ch ~all
  • Keep one SPF record. To keep an existing one, add include:_spf.protonmail.ch right after v=spf1.

In Cloudflare

  1. On the DNS Records page, select Add record.
  2. Choose TXT as the Type.
  3. Fill in Name and Content.
  4. Select Save.

Set up DKIM

DKIM signs your mail so receivers can trust it. How DKIM works

Type
CNAME
Name
protonmail._domainkey
Target
Copy it from Proton Mail settings (Domain names) (see below)

Where to find your value

Copy the exact target from the DKIM tab of your domain in Proton Mail settings.

  • Add all three DKIM records; Proton rotates keys between them.
  • Some hosts reject a trailing period on CNAME values. If yours does, remove the final dot.
Type
CNAME
Name
protonmail2._domainkey
Target
Copy it from Proton Mail settings (Domain names) (see below)

Where to find your value

Copy the exact target from the DKIM tab of your domain in Proton Mail settings.

Type
CNAME
Name
protonmail3._domainkey
Target
Copy it from Proton Mail settings (Domain names) (see below)

Where to find your value

Copy the exact target from the DKIM tab of your domain in Proton Mail settings.

In Cloudflare

  1. On the DNS Records page, select Add record.
  2. Choose CNAME as the Type.
  3. Fill in Name and Target.
  4. Set Proxy status to DNS only (grey cloud).
  5. Select Save.
  6. Repeat for each CNAME record above.

Add the DMARC record (recommended)

DMARC tells receivers what to do with mail that fakes your domain. How DMARC works

Type
TXT
Name
_dmarc
Content
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
  • Start with p=none (no action) and read the reports for a while. Replace the report address with a mailbox you actually read.
  • Proton recommends p=quarantine for most domains. Move to it once SPF and DKIM pass.

In Cloudflare

  1. On the DNS Records page, select Add record.
  2. Choose TXT as the Type.
  3. Fill in Name and Content.
  4. Select Save.

Check your setup

Once the records are saved, run a live check. We look up your domain in public DNS and tell you what is right, missing or wrong, with the fix in Cloudflare’s words.

We only read public DNS records. Nothing is stored.

Common mistakes with Proton Mail on Cloudflare

Adding only one DKIM record

Proton uses three DKIM CNAMEs (protonmail, protonmail2, protonmail3). Add all three, matching the values in your setup wizard exactly.

Cloudflare: Keep email CNAMEs on DNS only

Set Proxy status to DNS only (grey cloud) for DKIM and verification CNAME records. Cloudflare says records used for email or domain verification should not be proxied, and may block proxying DKIM CNAMEs.

Cloudflare: Turn off Cloudflare Email Routing first

If Email Routing is on, Cloudflare has added locked MX records (route1, route2 and route3.mx.cloudflare.net) and an SPF record with include:_spf.mx.cloudflare.net. Unlock them or disable Email Routing (Compute > Email Service > Email Routing > your domain > Settings) before switching to another provider. Email Routing can't be used with an outside mail server.

Proton Mail on Cloudflare: questions

Where do I add Proton Mail DNS records in Cloudflare?

Sign in to the Cloudflare dashboard and select your domain. Open the DNS Records page. Add each record there, one at a time.

What goes in the Name field at Cloudflare?

Enter @ for records on your bare domain, such as MX and SPF. For the others, enter only the part before your domain, for example protonmail._domainkey. Cloudflare adds your domain automatically.

Do I need to delete my existing MX records at Cloudflare?

Delete any other MX records, or make sure Proton's have the lowest priority number. If Email Routing is on, Cloudflare has added locked MX records (route1, route2 and route3.mx.cloudflare.net) and an SPF record with include:_spf.mx.cloudflare.net. Unlock them or disable Email Routing (Compute > Email Service > Email Routing > your domain > Settings) before switching to another provider. Email Routing can't be used with an outside mail server.

How long until Proton Mail works on Cloudflare?

Cloudflare says changes to your DNS records take effect worldwide within 5 minutes, usually much less. A record you replaced can stay cached until its old TTL runs out.

Sources

Every value and step on this page comes from these official pages. Dashboards change, so if something doesn’t match what you see, tell us.