December 5, 2026

SPF, DKIM and DMARC Explained With Real Records From Google, Gmail and Wikipedia

A wax-sealed envelope resting on a laptop keyboard

Gmail’s DMARC record tells receiving servers to take no specific action on mail that fails its checks, p=none, while google.com’s own record says p=reject. One of Gmail’s published DKIM keys contains nothing at all after p=, which under the standard means that key has been revoked. And example.com, a domain that sends no email, publishes the strictest records of all. Every record quoted in this post was pulled live from Google Public DNS, and read side by side they show how the three email authentication systems fit together, what each one actually checks, and why the third one changed status in May 2026.

Video: Mike Chapple on YouTube

The problem all three solve

Anyone can write any From address

Email was designed without sender verification. A message’s From line is just text, and nothing in the original protocol stops a server from claiming to send mail as any domain. SPF, DKIM and DMARC are three layers added later, each published as DNS records by the domain owner, each answering a different question for the receiving server.

Why it matters now

Mailbox providers increasingly require them. Google’s email sender guidelines tell bulk senders to “Set up SPF and DKIM email authentication for your domain” and “Set up DMARC email authentication for your sending domain.” For anyone running a business domain, a newsletter or a small mail server, these three records decide whether mail lands in the inbox.

Purple flower on white box and brown clipboard

SPF: which servers may send

The record

SPF, defined in RFC 7208 (April 2014), is a TXT record listing which servers may send mail for a domain. Real examples:

example.com     v=spf1 -all
wikipedia.org   v=spf1 include:_cidrs.wikimedia.org ~all
google.com      v=spf1 include:_spf.google.com ~all
gmail.com       v=spf1 redirect=_spf.google.com

Reading them

include: pulls in another domain’s list, redirect= hands the whole decision to another record, and the ending sets what happens to everyone else. RFC 7208 defines - as “an explicit statement that the client is not authorized” and ~ as “a weak statement by the publishing ADMD that the host is probably not authorized.” example.com’s -all, with nothing before it, says no server anywhere may send its mail.

Following the chain

google.com’s include points to _spf.google.com, which lists the actual address ranges:

v=spf1 ip4:74.125.0.0/16 ip4:192.178.47.0/24 ip4:192.179.92.0/22
       ip4:209.85.128.0/17 ip6:2001:4860:4864::/56 ... ~all

The ten-lookup limit

Every include, a, mx, ptr and exists mechanism, plus redirect, costs a DNS lookup. The RFC says implementations “MUST limit the total number of those terms to 10,” and if the limit is exceeded, “the implementation MUST return ‘permerror’.” A business that adds one email service after another, each with its own include, can quietly break its SPF record. Google’s chain uses one lookup for _spf.google.com, which contains only address ranges.

DKIM: was the message signed

A signature in the header

DKIM, defined in RFC 6376 (September 2011), has the sending server sign each message with a private key. The receiver finds the public key in DNS under a selector name, selector._domainkey.domain, and checks the signature. A valid signature shows the message came from someone holding the domain’s key and that signed parts weren’t changed in transit.

A revoked key, in the wild

Looking up one of Gmail’s selectors, 20230601._domainkey.gmail.com, returned:

v=DKIM1; k=rsa; p=

The key data is empty. RFC 6376 is explicit: “An empty value means that this public key has been revoked.” Gmail rotates its keys, and an old selector left published with an empty key tells any receiver still holding a message signed with it that the key is no longer valid. It’s a small, deliberate piece of security housekeeping visible to anyone who looks.

Why selectors exist

Because the selector is part of the lookup name, a domain can publish many keys at once: one per email service, one per year, a new one before retiring the old. That’s what makes rotation possible without a gap in signing.

Gold skeleton key on gray concrete floor

DMARC: what to do when checks fail

Tying it to the From line

SPF checks the server and DKIM checks a signature, but neither, on its own, checks the From address a person sees. DMARC adds that step, called alignment: a message passes only if SPF or DKIM passes for a domain that matches the visible From domain. It also lets the domain owner publish a policy for failures and ask for reports.

Real policies

_dmarc.example.com    v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s
_dmarc.wikipedia.org  v=DMARC1; p=reject; rua=mailto:dmarc-rua@wikimedia.org;
_dmarc.google.com     v=DMARC1; p=reject; rua=mailto:mailauth-reports@google.com
_dmarc.gmail.com      v=DMARC1; p=none; sp=quarantine; rua=mailto:mailauth-reports@google.com

The original DMARC document, RFC 7489, defines the three policies. With none, “The Domain Owner requests no specific action be taken.” With quarantine, failing mail should be “treated by Mail Receivers as suspicious.” With reject, the domain owner “wishes for Mail Receivers to reject email that fails the DMARC mechanism check.” sp sets the policy for subdomains and “applies only to subdomains of the domain queried and not to the domain itself.”

Gmail’s surprising none

Gmail’s p=none looks lax next to google.com’s p=reject, but it’s a choice about a domain that millions of people send from through countless forwarding services and mailing lists, which often break SPF and DKIM. Its subdomain policy is stricter. The rua address in each record is where receivers send aggregate reports, which is how domain owners find out who is sending mail in their name before tightening the policy.

Strict alignment

