Skip to main content

Overview

If your domain’s DNS is managed on Cloudflare, you have three options for configuring DNS — from easiest to most manual.

Option 1: Sign in to Cloudflare (One-Click)

The fastest option. Migma auto-detects that your domain uses Cloudflare DNS and handles everything for you — no API token needed.
1

Add Your Domain

Go to Settings → Sending Domains → Add Domain and enter your root domain.
2

Click Sign in to Cloudflare

On the domain detail page, Migma detects Cloudflare DNS and shows a Sign in to Cloudflare button. Click it.
3

Authorize in Cloudflare

You’re redirected to Cloudflare to authorize Migma. Review the permissions and click Authorize.
4

Done

You’re redirected back to Migma. All DNS records are configured automatically and your domain begins verification.
How this works: Migma uses the Domain Connect protocol to configure DNS. No API token is created or stored — you simply authorize one-time access through Cloudflare’s standard OAuth flow.Prerequisite: Your domain must be hosted on Cloudflare nameservers (not just using Cloudflare as a proxy).

Option 2: API Token Setup

If you prefer to use an API token (or the one-click flow isn’t available for your setup), you can create a Cloudflare API token that lets Migma manage DNS records.

Step 1: Add Your Domain to Migma

1

Open Sending Domains

Go to Settings → Sending Domains in your Migma dashboard.
2

Add Your Domain

Click Add Domain and enter your root domain (e.g., yourdomain.com).
3

View DNS Records

Migma displays the DNS records needed. Keep this page open.

Step 2: Create a Cloudflare API Token

You need to create an API token that allows Migma to add DNS records.
1

Open Cloudflare API Tokens

2

Click Create Token

Click the Create Token button.
3

Select Custom Token

Scroll down and click Get started next to Create Custom Token.
4

Name Your Token

Enter a name like Migma DNS Access.
5

Add Zone Read Permission

Under Permissions, click Add more and select:
  • ZoneZoneRead
6

Add DNS Edit Permission

Click Add more again and select:
  • ZoneDNSEdit
7

Set Zone Resources

Under Zone Resources, choose one of:
OptionWhen to Use
Include → Specific zone → [your domain]You only want Migma to access this one domain
Include → All zonesYou want Migma to manage DNS for any domain in your account
8

Create the Token

Click Continue to summary, review the permissions, then click Create Token.
9

Copy the Token

Important: Copy the token immediately. It’s only shown once.
If you lose the token, you’ll need to create a new one.

Step 3: Connect Cloudflare to Migma

1

Return to Migma

Go back to Settings → Sending Domains and click on your domain.
2

Click Connect Cloudflare

Find the Cloudflare Integration section and click Connect Cloudflare.
3

Paste Your API Token

Paste the token you copied from Cloudflare.
4

Confirm Connection

Migma validates the token and shows the zones (domains) available.

Step 4: Auto-Configure DNS

1

Click Auto-Configure DNS

Click the Auto-configure DNS button.
2

Review Records Added

Migma adds all required records to Cloudflare:
  • 3 DKIM CNAME records
  • 1 SPF TXT record
  • 1 DMARC TXT record
  • 2 MAIL FROM records (MX + TXT)
3

Verify Domain

Click Verify Domain. Verification typically completes within a few minutes.

Option 3: Manual Setup

If you prefer to add DNS records manually in Cloudflare, follow these steps.

Step 1: Log in to Cloudflare

1

Go to Cloudflare Dashboard

2

Select Your Domain

Click on the domain you want to configure.
3

Open DNS Settings

Click DNS in the left sidebar, then Records.

Step 2: Add DKIM Records

Add 3 CNAME records for DKIM authentication.
1

Click Add Record

Click the Add record button.
2

Configure First DKIM Record

FieldWhat to Enter
TypeSelect CNAME
NameCopy the first _domainkey name from Migma (e.g., abc123._domainkey)
TargetCopy the corresponding value from Migma
Proxy statusClick to set to DNS only (gray cloud)
TTLLeave as Auto
Click Save.
3

Add Second DKIM Record

Repeat with the second set of values from Migma.
4

Add Third DKIM Record

Repeat with the third set of values from Migma.
Proxy status must be “DNS only” (gray cloud)CNAME records for email authentication cannot be proxied through Cloudflare. If the cloud is orange, click it to turn it gray.

