DNS Guide: Cloudflare
DNS Guide: Cloudflare
Step-by-step instructions for adding AgentMail DNS records in Cloudflare.
Steps
- Log in to the Cloudflare dashboard
- Select your domain
- Go to DNS, then click Records
- Click Add Record for each record AgentMail requires
Adding a TXT Record (SPF)
If you already have an SPF record for your domain, do not create a second one. Instead, add include:agentmail.to to your existing SPF record. Having multiple SPF records on the same domain will cause authentication failures.
Adding a TXT Record (DKIM)
Cloudflare automatically strips your domain from the Name field. Enter only the selector host portion (e.g., selector._domainkey), not the full selector._domainkey.yourdomain.com.
Legacy orgs should keep existing working DNS records in place. For new domain setup, add the TXT selector records shown in AgentMail.
Adding an MX Record (Receiving)
If you want to receive emails on a subdomain to avoid conflicts with your existing email provider, enter the subdomain instead of @ in the Name field.
Verification
After adding all records, go back to the AgentMail Console and click Verify Domain.
Cloudflare DNS typically propagates within 1 to 5 minutes, making it one of the fastest providers for DNS updates.
Common Cloudflare Issues
-
Existing SPF record: If you already have a TXT record starting with
v=spf1, addinclude:agentmail.tobefore the~allor-allin that existing record. Do not create a second SPF TXT record. -
Duplicate TXT values: Cloudflare lets you add TXT records with the same name, but duplicate SPF or stale DKIM selector records can make verification fail. Keep only the current values AgentMail provides for each host.
-
Name field auto-strips domain: Cloudflare removes the domain portion from the Name field automatically. If your DKIM selector is
selector._domainkey, enter just that. Do not enterselector._domainkey.yourdomain.com, or the record will be created incorrectly.