example.com’s adkim=s and aspf=s request strict alignment. RFC 7489 explains that “In strict mode, only an exact DNS domain match is considered to produce Identifier Alignment,” while the default, relaxed mode, lets a subdomain such as news.example.com align with example.com.

DMARC became a standard in 2026

From informational to standards track

RFC 7489 was published in March 2015 with Informational status, not as an Internet standard. In May 2026, RFC 9989 replaced it as a Proposed Standard on the Internet Standards Track, obsoleting RFC 7489 along with RFC 9091.

The pct tag is gone

The new specification removes the pct tag, which let domain owners apply their policy to only a percentage of failing mail during rollout. It includes an appendix titled “Removal of the pct Tag,” and a t tag now covers test mode. Domains that still publish pct= values won’t break, but receivers following the new standard won’t use them, so a gradual rollout now means stepping from none to quarantine to reject.

What stays the same

The three policy values, none, quarantine and reject, carry over. For most domain owners the practical advice hasn’t changed: publish SPF and DKIM, start DMARC at p=none with a reporting address, read the reports, fix the legitimate senders that fail, and then move to a stricter policy.

A white envelope on a black background

Counting SPF lookups before they break

A small counter

The ten-lookup limit is the SPF failure that surprises people most, because nothing looks wrong until mail starts failing. This short Python script walks an SPF record and its includes and counts the terms that cost a DNS lookup. To keep it self-contained, the records sit in a dictionary: Google’s and Gmail’s as returned by Google Public DNS (with the address list shortened), plus a hypothetical small business, shop.example, that has added four email services over the years:

import re
RECORDS = {   # TXT records as returned by Google Public DNS
    "google.com": "v=spf1 include:_spf.google.com ~all",
    "_spf.google.com": "v=spf1 ip4:74.125.0.0/16 ip4:209.85.128.0/17 ~all",
    "gmail.com": "v=spf1 redirect=_spf.google.com",
    # a hypothetical small business that kept adding services:
    "shop.example": "v=spf1 include:a.example include:b.example include:c.example mx ~all",
    "a.example": "v=spf1 include:a2.example include:a3.example ~all",
    "a2.example": "v=spf1 ip4:192.0.2.0/24 ~all",
    "a3.example": "v=spf1 include:a4.example a ~all",
    "a4.example": "v=spf1 ip4:198.51.100.0/24 ~all",
    "b.example": "v=spf1 include:b2.example include:b3.example ~all",
    "b2.example": "v=spf1 a mx ~all",
    "b3.example": "v=spf1 ip4:203.0.113.0/24 ~all",
    "c.example": "v=spf1 include:c2.example ~all",
    "c2.example": "v=spf1 exists:%{i}.c.example ~all",
}
def count(domain, seen=None):
    rec = RECORDS.get(domain, "")
    n = 0
    for term in rec.split()[1:]:
        t = term.lstrip("+-~?")
        if t.startswith(("include:", "redirect=")):
            n += 1 + count(re.split("[:=]", t, maxsplit=1)[1])
        elif t.split(":")[0] in ("a", "mx", "ptr", "exists"):
            n += 1
    return n
for d in ("google.com", "gmail.com", "shop.example"):
    n = count(d)
    print(f"{d}: {n} lookups{' -> permerror' if n > 10 else ''}")

What it found

google.com: 1 lookups
gmail.com: 1 lookups
shop.example: 14 lookups -> permerror

Google’s records cost one lookup each, because the included record contains only address ranges. The hypothetical shop costs 14: four includes at the top, each with further includes, a and mx terms of their own, plus an exists check. Under RFC 7208 a receiver must stop at ten and return a permanent error, so every message the shop sends fails SPF, even from authorized servers.

The fixes

Removing services no longer in use is the first step. After that, replacing include: entries with the actual address ranges they resolve to, sometimes called flattening, cuts lookups to zero for those entries, at the cost of updating the record whenever a provider changes its addresses. Splitting mail streams onto subdomains, each with its own SPF record, is the cleaner long-term answer.

A domain that sends no mail

example.com’s lockdown

example.com publishes v=spf1 -all, a DMARC policy of p=reject with sp=reject and strict alignment, and, as a separate lookup shows, a null MX record. Together they tell every receiving server that no mail from this domain or any subdomain is legitimate.

Worth copying

Businesses often own domains they never send mail from: old brand names, typo-protection domains, parked sites. Each one is an invitation to spoofers unless it says otherwise. Publishing the same three records costs nothing and shuts that door.

Sources

  • Google, “Email sender guidelines” (Gmail Help): https://support.google.com/a/answer/81126
  • RFC 7208, “Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1,” April 2014: https://www.rfc-editor.org/rfc/rfc7208
  • RFC 6376, “DomainKeys Identified Mail (DKIM) Signatures,” September 2011: https://www.rfc-editor.org/rfc/rfc6376
  • RFC 7489, “Domain-based Message Authentication, Reporting, and Conformance (DMARC),” March 2015: https://www.rfc-editor.org/rfc/rfc7489
  • RFC 9989, “Domain-Based Message Authentication, Reporting, and Conformance (DMARC),” May 2026: https://www.rfc-editor.org/rfc/rfc9989

876 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *