Running it

How to Check a DMARC Record (and Fix a Fail)

Look up your DMARC record with one command or one tool, then read dmarc=fail in Gmail. Six causes to check in order, and how to fix each.

Illustration: an envelope with a shield beside a magnifier over a DNS record card

The short answer

To check a DMARC record, look up the TXT record at _dmarc.yourdomain.com: run dig TXT _dmarc.yourdomain.com +short on macOS or Linux, run nslookup -type=TXT _dmarc.yourdomain.com. on Windows, or enter your domain in the DMARC and SPF checker. A healthy record is a single line that starts with v=DMARC1 and contains a p= policy.

A "DMARC fail" is a different question, and the lookup cannot answer it. A message fails DMARC when neither SPF nor DKIM passed in alignment with the domain in the visible From address. A record can be perfect and the mail can still fail, which is why the rest of this page is about reading the failure and not only the record.

We will do both: check the record, then read a real failure and fix its cause. If you cannot edit your DNS because the account is with a former developer, start with getting your website back from a previous developer, because every fix below needs access to the DNS zone.

Step 1: Check that the record exists and is well formed

DMARC lives in DNS, in one TXT record at the name _dmarc in front of your domain. There are three ways to read it.

With the checker. Enter the domain in the DMARC and SPF checker. It reads the live DNS for both records and returns a verdict and the exact record it found.

With a command. On macOS or Linux:

Shell
dig TXT _dmarc.yourdomain.com +short

On Windows, in PowerShell:

Text
Resolve-DnsName -Type TXT _dmarc.yourdomain.com

At a plain command prompt, with no PowerShell, the equivalent is nslookup -type=TXT _dmarc.yourdomain.com.. Both commands are worked through line by line further down this step.

With a general DNS tool. The DNS checker shows any record type for any name, which is useful when you want to look at the TXT record and the MX records side by side.

A DMARC record split into its version, policy and report address tags
One line, three tags that matter on day one. Everything else is optional.

What a good result looks like:

  • Exactly one record. If two come back, a receiver may discard both. The current DMARC specification, RFC 9989, says that when more than one DMARC record is found for a target, all of them are discarded. Delete the extra one.
  • It starts with v=DMARC1. A record that does not is ignored, and a stray space or a missing semicolon can have the same effect.
  • It has a p= tag. The values are none (no handling preference), quarantine (treat failures as suspicious) and reject (treat failures as not valid). Google's DMARC setup guide lists the same three.
  • It has an rua= address, ideally a dedicated mailbox or a reporting service, because the aggregate reports are how you find out which senders are failing. Google recommends always including it.

If nothing comes back, no record is published at that name, and the first fix is simply to add one. A safe starting record, with a mailbox you control in place of the placeholder, is:

Text
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com

What our checker can and cannot tell you

We wrote the checker, so we can be exact about its limits. It reads the TXT records for the domain and for _dmarc. plus the domain, reports whether an SPF and a DMARC record exist, and reads the SPF ending (-all, ~all) and the DMARC policy. It tells you p=none only monitors. When more than one SPF or DMARC record is published it fails the check outright and quotes each record it found, numbered, so you can see which one to delete.

It does not send a test message, so it cannot tell you whether your mail passes DMARC. It does not count the DNS lookups in your SPF record, and it does not follow a DKIM selector unless you use the separate DKIM checker and give it one. It is also more forgiving than the standard on one point: it matches the version tag without regard to case, so a record published as v=dmarc1 reads as found here while the standard requires every receiver to ignore it. A green result means the record is published and readable. Treat it as step one, not as proof that your mail is authenticated.

The lookup worked through, with dig

dig ships with macOS and with most Linux distributions, and it shows exactly what the public DNS is handing out. The short form answers the question in one line:

Shell
dig TXT _dmarc.yourdomain.com +short

A domain with a healthy record answers with one quoted string. Here is a real lookup against Google, whose record is public:

Text
$ dig TXT _dmarc.google.com +short
"v=DMARC1; p=reject; rua=mailto:mailauth-reports@google.com"

+short is convenient, and it hides the one thing you need when the answer comes back empty. So learn the long form as well. Without +short, dig prints the whole response:

Text
$ dig TXT _dmarc.google.com

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35991
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;_dmarc.google.com.		IN	TXT

;; ANSWER SECTION:
_dmarc.google.com.	300	IN	TXT	"v=DMARC1; p=reject; rua=mailto:mailauth-reports@google.com"