Step 3: Add SPF Record

1

Check for Existing SPF

Look through your existing TXT records for one that starts with v=spf1.
2

Add or Modify SPF

If you don’t have an SPF record:Click Add record and enter:
FieldWhat to Enter
TypeSelect TXT
NameEnter @
Contentv=spf1 include:spf.migma.ai ~all
TTLLeave as Auto
Click Save.
If you already have an SPF record:Click Edit on your existing SPF record and add include:spf.migma.ai before the ~all.Example:
Before: v=spf1 include:_spf.google.com ~all
After:  v=spf1 include:_spf.google.com include:spf.migma.ai ~all

Step 4: Add DMARC Record

1

Add DMARC TXT Record

Click Add record and enter:
FieldWhat to Enter
TypeSelect TXT
NameEnter _dmarc
Contentv=DMARC1; p=quarantine; rua=mailto:[email protected]
TTLLeave as Auto
Click Save.

Step 5: Add MAIL FROM Records

Add both an MX record and a TXT record for the send subdomain.
1

Add MX Record

Click Add record and enter:
FieldWhat to Enter
TypeSelect MX
NameEnter send
Mail serverCopy the value from Migma
PriorityEnter 10
TTLLeave as Auto
Click Save.
2

Add TXT Record for MAIL FROM

Click Add record and enter:
FieldWhat to Enter
TypeSelect TXT
NameEnter send
Contentv=spf1 include:spf.migma.ai ~all
TTLLeave as Auto
Click Save.

Step 6: Verify in Migma

1

Return to Migma

Go to Settings → Sending Domains.
2

Click Verify Domain

Click Verify next to your domain.
3

Wait for Verification

Verification typically completes within minutes. DKIM may take up to 72 hours in some cases.

Managing Cloudflare Connection

Disconnect Cloudflare

To remove the Cloudflare connection:
  1. Go to Settings → Sending Domains
  2. Click on your domain
  3. Click Disconnect Cloudflare
  4. Your DNS records remain in Cloudflare (they’re not deleted)

Delete DNS Records When Removing Domain

When you delete a domain from Migma:
  1. If Cloudflare is connected, you’ll see an option: Also delete DNS records from Cloudflare
  2. Check this option to remove all email-related DNS records
  3. Leave unchecked to keep the records (useful if migrating to another service)

Troubleshooting

Possible causes:
  • Your domain’s DNS is not managed on Cloudflare
  • The API token doesn’t have access to this zone
Solutions:
  1. Verify your domain is on Cloudflare:
    • Log in to Cloudflare dashboard
    • Check if your domain appears in the account
    • Verify the domain status is “Active”
  2. Check your API token permissions:
    • Go to Cloudflare → Profile → API Tokens
    • Click “View” on your token to see which zones it can access
    • If using “Specific zone”, ensure your domain is included
  3. Create a new token with correct permissions:
    • Create a new token with “All zones” to test
    • If that works, the original token was zone-restricted
Possible causes:
  • Token was copied incorrectly
  • Token was revoked or expired
  • Token doesn’t have required permissions
Solutions:
  1. Create a new token with the correct permissions:
    • Zone → Zone → Read
    • Zone → DNS → Edit
  2. Copy the token immediately after creation (it’s only shown once)
  3. In Migma, click Disconnect Cloudflare and reconnect with the new token
What’s happening: Cloudflare updates are usually instant, but global DNS propagation takes time.Timeline:
  • Cloudflare: Instant
  • Global DNS: 5-60 minutes
  • DKIM verification: Up to 72 hours (rare cases)
What to do:
  • Wait at least 15 minutes before retrying verification
  • Use DNS Checker to see if your records have propagated
Issue: CNAME records have orange cloud (proxied) instead of gray cloud (DNS only).Why it matters: Email authentication records cannot be proxied through Cloudflare. They must resolve directly.Solution:
  1. Go to Cloudflare DNS settings
  2. Find the DKIM CNAME records
  3. Click the orange cloud to turn it gray
What happens: If a DNS record with the same name and type already exists, Migma updates it instead of creating a duplicate.This is normal and expected. Your existing record is modified to include the correct values.

Next Steps