Cloudflare 中文文档
DNS
DNS
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Set up email records

There are three reasons to set up email records for your domain:


​​ Receive email

If you only need to receive emails, Cloudflare offers Email Routing for free email forwarding to custom email addresses.

​​ Send and receive email

To send and receive emails from your domain, you need:

  • An SMTP provider.
  • To create two DNS records within Cloudflare.

To route emails through Cloudflare and to your mail server:

  1. Get the IP address and MX record details from your SMTP provider (vendor-specific guidelines).

  2. Add an A or AAAA record for your mail subdomain that points to the IP address of your mail server.

    Type Name IPv4 address Proxy status
    A mail 192.0.2.1 DNS only
    API example
  3. Add an MX record that points to that subdomain.

    Type Name Mail server TTL
    MX @ mail.example.com Auto
    API example

​​ Prevent domain spoofing

There are several DNS mechanisms to prevent others from sending emails on behalf of your domain. These all work as TXT records that need to be added on your domain:

​​ Configure email security records

Refer to Security records to learn how to set up your email security records.