Four fields carry all the meaning:

  • status is the verdict on the name itself. NOERROR means the name exists. NXDOMAIN means it does not.
  • ANSWER on the flags line counts the records returned. One is what you want. Zero means nothing is published at that name. Two or more means a duplicate.
  • The number before IN TXT (300 in the example) is the time to live in seconds, which is how long a resolver may keep serving this answer after you change it.
  • The quoted string is the record, byte for byte as published. Nothing in the chain has checked it for sense.

Two more options are worth keeping to hand. The first trims the output to the answer only, the second asks a named resolver instead of whichever one your network handed you:

Shell
dig +noall +answer TXT _dmarc.yourdomain.com
dig TXT _dmarc.yourdomain.com @8.8.8.8

And one pair settles the argument that follows every DNS change. Find the nameservers that actually hold the zone, then ask one of them directly, because an authoritative server has no cache in front of it:

Shell
dig NS yourdomain.com +short
dig TXT _dmarc.yourdomain.com @dns1.example-host.com +short

If the authoritative answer is correct and a public resolver still shows the old value, nothing is broken and you are waiting for a cached copy to expire. How long DNS propagation takes covers which of the three delays you are actually sitting in.

The same lookup on Windows, with nslookup

Windows has no dig. It has nslookup, which is a different program with different output, and the record type goes in front of the name:

Text
nslookup -type=TXT _dmarc.yourdomain.com

-type=<resourcerecordtype> is the documented option in Microsoft's nslookup reference; set type=TXT does the same thing inside the interactive prompt you get by running nslookup with no arguments. The answer arrives under a text = label:

Text
_dmarc.yourdomain.com	text =

	"v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com"

Three things about this tool specifically, and the first one wastes the most time.

It appends your local domain to any name that does not end in a dot. Microsoft's reference states that if the name to find "[does not] have a trailing period, the default DNS domain name is appended to the name". On a laptop joined to a company network, that quietly turns _dmarc.yourdomain.com into _dmarc.yourdomain.com.corp.internal, which exists nowhere, and hands you a missing-record answer for a record that is published and fine. End the name with a dot:

Text
nslookup -type=TXT _dmarc.yourdomain.com.

Its failure messages are more informative than dig +short. The same reference lists Nonexistent domain for "the computer or DNS domain name [does not] exist" and No records for "the DNS name server [does not] have resource records of the current query type for the computer, although the computer name is valid". Those are two different situations with two different fixes, and the next section is about reading them.

It asks your configured resolver unless you name another. The second parameter is the server to query, which makes this the Windows equivalent of dig @8.8.8.8:

Text
nslookup -type=TXT _dmarc.yourdomain.com. 8.8.8.8

PowerShell's Resolve-DnsName -Type TXT _dmarc.yourdomain.com returns the same data in a tidier shape and is the better tool when you have the choice. nslookup is the one that is present on every Windows machine, including a locked-down one, and it is what most instructions you will be handed assume. A note if you follow those instructions on a Mac: nslookup exists there too, as a different implementation, and it words the same conditions differently, reporting a missing name as ** server can't find _dmarc.example.com: NXDOMAIN rather than as Nonexistent domain.

Missing, malformed or duplicated: reading what came back

A resolver validates nothing. It returns whatever the zone publishes, so a lookup that prints a record is not proof that any receiver will use it. Three failure shapes account for nearly every case, and each has a signature at the command line.

Missing, which comes in two kinds. dig +short prints nothing for both of them, which is the reason to run the long form when the answer is empty:

Text
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 42681
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; AUTHORITY SECTION:
yourdomain.com.		592	IN	SOA	ns1.example-host.com. ...

NXDOMAIN means the _dmarc label does not exist in the zone at all: no record was ever added, or it went in under a different name. The SOA record in the authority section names the zone that answered, which is a free hint about which provider is holding your DNS. NOERROR with ANSWER: 0 is the other kind, and it means the name exists but carries no TXT record, which usually points to a CNAME left behind by a DMARC reporting service or a record that was deleted rather than edited. Windows separates the two for you: Nonexistent domain is the first, No records is the second.

While you are in the terminal, check the two names a missing record usually turns up at. The first is a record saved at the domain itself instead of at _dmarc, the second is a panel that appended your domain to a name you had already written in full:

Shell
dig TXT yourdomain.com +short
dig TXT _dmarc.yourdomain.com.yourdomain.com +short

