The SMTP protocol, the foundation of email since 1982, has no native authentication mechanism. Any mail server in the world can send a message claiming to be from '@yourdomain.com'. Without proper DNS records, it is impossible to distinguish it from a legitimate one. SPF, DKIM and DMARC are the three DNS records that solve this problem, and they are required by Gmail, Outlook and Yahoo to ensure email delivery.
SPF: Define Which Servers Can Send on Your Behalf
The SPF (Sender Policy Framework) record is a TXT record in your DNS that lists the servers authorized to send email from your domain. When a destination server receives a message from @yourdomain.com, it queries DNS to verify whether the sender is authorized. If not, the message may be marked as spam or rejected.
DKIM: Digital Signature of Every Sent Email
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every outgoing email using a private key stored on the server. The destination server verifies that signature with the public key published in your DNS. A valid DKIM email guarantees it was not altered in transit. Your email provider (Google Workspace, Microsoft 365, SendGrid) generates the key pair and gives you the TXT record to add to your DNS.
DMARC: The Policy Connecting SPF and DKIM
DMARC (Domain-based Message Authentication, Reporting & Conformance) defines what to do with emails that fail SPF or DKIM verification, and requests daily reports from email providers so you can monitor your domain usage.
Step-by-Step Implementation
- Step 1 — SPF: identify every service that sends email on your behalf (CRM, newsletter platform, billing system, own server) and add them to the SPF record.
- Step 2 — DKIM: enable DKIM in your primary email provider and publish the public key in your DNS.
- Step 3 — DMARC with p=none: add the DMARC record with monitoring-only policy and enable reports.
- Step 4 — Analysis: review reports for 2-4 weeks to identify legitimate services not passing authentication.
- Step 5 — Enforcement: when confident all legitimate senders pass SPF and DKIM, switch to p=quarantine and then p=reject.
Common Mistakes
- More than one SPF record for the same domain: the standard only allows one. Merge all includes into a single TXT record.
- More than 10 DNS lookups in SPF (too many lookups): the limit is 10. Exceeding it invalidates SPF entirely.
- DMARC without active SPF and DKIM: DMARC alone has no effect without the other two mechanisms.
- Going directly to p=reject without monitoring: you risk blocking legitimate emails from services not yet in SPF.
DomainScored verifies SPF, DKIM and DMARC in the DNS module and detects if any is missing, if SPF exceeds the lookup limit, or if the DMARC policy is too permissive. The report includes the exact content of each record and recommended fixes.