How to Add an MX Record in Cloudflare
MX (Mail Exchange) Records are essential for directing your domain’s email traffic to the correct mail server. Here’s a step-by-step guide to adding an MX Record in Cloudflare.
Step 1: Log in to Cloudflare
- Access your Cloudflare account and log in with your credentials.

- You’ll see a list of domains connected to Cloudflare.
Step 2: Select Your Domain
- In your domain list, click on the domain where you wish to add an MX Record.
Step 3: Go to DNS Settings
- In the left sidebar, select DNS to access the DNS management page.

- Under DNS Records, look for the Add Record button and click on it.

Step 4: Configure the MX Record
- Type: Select MX as the record type from the dropdown menu.
- Name: Enter @ if this record applies to your root domain (e.g.,
example.com
). For email on a subdomain, enter the full subdomain (e.g.,mail.example.com
). - Mail Server: Enter the domain name of the mail server provided by your email host (e.g.,
mail.yourdomain.com
orsmtp.yourmailprovider.com
). - Priority: Set a priority for the MX record. Lower numbers indicate higher priority; set this based on your email provider’s recommendation. If you have multiple MX Records, your email will go to the server with the lowest priority number first.Note: If you have only one MX Record, the priority value doesn’t matter as much, but setting it to 0 is a common default.
- Proxy Status: Cloudflare automatically bypasses the proxy feature for MX Records. Ensure the proxy status for this record is set to DNS only (indicated by a gray cloud icon).

Step 5: Save Changes
- After entering the information, click on Save or Add Record to finalize the MX Record.

What is Cloudflare Proxy?
When the Cloudflare proxy is enabled, Cloudflare acts as an intermediary between visitors and your server, providing features like DDoS protection, SSL encryption, and caching. This not only helps protect your server but can also improve website performance by caching content on Cloudflare’s global network.
Your new MX Record is now set up, and it may take a few minutes for DNS changes to propagate globally. With the MX Record in place, your domain’s email traffic will correctly route to your mail server, allowing you to send and receive emails reliably.
Was this article helpful?
YesNo