netutilus

SPF, DKIM and DMARC Explained

SPF, DKIM and DMARC are three DNS records that let receivers such as Gmail and Outlook tell a domain's real mail from forged mail. SPF lists the servers allowed to send it, DKIM signs each message so receivers can check it against a key the domain publishes, and DMARC tells receivers what to do with mail for which neither passes for the domain in its From line: only watch (p=none), put it in spam (p=quarantine) or refuse it (p=reject). DNS Lookup in Netutilus for Mac checks all three for free; its Reports tab, part of Netutilus Pro, reads the DMARC reports that receivers return.

Updated

Download on the Mac App Store ↗

free to download · macOS 14.6 or later

Anyone can put any address in a message’s From line. Receivers such as Gmail and Outlook tell real mail from forged mail by three records the domain publishes in DNS.

SPF: who may send

SPF is one TXT record on the domain, starting with v=spf1. It lists the servers allowed to send the domain’s mail, often by including a provider’s list, such as include:_spf.google.com. It ends with -all or ~all, which says what to make of every other server.

A receiver makes at most 10 DNS lookups to read it, counting the includes inside includes. One more and SPF fails with an error for every message.

DKIM: a signature on each message

The sending server signs each message, and the receiver checks the signature with a key the domain publishes at selector._domainkey.example.com. Whoever signs picks the selector, so it can’t always be guessed: it’s the s= in the DKIM-Signature header of a message the domain sent. A key shorter than 1024 bits no longer counts.

DMARC: what to do with forged mail

DMARC, a TXT record at _dmarc.example.com, ties the two together. A message passes when SPF or DKIM passes for the domain in its From line, and the record tells receivers what to do with the rest.

Example in the app: DMARC at p=none: receivers send reports, but forged mail is still delivered.

  • The policy receivers apply: none only watches, quarantine sends forged mail to spam, reject refuses it.
  • The record as the domain publishes it.
  • Where the daily reports go, and whether that domain agreed to receive them.

Start at p=none and read the reports: they list every server that sends in your name. When all of your own mail passes, move to p=quarantine, then p=reject.

Reading the reports

Receivers send the reports to the rua address, usually once a day, as an XML file in a .xml.gz or .zip attachment. The Reports tab of DNS Lookup, part of Netutilus Pro, reads them and shows, for each address that sent mail in the domain’s name, what SPF and DKIM said:

  • pass · aligned: it passed for the domain in the From line. One of the two is all DMARC asks for.
  • pass · not aligned: it passed for another domain. That’s usually a service sending in your name that was never set up for it: add it to SPF, or turn on its DKIM signing for your domain.
  • fail on both: a service not set up yet, or someone forging the domain. If you don’t know the sender, this is the mail p=reject is for.

Forwarded mail can fail SPF with nothing wrong on your side. DKIM survives forwarding if the message isn’t changed.

A domain that sends no mail

Spammers like domains that send nothing, because nobody notices. Lock one down with three records: v=spf1 -all, v=DMARC1; p=reject; at _dmarc, and a null MX, 0 ., which says it takes no mail either.

Run it on your own network

Netutilus puts every network tool in one app. Free to download; Pro is a one-time purchase, never a subscription.

Download on the Mac App Store ↗

See also

  • Emails Go to SpamMake sure receivers can tell your domain's mail is really yours, so it reaches the inbox.
  • DNS LookupAsks DNS what a domain points to, from your Mac's resolver or any server you choose, checks the records behind its mail and reads its DMARC reports.
  • DNSThe internet's address book, which turns names like example.com into addresses.
  • DNS PropagationAsks several public DNS resolvers at once whether they see a record change yet.
  • Uptime MonitorChecks your servers, websites, devices and mail records on a schedule, alerts you when one goes down, and keeps the history.