Use your Cloudflare domain with Ayamail

Cloudflare is a popular DNS host, and many domains bought elsewhere still have their DNS there. Adding mail records takes a few minutes, but Cloudflare has three habits that trip people up: the orange proxy cloud, Email Routing that locks its own records, and a registrar that will not let you change nameservers.

Written by Ayamail editorial team · Updated 30 October 2026

Short answer

In Cloudflare, open your domain, go to DNS and then Records, and use Add record for each record the Ayamail app shows. Type @ as the name for the domain itself. Set every CNAME to DNS only, the grey cloud. If Email Routing is on, add Ayamail's records first and then disable Email Routing.

The one rule that matters most: grey cloud

Cloudflare can route traffic for A, AAAA and CNAME records through its own network. That is the orange cloud, called Proxied. It is meant for websites. Mail apps and mail servers need to reach Ayamail directly, so the optional CNAME records autoconfig, autodiscover, mail and mta-sts must be DNS only, shown as a grey cloud. Cloudflare's own documentation says a hostname used only for mail should be DNS only.

MX and TXT records cannot be proxied at all, so you will not see the toggle for them. Ayamail's DKIM key is a TXT record, not a CNAME, so the proxy setting does not apply to it either.

Add the records in the Cloudflare dashboard

  1. Open the zone

    Sign in at dash.cloudflare.com, choose your domain, then DNS and Records. Keep the DNS records tab of Ayamail open in another window so you can copy each value.

  2. MX

    Select Add record, choose MX, type @ in Name, paste the mail server from the table below into Mail server and use the priority shown. TTL can stay on Auto. Save.

  3. The TXT records

    Add four TXT records: _ayamail with your verification code, @ with the SPF value, _dmarc with the DMARC value and dkim._domainkey with the long key starting v=DKIM1. Paste the key as one line; Cloudflare stores long values without you having to split them.

  4. Optional CNAMEs

    For autoconfig, autodiscover and mail enter mx1.ayamail.net as the target, and for mta-sts enter mta-sts.ayamail.net. Click the cloud so it turns grey before you save.

  5. Check in Ayamail

    Back in Ayamail, press Check now. Changes in Cloudflare are usually visible within minutes.

MX value for Cloudflare

Your own domain (MX record)
SettingValue
Mail server (MX)mx1.ayamail.net
Priority10

If Cloudflare Email Routing is switched on

Email Routing forwards mail for your domain to another inbox. When it is active, Cloudflare adds its own MX, SPF and DKIM records to the root and marks them Locked, so you cannot edit or delete them under DNS. Cloudflare warns that editing an unlocked routing record to point somewhere else does not detach it from Email Routing: disabling Email Routing later would still delete it.

So add Ayamail's MX and other records as new records, then go to Compute, Email Service, Email Routing, pick the domain, open Settings and select Disable Email Routing. Cloudflare removes its routing MX, SPF and DKIM records. Finally make sure the only TXT record starting v=spf1 is Ayamail's, and add it now if you held it back. The Ayamail app flags a second SPF or a leftover routing MX as blocking.

Registered at Cloudflare? Nameservers stay put

Domains registered with Cloudflare Registrar must use Cloudflare's nameservers, according to Cloudflare's FAQ. The Ayamail nameserver route is therefore not available for them, and manual records are the way to go. If the domain is registered elsewhere and only its DNS sits at Cloudflare, you can choose either route, but as long as the nameservers point to Cloudflare, the records belong in Cloudflare and not at the registrar.

Common Cloudflare problems

Thunderbird or Outlook cannot find the settings automatically

What to do: The autoconfig or autodiscover CNAME is probably Proxied. Edit it and switch the cloud to grey.

The MX record cannot be deleted

Error message: Locked

What to do: It belongs to Email Routing. Unlock it under Email Routing settings, or disable Email Routing once Ayamail's records are in place.

The app reports two SPF records

What to do: Email Routing's SPF is still there. Disable Email Routing, or delete that TXT record if it is unlocked, so only Ayamail's remains.

Nothing changes in the app

What to do: Check that the domain's nameservers really point to Cloudflare. If the zone shows as pending in Cloudflare, records there are not live yet.

All records and what they do

The registrar-neutral list with the full values, plus the optional records.

Questions and answers

Does my website behind the orange cloud keep working?
Yes. Only the mail records change. Your A, AAAA and www records can stay Proxied.
Can I keep Email Routing for some addresses?
No. Both need the domain's MX record, and a domain can only send its mail one way. Use aliases in Ayamail instead.
Can Ayamail add the records in Cloudflare for me?
Sometimes the app offers to send the records for you to approve. If you do not see that option for your domain, add them by hand as described here.
Which TTL should I choose?
Auto is fine. Cloudflare's own setting keeps changes quick.

Sources

  1. Cloudflare Docs: Proxy status (Checked 30 October 2026)
  2. Cloudflare Docs: Create DNS records (Checked 30 October 2026)
  3. Cloudflare Docs: Create zone apex record (Checked 30 October 2026)
  4. Cloudflare Docs: Disable Email Routing (Checked 30 October 2026)
  5. Cloudflare Docs: Registrar FAQ (Checked 30 October 2026)
  • Connect your domain

    Which MX, SPF, DKIM and DMARC records to add, where to add them and how to check they work. With guides for Cloudflare, GoDaddy, IONOS and more.

  • MX records explained

    What an MX record does, how priority works, how to look one up on Windows, Mac and Linux, and the mistakes that make mail go missing.

  • 123 Reg

    Move the mail for a .co.uk or .uk domain at 123 Reg to Ayamail: where the DNS screen is, the full stop MX values need and which old records to delete.

  • Gandi

    Connect a Gandi domain to Ayamail: swap the default Gandi Mail MX pair on the DNS Records tab, add the TXT records and bring your old mail with you.