Malformed, which looks identical to healthy. This is where the lookup stops being enough and the specification has to be read. RFC 9989, the current DMARC standard, is strict about one tag and forgiving about the rest:

  • The v tag is required, it has to be the first tag in the record, its value is case sensitive, and the only valid value is DMARC1. If the tag is absent, not first, or not exactly DMARC1, then "the entire record MUST be ignored". So v=dmarc1; p=reject and p=reject; v=DMARC1 are both, in protocol terms, a domain with no DMARC at all, while your lookup prints a record and your panel shows a saved row.
  • Syntax errors in the rest of the record are treated gently. Unknown tags must be ignored, and "syntax errors in the remainder of the record MUST be discarded in favor of default values (if any) or ignored outright". A typo such as p=rejct therefore does not break the record, it removes the policy from it, and a record with no usable p tag is treated as though it said p=none. That is the quietest failure in the protocol: enforcement you believe is switched on, reading to every receiver as monitoring.
  • A record longer than 255 characters comes back as two quoted strings on one line. That is correct and not a fault. A TXT record is made of one or more character-strings, and the standard requires an evaluator to join them in order and parse the result as a single string, so resist the urge to delete one half.

Duplicated, which is the one worth checking twice. +short prints one record per line, so two lines beginning v=DMARC1 is the whole diagnosis:

Text
$ dig TXT _dmarc.yourdomain.com +short
"v=DMARC1; p=none;"
"v=DMARC1; p=reject; rua=mailto:dmarc-reports@yourdomain.com"

RFC 9989 discards both of them: "If multiple DMARC Policy Records are returned for a single target, they are all discarded." The result is a domain with no DMARC policy in effect, presenting as a domain with a strict one. It is not a rare mistake either. We found exactly this pair on a domain of our own during an audit, a leftover p=none record sitting beside the p=reject record that replaced it, and the only fix is to delete one at the registrar. Note that one TXT name can legitimately hold many records, and often does: a single lookup of google.com returns seventeen TXT records, most of them vendor verification strings. A long list at the domain itself is normal. It is specifically two v=DMARC1 lines at _dmarc that switch DMARC off. On Windows the same situation appears as two text = entries for one name.

No terminal: where the record lives in your hosting panel

Everything above is a read-only lookup, and the DMARC and SPF checker does that part in a browser. A panel is what you need in order to change the record, and the first question is which panel is in charge, because the company you bought the domain from is often not the one answering for it.

Find the nameservers, by lookup or in the checker, and compare them with the panel you were about to open:

Shell
dig NS yourdomain.com +short

Hostinger states the consequence plainly in its own documentation: DNS management in its panel is available only while the domain uses Hostinger nameservers, and if DNS lives elsewhere you have to manage it there. Editing a zone in a panel that is not authoritative changes nothing at all, and it is a comfortable half hour to lose before anyone notices.

Once you are in the right place, the path to the record is short. These are the five we meet most often:

PanelWhere the DNS records areWhat goes in the name field
cPanelDomains → Zone Editor, then Manage beside the domain, then Add Record_dmarc (cPanel appends the domain) or the full name with a trailing dot
Hostinger hPanelDomains → your domain → DNS / Nameservers, or Websites → your site → Advanced → DNS Zone Editor_dmarc
GoDaddyDomain Portfolio → your domain → Domain Settings → DNS → Add New Record_dmarc, as a prefix without the domain (@ means the root)
NamecheapDomain List → Manage → Advanced DNS → Add new record_dmarc in the Host field
Cloudflarethe DNS Records page for the zone, then Add record_dmarc

In every one of them the type is TXT, the value is the record itself, and the time to live can stay on the default. Three traps account for most of the records that come back wrong:

  1. The name field. Almost every panel adds your domain for you. Namecheap puts it in writing: "the domain name itself should not be included in the Host field", even when the provider that gave you the record wrote it out in full. Type _dmarc and nothing more. If the lookup for _dmarc.yourdomain.com.yourdomain.com returns a record, this is what happened.
  2. Nothing checks the value. cPanel's documentation warns outright that the record box "will accept invalid data". A policy spelled p=quarentine, a smart quote pasted in from a document, a missing mailto: in front of the report address: every one of those saves cleanly and shows as a tidy row in the panel.
  3. Saving is not publishing. Some panels hold changes behind a second Save All Records button, and all of them are subject to the time to live on the old answer.

Which is why the panel is never the last step. Save the record, then read it back from outside with the lookup above or with the checker, and treat what the lookup returns as the only version that exists. If you are putting all three records in for the first time, set up SPF, DKIM and DMARC in that order rather than starting here, because a DMARC policy with nothing authenticated underneath it reports failures for every message you send.

Step 2: Read the failure in a real message

A DMARC fail is a property of a received message, so the evidence is in that message's headers. In Gmail, open the message, choose More next to Reply, then Show original, as described in Gmail's help. In the headers you want the Authentication-Results line, a standard header defined in RFC 8601. It looks like this (placeholder domains):

