Mail bouncing or landing in spam even though your provider's dashboard shows green ticks? These are the exact dig commands to check every part of your sending setup yourself, with what a good answer looks like. Nothing to install on macOS or Linux, and no third-party scanner.
A common and confusing failure: SPF and DKIM both "pass", but neither aligns with your From: domain, so DMARC still fails. Section D shows how to spot it in one header line.
Replace example.com with your sending domain. dig ships with macOS and most Linux distributions (bind-utils / dnsutils). On Windows, use the nslookup form or install BIND tools.
Tip: add @1.1.1.1 or @8.8.8.8 to query a public resolver directly and avoid a stale local cache, e.g. dig @1.1.1.1 +short TXT example.com.
A. SPF
| Check | Command | What to look for |
|---|---|---|
| A1, A3, A6 | dig +short TXT example.com | Exactly one string starting v=spf1. Two of them is a permerror. |
| A2 | dig +short TXT _spf.provider.com (repeat for each include:) | Count every include, a, mx, ptr, exists, redirect, including the ones inside each include. Total must be ≤ 10. |
| A4, A5 | same as A1 | Every platform that sends for you is listed; record ends in ~all or -all, never +all. |
nslookup -type=TXT example.com
B. DKIM
| Check | Command | What to look for |
|---|---|---|
| B1, B2 | dig +short TXT selector._domainkey.example.com | v=DKIM1; k=rsa; p=MIIB.... If your platform uses a CNAME, run dig +short CNAME selector._domainkey.example.com and then query the target. |
| B3 | same as B1 | A 2048-bit RSA key has a p= value of roughly 390+ characters; 1024-bit is about 215. |
| B4 | View the headers of a real sent message ("Show original" in Gmail) | DKIM-Signature: ... d=example.com matches your From: domain. |
Finding the selector: open the headers of a message you sent and read s= in the DKIM-Signature line. Common selectors include google (Google Workspace), selector1/selector2 (Microsoft 365), s1/s2 (SendGrid) and k1/k2/k3 (Mailchimp); your platform's domain-authentication screen shows the exact one.
C. DMARC
| Check | Command | What to look for |
|---|---|---|
| C1, C2, C3, C5 | dig +short TXT _dmarc.example.com | One record starting v=DMARC1, a deliberate p= (none, quarantine, reject) and a rua=mailto: address someone reads. |
| C3 (external rua) | dig +short TXT example.com._report._dmarc.reports.vendor.com | If rua points to another domain, that domain must publish this authorization record. |
D. Alignment
Open the headers of a real message (not a test from the platform UI) and read the Authentication-Results line:
-
spf=pass smtp.mailfrom=bounce.example.com→ D1 passes if that domain is (a subdomain of) yourFrom:domain. -
dkim=pass header.d=example.com→ D2 passes ifd=matches yourFrom:domain. -
dmarc=pass→ D3 passes.
E. Return-path, MX, bounces
| Check | Command | What to look for |
|---|---|---|
| E1, E2 | dig +short CNAME bounce.example.com (or the return-path host your platform gives you) | Resolves to your platform's bounce host. |
| E3 | dig +short MX example.com | Only the mail hosts you expect, with sensible priorities. |
F. Dedicated IPs
| Check | Command | What to look for |
|---|---|---|
| F1 | dig +short -x 203.0.113.10 then dig +short A <returned-hostname> | The PTR hostname is under your domain and resolves back to the same IP. |
G. Transport security
| Check | Command | What to look for |
|---|---|---|
| G1, G2 | openssl s_client -starttls smtp -connect mx.example.com:25 -servername mx.example.com </dev/null | The handshake completes and Verify return code: 0 (ok). Port 25 is often blocked on home connections; run it from a server if it hangs. |
| G3 | dig +short TXT _mta-sts.example.com and curl https://mta-sts.example.com/.well-known/mta-sts.txt | v=STSv1; id=... and a policy file with mode: and max_age:. |
| G4 | dig +short TXT _smtp._tls.example.com | v=TLSRPTv1; rua=mailto:... |
H. Tracking domains
| Check | Command | What to look for |
|---|---|---|
| H1, H3 | dig +short CNAME click.example.com (your tracking host) | Points to your platform's tracking host, not your main website. |
| H2 | dig +short TXT click.example.com | If the subdomain also sends mail, it needs its own SPF; DKIM/DMARC as needed. |
The full preflight
This command reference is free and stays free: smtp-dns-deliverability-preflight-card-3230ab.gitlab.io.
If you want the whole thing in one kit, I packaged it as the Deliverability Preflight Card: a 39-check checklist with pass criteria and severity, a printable two-page card, a red/amber/green scorecard and a fix-plan template. It's $19: https://recasenpai.gumroad.com/l/vpzska


