GoAdmio

dmarc

Add a DMARC TXT record to a domain's Cloudflare DNS (auto-generated or custom value)

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/dmarc is a short wrapper around cloudflare. It adds the DMARC TXT record that tells receiving mail servers what to do with messages that fail SPF or DKIM checks. It can:

The call is appended to /var/log/go/dmarc.log.


Quick start

# Add the auto-generated DMARC record for a domain
/go/dmarc example.com

Syntax

/go/dmarc <domain> [value]
Form Runs Behavior
/go/dmarc <domain> cloudflare --domain <domain> --type dmarc Adds a DMARC record with an auto-generated value.
/go/dmarc <domain> <value> cloudflare --domain <domain> --type dmarc --value <value> Adds a DMARC record with your value.

Both forms use the dmarc record type, so cloudflare chooses the record name. Check the name in Cloudflare after the first run.


Options

dmarc takes positional arguments only.

Argument Required Notes
<domain> Yes The full domain name, as hosted on Cloudflare.
[value] No The DMARC policy string. Replaces the auto-generated value.

The arguments are passed to cloudflare without quotes, so a value containing spaces (such as v=DMARC1; p=none; rua=mailto:...) is split into several arguments and may be rejected or truncated. Write the value without spaces.


Output

dmarc prints nothing itself. Any result or error message comes from cloudflare.


Examples

# Auto-generated DMARC record
/go/dmarc example.com
# Custom policy, written without spaces
/go/dmarc example.com 'v=DMARC1;p=none;rua=mailto:dmarc@example.com'

Troubleshooting

Symptom Likely cause Fix
No record appears in Cloudflare The domain isn't on Cloudflare, or the API credentials aren't set up. Add the domain with dns and configure cloudflare.
Custom value is cut off or rejected The value contains spaces and is split into several arguments. Remove the spaces, or use txt.
Receivers ignore the policy DNS hasn't propagated, or SPF and DKIM aren't set up. Add the spf and dkim records.

Details

dmarc does no validation of its own. With no <domain>, it passes an empty value on to cloudflare.

DMARC builds on SPF and DKIM, so publish those records for the domain too. To run the OpenDMARC service on the server itself, see installdmarc.


See also

Command Description
cloudflare Manage DNS records using Cloudflare's API
dkim Add a DKIM TXT record to a domain's Cloudflare DNS (auto-generated or custom value)
spf Add or refresh the SPF TXT record via Cloudflare
txt Add a TXT record to a domain through Cloudflare
installdmarc Install and configure OpenDMARC
dns Add your domain to Cloudflare and edit the DNS zone