Text
Authentication-Results: mx.google.com;
  dkim=pass header.i=@mailer.example header.s=s1;
  spf=pass smtp.mailfrom=bounce.mailer.example;
  dmarc=fail header.from=yourdomain.com

Read that carefully, because it is the single most common surprise. SPF passed. DKIM passed. DMARC failed. That is not a contradiction. DMARC does not ask whether SPF or DKIM passed. It asks whether the domain that passed is the same domain as the one in the From address.

Three domains compared with the From domain; only a matching one makes DMARC pass
DMARC passes when SPF or DKIM passes and the domain it verified matches the From domain. A pass for somebody else's domain does not count.

The rule comes straight from the standard. In the DMARC specification a message passes when at least one of SPF or DKIM produces a pass on an identifier that aligns with the From domain. Alignment is relaxed by default (the two domains must share an organisational domain, so mail.yourdomain.com aligns with yourdomain.com) and strict if you ask for it with aspf or adkim. In the example above, the passing domain is mailer.example, a sending service, and the From domain is yourdomain.com, so nothing aligns and DMARC fails.

Gmail's own sender rules say the same thing: for direct email, the domain in the From header must be aligned with either the SPF domain or the DKIM domain.

Step 3: The six causes, in the order we would check them

1. A third-party sender is signing with its own domain. This is the example above, and it is where we would look first. Newsletter tools, invoicing software, CRMs and helpdesks all send mail "from" your address by default, but sign it with their domain. The fix is in that tool's settings: look for "domain authentication", "custom DKIM" or "branded sending domain", publish the records it gives you, and wait for it to show as verified. Then send a test and read the headers again: you want header.i=@yourdomain.com (or a subdomain) on the DKIM line.

2. DKIM is not enabled for your own domain. On Google Workspace and Microsoft 365, DKIM signing for your domain is something an administrator switches on after publishing a key. Until then, mail is signed with a default domain that does not align. Check the key exists with the DKIM checker; you need the selector from your provider's settings (Google Workspace uses google by default, and Microsoft 365 uses selector1 and selector2).

3. Two SPF records, or too many lookups. A domain must publish one SPF record. If more than one comes back, RFC 7208 says the result is a permanent error. SPF is also limited to 10 mechanisms and modifiers that cause DNS lookups (include, a, mx, exists and redirect count; ip4, ip6 and all do not), and exceeding that limit is also a permanent error. Every new service people add tends to arrive as one more include, so a record that worked last year can quietly break. Merge the records into one, and remove includes for services you no longer use. Our checker does not count lookups, so use a tool that does if you suspect this.

4. The DMARC record is duplicated or at the wrong name. It must be a TXT record at _dmarc.yourdomain.com, not at the apex and not at dmarc.yourdomain.com. Many DNS panels append your domain automatically, so entering the full name produces _dmarc.yourdomain.com.yourdomain.com. Look the record up from the outside, as in step 1, and confirm the name you queried is the one that answers.

5. Forwarding and mailing lists. When a message is forwarded, the forwarder's server is not in your SPF record, so SPF fails. When a list changes the subject or adds a footer, the DKIM signature no longer matches the body, so DKIM fails. Either way, an aligned pass is lost. You cannot fix a stranger's forwarder, which is the main reason DKIM is the more reliable of the two to rely on: a signature survives forwarding when the content is not modified.

6. A subdomain you forgot. Mail sent from news.yourdomain.com or app.yourdomain.com is evaluated against that name. A subdomain inherits the organisational domain's policy unless it publishes its own, and many sending tools use their own subdomain. Check the exact From domain in the failing message, not just your main one.

Step 4: Tighten the policy only after the reports are clean

Do not jump to p=reject. A policy applies to every message that claims to be from your domain, including legitimate mail from a tool you forgot about, and a reject setting will cause that mail to be refused.

The sequence Google recommends is to start with p=none, review the authentication results and fix any legitimate mail that fails, and then move to quarantine or reject. The reports sent to your rua address are what make that review possible. They are XML files, and they are easier to read through a free reporting service than by hand.

One point of vocabulary for anyone reading older guides. Many of them tell you to ramp up with pct=25, then 50, then 100, which applied a policy to a share of failing mail. RFC 9989, which obsoletes the older RFC 7489, removes pct and adds a t tag for test mode instead. Receivers adopt a new standard at their own pace, so for now a safe habit is the staged approach above: stay at none until your reports show every legitimate sender passing, then enforce.

Why it matters even if you send very little

