Advertising disclosure: We may earn a commission from links on this site. Commercial relationships can affect placement. Product facts, limitations, and source dates remain part of our editorial record.

How funding works
Web Hosting

Cloudflare Set up email records: A Guide for Website Owners

Learn how to set up email records in Cloudflare for receiving or sending mail, including MX, A/AAAA, SPF, DKIM, DMARC, and DNS-only guidance.

Review sources
Research standard

Facts that can change should include a source and check date. Benchmark claims should state the plan, region, method, and test period.

To set up email records in Cloudflare, first obtain the exact DNS values from your email provider. For receiving-only email, use Cloudflare Email Routing to forward messages sent to custom-domain addresses. For sending and receiving, add the provider’s mail-server, MX, SPF, DKIM, and DMARC records. The correct values depend on the provider, so do not substitute generic entries.

Choose the email setup#

Data table from this page
RequirementCloudflare approach
Receive messages sent to your domainConfigure Cloudflare Email Routing for forwarding.
Send and receive messagesAdd the email provider’s A or AAAA, MX, and TXT records.

Cloudflare’s email-records guide describes these options. Its broader DNS documentation explains how DNS records connect a domain with services such as email.

Configure sending and receiving#

Ask the email provider for its current DNS instructions, then add the specified records to the domain’s Cloudflare DNS configuration:

  1. Add an A or AAAA record for the mail subdomain specified by the provider. The value should be the mail server’s IP address.
  2. Add an MX record for the domain. Its destination should be the mail subdomain that points to the mail server.
  3. Add the provider-supplied TXT records for email authentication.

The provider’s instructions determine the record names, values, priorities, and any other required settings. A mail record from one provider may not work for another provider.

Add SPF, DKIM, and DMARC#

Cloudflare describes these authentication records as follows:

  • SPF identifies which senders are authorized to send mail for the domain.
  • DKIM helps verify the sender and the integrity of a message.
  • DMARC defines how receiving servers should handle messages that fail authentication checks.

Use the exact TXT values supplied by the email provider. If the provider gives separate records for different sending services, follow its instructions rather than combining or rewriting the values yourself.

Check Cloudflare’s proxy setting#

Cloudflare says email traffic on SMTP port 25 is not proxied by default. Follow the email provider’s instructions for mail records, including any required DNS-only setting. Web traffic and email traffic can require different DNS treatment, so do not apply a website proxy setting to a mail record without checking the provider’s guidance.

Test the configuration#

After saving the records, test the behavior your domain needs:

  • For Email Routing, send a message to a custom-domain address and confirm that it reaches the configured forwarding destination.
  • For sending and receiving, send a message from the domain’s email address and send a message back to it.
  • If a test fails, compare the record names, values, MX destination, and mail-server IP address with the provider’s instructions. Check SPF, DKIM, and DMARC separately from the basic delivery records.

The presence of a DNS record is not proof that mail delivery works. Sending and receiving test messages verifies the result for your domain and provider.

Sources

  1. Cloudflare: Set up email records Checked 2026-10-05
  2. Cloudflare dns documentation Checked 2026-10-05