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.
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#
| Requirement | Cloudflare approach |
|---|---|
| Receive messages sent to your domain | Configure Cloudflare Email Routing for forwarding. |
| Send and receive messages | Add 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:
- Add an
AorAAAArecord for the mail subdomain specified by the provider. The value should be the mail server’s IP address. - Add an
MXrecord for the domain. Its destination should be the mail subdomain that points to the mail server. - Add the provider-supplied
TXTrecords 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:
SPFidentifies which senders are authorized to send mail for the domain.DKIMhelps verify the sender and the integrity of a message.DMARCdefines 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
- Cloudflare: Set up email records Checked 2026-10-05
- Cloudflare dns documentation Checked 2026-10-05