Mailbox providers now ask for authentication, not only recommend it. Google's rules for senders say that all senders need SPF or DKIM, and that anyone sending more than 5,000 messages a day to Gmail accounts needs SPF, DKIM and DMARC, with the From domain aligned to one of them. A small business sending a few hundred messages is below the bulk threshold, but the mail that reaches Gmail is still judged on authentication, and unauthenticated mail might be marked as spam.

There is a second reason that has nothing to do with deliverability. Without an enforced DMARC policy, anyone can send a message that appears to come from your domain, and receivers have no instruction on what to do with it.

A ten-minute checklist

  1. Run the DMARC and SPF checker on your domain. Confirm one DMARC record, a p= value and an rua= address.
  2. Send a message from every system that sends as you (your mailbox, your website forms, your newsletter, your invoicing tool) to a Gmail address.
  3. For each one, open Show original and read the Authentication-Results line.
  4. Wherever dmarc=fail appears, compare the From domain with the passing SPF and DKIM domains. The mismatch names the cause.
  5. Fix the sender's domain authentication, merge duplicate records, and re-test.
  6. Leave the policy at none until the reports are clean, then move to quarantine, and reject when you are sure.

While the domain is in front of you, the other ten-minute check is the certificate. How to check an SSL certificate and fix errors covers the same ground for HTTPS: the four failures a browser reports, why a certificate with 78 days left can still be invalid, and why the maximum lifetime of a public certificate is on its way down to 47 days, which makes automatic renewal the only setup that survives.

Frequently asked questions

What does DMARC fail mean?

It means the message did not pass SPF or DKIM in alignment with the domain in its From address. The mail may have been delivered, filed as spam or rejected, depending on the sender's p= policy and the receiver's own rules.

How do I check my DMARC record?

Query the TXT record at _dmarc.yourdomain.com, with dig TXT _dmarc.yourdomain.com +short, Resolve-DnsName on Windows, or the DMARC and SPF checker. Look for one record starting with v=DMARC1 and a p= policy.

Why does DMARC fail when SPF and DKIM pass?

Because DMARC requires the domain that passed to match the From domain. A sending service that signs and bounces mail with its own domain passes both checks for itself and fails DMARC for you. Set up custom domain authentication in that service.

Is p=none enough?

For monitoring, yes, and it is the right place to start. It asks receivers to take no specific action on failures, so it does not stop others from sending as your domain. Once your reports are clean, move to quarantine or reject.

Can I have two DMARC records?

No. Publish one. The current specification says that when multiple DMARC records are found, all of them are discarded, so a duplicate can switch DMARC off entirely.

How long does a DMARC change take to apply?

As long as your DNS record's time to live (TTL) and the receiver's cache allow, which is often minutes to a few hours. The record can be looked up from outside as soon as it is published, so check it there before you send your test messages.

Do I need DMARC if I only send a few emails?

If you send fewer than 5,000 messages a day to Gmail, DMARC is not mandatory for Gmail's bulk rules, but SPF or DKIM is required of everyone, and a published DMARC record at p=none costs nothing and gives you reports.

How do I check a DMARC record using nslookup?

Run nslookup -type=TXT _dmarc.yourdomain.com. at a command prompt, keeping the trailing dot so that Windows does not append your local domain to the name. The record comes back under a text = label. Nonexistent domain means the _dmarc name does not exist; No records means the name exists but carries no TXT record. Add a resolver as a second parameter, as in nslookup -type=TXT _dmarc.yourdomain.com. 8.8.8.8, to ask something other than your own network's.

What is the dig command for a DMARC record?

dig TXT _dmarc.yourdomain.com +short prints the record and nothing else. Drop +short when the answer comes back empty, because the full output separates NXDOMAIN, meaning the name does not exist, from NOERROR with ANSWER: 0, meaning the name exists without a TXT record. Two quoted lines mean two records, which is its own problem.

Where is the DMARC record in cPanel?

Open Domains → Zone Editor, select Manage beside the domain, and look for a TXT row named _dmarc. To add one, use Add Record with the type set to TXT and the name set to _dmarc; cPanel appends your domain, so do not type it twice. Then read the record back with a lookup, because the panel saves an invalid value without complaint.

When a fix is bigger than a DNS record

Most DMARC failures are one setting in one tool. The harder cases are a domain with years of accumulated records, a mail setup split across several providers, or a website and application that send transactional mail through code nobody has read in a while. That is the kind of job our website fixes and maintenance work covers, and where the setup involves servers or cloud accounts, cloud and DevOps. If you would rather have it checked once and written up, tell us what you send and from where and we will say what we would change.

Tools mentioned in this post