Reference · Websites
SPF, DKIM and DMARC: check the records that tell receivers who may send as your domain
Check a domain's SPF, DKIM and DMARC records with dig, Resolve-DnsName or nslookup: one v=spf1 record within 10 DNS lookups, DKIM selectors for Microsoft 365 and Google Workspace, a _dmarc policy that moves from p=none to reject, and three records for domains that send no mail.
| Target artifact | The DNS records that tell receiving mail servers who may send as a domain: the v=spf1 TXT record on the domain, DKIM keys at SELECTOR._domainkey, the v=DMARC1 TXT record at _dmarc, and the MX records. |
|---|---|
| Default behaviour | None of these records exists until you publish it. Without a _dmarc record the domain asks receivers for nothing, and Microsoft 365 does not DKIM-sign mail from a custom domain until its two CNAME records are published and signing is turned on. |
| Safe state | One v=spf1 record that lists every sender, ends in -all or ~all and needs 10 DNS lookups or fewer; DKIM on for every service that sends as the domain; _dmarc at p=quarantine or p=reject with a rua address someone reads; a domain that sends no mail has v=spf1 -all, v=DMARC1; p=reject; and a null MX. |
| Check on Linux | dig +short TXT example.com |
| Check on Linux | dig +short TXT _dmarc.example.com |
| Check on Windows | Resolve-DnsName -Name _dmarc.example.com -Type TXT |
| Check on Windows | nslookup -type=TXT _dmarc.example.com |
| Check in Microsoft 365 | Get-DkimSigningConfig | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME |
| Check in Gmail | open a message the domain sent, More, Show original, and read the Authentication-Results header |
| Fix at your DNS host | merge every v=spf1 record into one, publish each sender's DKIM record, then add _dmarc at p=none with a rua address and raise it to quarantine, then reject |
| Fix in Microsoft 365 | Set-DkimSigningConfig -Identity example.com -Enabled $true, after the two DKIM CNAME records are published |
| Fix for a domain that sends no mail | TXT v=spf1 -all on the domain, TXT v=DMARC1; p=reject; at _dmarc, and MX 0 . |
Read the records
Replace example.com with your domain. On Ubuntu, dig is in the bind9-dnsutils package.
dig +short TXT example.com
dig +short TXT _dmarc.example.com
dig +short MX example.com
dig +short TXT google._domainkey.example.com
dig +short CNAME selector1._domainkey.example.comdig +short prints | Meaning |
|---|---|
A quoted line starting "v=spf1 | The SPF record; two such lines are an error |
A quoted line starting "v=DMARC1; p= | The DMARC policy |
Several quoted parts on one line, "v=DKIM1; k=rsa; p=MIIB..." "..." | One long record in strings of up to 255 characters, joined without spaces |
0 . | A null MX: the domain accepts no mail |
| Nothing | No record of that type at that name |
These formats come from dig 9.18.39 on Ubuntu 24.04, run on 9 November 2026 against a local test server. On Windows, Resolve-DnsName -Name example.com -Type TXT in PowerShell does the same, with -Type CNAME or -Type MX for the other records; in Command Prompt, use nslookup -type=TXT example.com.
SPF: one record, ten lookups
SPF (Sender Policy Framework, RFC 7208) lists the servers allowed to send for the domain. Receivers check it against the envelope sender, the MAIL FROM address that bounces go to, not the From: address people see; DMARC ties the result to the From: address.
- One record. With two
v=spf1records the check returnspermerror. Merge them:v=spf1 include:spf.protection.outlook.com include:_spf.google.com -alllists both Microsoft 365 and Google Workspace. - Ten lookups.
include,a,mx,ptr,existsandredirectcount, including those inside included records;ip4andip6do not. Past 10 the check returnspermerror, and Microsoft notes that fewer than 10includeterms do not guarantee fewer than 10 lookups. - The ending.
-allgives a fail, "an explicit statement that the client is not authorized";~allgives a softfail, on which alone receivers should not reject mail. Microsoft's record for Microsoft 365 isv=spf1 include:spf.protection.outlook.com -all: it recommends-allwith DKIM and DMARC, because its DMARC handling effectively ignores~allfailures on messages without a DKIM signature. Google's record for Google Workspace isv=spf1 include:_spf.google.com ~all, and Google recommends~all.
DKIM: the selector records
DKIM (DomainKeys Identified Mail, RFC 6376) signs each message. The DKIM-Signature header names the domain in d= and the selector in s=, and receivers fetch the public key from SELECTOR._domainkey.DOMAIN. A key record starts with v=DKIM1; an empty p= means the key was revoked. Each service picks its own selectors: read s= in a message it sent.
Microsoft 365
selector1._domainkey and selector2._domainkey are CNAME records pointing at keys Microsoft holds and rotates. Microsoft's page, updated 3 July 2026, gives two formats for their targets, which cannot be mixed for one selector:
- Custom domains added from May 2025:
selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft, where Microsoft assigns the letter before-v1. - Custom domains added earlier:
selector1-contoso-com._domainkey.contoso.onmicrosoft.com.
Copy the exact values for your domain from Get-DkimSigningConfig. Microsoft's order: if the domain is not listed, create it with New-DkimSigningConfig -DomainName example.com -Enabled $false and list again; publish the two CNAME records; then turn signing on:
Get-DkimSigningConfig | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME
Set-DkimSigningConfig -Identity example.com -Enabled $trueStatus reads NoDKIMKeys or CnameMissing until the records are found, then Valid. Keys are 1024 bits by default; Rotate-DkimSigningConfig -Identity example.com -KeySize 2048 moves to 2048 bits at the next rotation, which takes four days.
Google Workspace
In the Admin console, go to Apps, Google Workspace, Gmail, Authenticate email, choose the domain and click Generate New Record. Publish the TXT record at google._domainkey (the default selector is google), then click Start authentication. Google recommends a 2048-bit key where the DNS host accepts one, which dig shows as several quoted parts, and says DKIM can take up to 48 hours to start working.
DMARC: the _dmarc record
DMARC (RFC 9989) protects the From: address. A message passes when SPF or DKIM passes for a domain aligned with it: the same organizational domain in the default relaxed mode, or the identical domain with aspf=s or adkim=s.
p= | RFC 9989's meaning |
|---|---|
none | "no expression of preference"; with a rua address, monitoring mode |
quarantine | Failing mail is "suspicious" |
reject | Failures are "a clear indication that the use of the domain name is not valid" |
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com- Set up SPF and DKIM first; Google says to wait 48 hours before adding DMARC.
- Start at
p=none.ruaasks receivers for aggregate reports (RFC 9990); Google warns they can arrive in high volume. - When the reports show only your own services, move to
p=quarantine, thenp=reject. Microsoft's goal isp=rejecton every custom domain and subdomain, with the main domain last.
- Subdomains follow the main domain's policy unless
sp=(existing subdomains),np=(subdomains that do not exist) or a record of their own says otherwise. - Microsoft's and Google's example records still include
pct=, from RFC 7489. RFC 9989 removed it;t=yasks receivers to apply one level less. - Receivers decide: RFC 9989 says they "SHOULD NOT reject messages solely because of a published policy" of
reject. Microsoft 365, with Honor DMARC record policy when the message is detected as spoof on, putsquarantinefailures in Junk Email and rejectsrejectfailures with550 5.7.1.
What Gmail, Yahoo and Outlook.com require
| Provider and senders | Requirements | Since |
|---|---|---|
| Gmail, all senders | SPF or DKIM; spam rate below 0.3% | 1 February 2024 |
| Gmail, senders of close to 5,000 or more messages to personal Gmail accounts in 24 hours, permanently once reached | SPF and DKIM; DMARC at p=none or stricter; From: aligned with SPF or DKIM; one-click unsubscribe | February 2024; from November 2025 Google is "ramping up its enforcement", with rejections |
| Yahoo, all senders | SPF or DKIM; spam rate below 0.3% | February 2024 |
| Yahoo, bulk senders; Yahoo gives no volume threshold | SPF and DKIM; DMARC at p=none or stricter, and passing | February 2024 |
| Outlook.com, hotmail.com and live.com, domains sending more than 5,000 messages a day | SPF and DKIM pass; DMARC at p=none or stricter, aligned with SPF or DKIM | 5 May 2025; failures are rejected with 550; 5.7.515 Access denied |
Google says its requirements apply only to mail sent to personal Gmail accounts.
Domains that send no mail
A domain that never sends mail can still be forged. Publish three records:
| Type | Name | Value |
|---|---|---|
| TXT | The domain | v=spf1 -all |
| TXT | _dmarc | v=DMARC1; p=reject; |
| MX | The domain | Preference 0, mail server . |
- RFC 7208 gives
v=spf1 -allas the record for a domain that sends no mail, and Microsoft gives both TXT records for parked domains. Microsoft also says not to publish DKIM records for them, so no forged signature can validate. - The null MX (RFC 7505) makes delivery to the domain "fail immediately" and must be its only MX record; receivers may refuse mail from its addresses with
550 5.7.27.dig +short MXthen prints0 ..
DMARCbis is RFC 9989
The IETF published DMARC's revision, known as DMARCbis, in May 2026 as RFC 9989, a Proposed Standard that obsoletes RFC 7489 and RFC 9091. Reports moved to RFC 9990 (aggregate) and RFC 9991 (failure). The version tag stays v=DMARC1. Compared with RFC 7489, the pct, rf and ri tags are gone and t, np and psd are new, and receivers find the organizational domain by walking up the DNS tree, at most eight queries, instead of using a public suffix list.
Related guides and lookups
Sources
- IETF: RFC 7208, Sender Policy Framework (SPF)
- IETF: RFC 6376, DomainKeys Identified Mail (DKIM) Signatures
- IETF: RFC 9989, DMARC
- IETF: RFC 7489, DMARC, now obsoleted
- IETF: RFC 7505, a null MX record for domains that accept no mail
- Microsoft Learn: set up SPF for Microsoft 365
- Microsoft Learn: DKIM for your custom domain
- Microsoft Learn: set up DMARC in Microsoft 365
- Microsoft Tech Community: Outlook's requirements for high-volume senders
- Google Workspace Help: set up SPF
- Google Workspace Help: set up DKIM
- Google Workspace Help: set up DMARC
- Google Workspace Help: troubleshoot DKIM issues
- Gmail Help: email sender guidelines
- Gmail Help: email sender guidelines FAQ
- Yahoo Sender Hub: sender best practices
- Yahoo Sender Hub: FAQs
- Ubuntu manual: dig, 24.04
- Microsoft Learn: Resolve-DnsName
- Microsoft Learn: nslookup