Domain host
How to add MX, TXT and CNAME records in Cloudflare
DNS and security provider. Records live on the DNS Records page, where each record can be proxied or DNS only.
Which email provider are you setting up?
- Cloudflare Email Routing Cloudflare Email Routing on Cloudflare
- Google Workspace Google Workspace on Cloudflare
- Microsoft 365 Microsoft 365 on Cloudflare
- Zoho Mail Zoho Mail on Cloudflare
- Fastmail Fastmail on Cloudflare
- Hostinger Email Hostinger Email on Cloudflare
- iCloud+ Custom Email Domain iCloud+ Custom Email Domain on Cloudflare
- Migadu Migadu on Cloudflare
- Namecheap Private Email Namecheap Private Email on Cloudflare
- Proton Mail Proton Mail on Cloudflare
- Rackspace Email Rackspace Email on Cloudflare
- Titan Email Titan Email on Cloudflare
Find the DNS editor
- Sign in to the Cloudflare dashboard and select your domain.
- Open the DNS Records page.
What goes in each field
| Record | Host field | Value field |
|---|---|---|
| MX | Name | Mail server + Priority |
| TXT | Name | Content |
| CNAME | Name | Target |
- For your bare domain, MX: enter @ in Name; TXT: enter @ in Name; CNAME: enter @ in Name.
- For other names, type only the part before your domain (for example _dmarc). Cloudflare adds your domain automatically.
- Default TTL: Auto.
Adding a record at Cloudflare
MX record
- On the DNS Records page, select Add record.
- Choose MX as the Type.
- Fill in Name, Mail server and Priority.
- Select Save.
- Delete any other MX records: select Edit on each one, then Delete, and confirm.
TXT record
- On the DNS Records page, select Add record.
- Choose TXT as the Type.
- Fill in Name and Content.
- Select Save.
CNAME record
- On the DNS Records page, select Add record.
- Choose CNAME as the Type.
- Fill in Name and Target.
- Set Proxy status to DNS only (grey cloud).
- Select Save.
Cloudflare gotchas
Cloudflare DNS: questions
How do I add an MX record in Cloudflare?
Sign in to the Cloudflare dashboard and select your domain. Open the DNS Records page. On the DNS Records page, select Add record. Choose MX as the Type. Fill in Name, Mail server and Priority. Select Save. Delete any other MX records: select Edit on each one, then Delete, and confirm.
How do I add a TXT record in Cloudflare?
Sign in to the Cloudflare dashboard and select your domain. Open the DNS Records page. On the DNS Records page, select Add record. Choose TXT as the Type. Fill in Name and Content. Select Save.
What goes in the Name field at Cloudflare?
Enter @ for records on your bare domain, such as MX and SPF. For the others, enter only the part before your domain, for example _dmarc. Cloudflare adds your domain automatically.
How long do DNS changes take at Cloudflare?
Cloudflare says changes to your DNS records take effect worldwide within 5 minutes, usually much less. A record you replaced can stay cached until its old TTL runs out.
Sources
- Add a custom domain to Microsoft 365 (Microsoft Learn)
- Cloudflare DNS: TXT, CNAME, MX Records (Zoho Mail Help)
- Connect your DNS records at Cloudflare to Microsoft 365 (Microsoft Learn)
- Create zone apex record (Cloudflare Docs)
- Email Routing: domain configuration (Cloudflare Docs)
- FAQ (Cloudflare DNS Docs)
- Manage DNS records (Cloudflare Docs)
- Proxy status (Cloudflare Docs)