What Are SPF, DKIM and DMARC? Preventing Email Spoofing
When email was designed in the 1980s, it had no way of verifying who was who. Even today, anyone can type accounts@yourcompany.com into the "From" field of an email. SPF, DKIM and DMARC are three DNS records developed to close this gap. Used together, they make your domain harder to impersonate and reduce the chance of your email landing in spam.
Why does it matter?
- Spoofing: without these records, attackers can send your customers and suppliers fake invoices and phishing emails that appear to come from your domain.
- Deliverability: since 2024, Google and Yahoo have required SPF, DKIM and DMARC from domains that send bulk email. Other providers also treat email without these records with more suspicion.
SPF: who may send on your behalf?
SPF (Sender Policy Framework) is a TXT record listing the servers authorised to send email for your domain. The receiving server checks whether an incoming email came from a server on that list.
v=spf1 include:spf.protection.outlook.com include:_spf.yourcompany.com -all
- Include every service that sends email: corporate email, newsletter tool, CRM, invoicing system, your website's contact form.
- The record can contain at most 10 DNS lookups. Adding too many
includeentries makes it invalid. - End it with
-all(strict) or~all(soft).+allallows everyone and makes the record meaningless.
DKIM: was the email altered in transit?
DKIM (DomainKeys Identified Mail) adds a digital signature to every email sent. The receiving server verifies the signature with a public key published in DNS. If the signature is valid, the email really came from an authorised server for your domain and was not modified on the way.
You enable DKIM in your email provider's admin panel, which gives you the record to add to DNS. It needs to be enabled separately for each service that sends email.
DMARC: what happens when the checks fail?
SPF and DKIM perform the checks, but they do not say what to do with an email that fails. DMARC (Domain-based Message Authentication, Reporting and Conformance) sets that policy and has reports sent to you.
_dmarc.yourcompany.com TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourcompany.com"
The policy (p=) can take three values:
none: do nothing, just report. For getting started.quarantine: send failing emails to the spam folder.reject: reject failing emails. This is the goal.
A safe rollout plan
- Take inventory. List every service that sends email for your domain.
- Set up SPF and DKIM for each service.
- Start DMARC with
p=noneand review the reports for a few weeks. They reveal sending services you had forgotten about. - Fix the gaps and move to
p=quarantine. - If all is well, move to
p=reject.
Starting straight with reject can stop your invoices or newsletter from reaching customers. Free DMARC analysis services can help you read the reports.
Forgotten domains
Domains you never send email from can be spoofed too. Publish a v=spf1 -all SPF record and a p=reject DMARC record for them, stating that no server may send email for that domain.
Do these records solve everything?
No. DMARC prevents exact impersonation of your domain, but it does not block email from a lookalike domain such as yourcompany-uk.com. Nor does it stop email from a genuine account that has been compromised. That is why employees also need to recognise phishing emails and accounts need to be well protected.
We can measure how resilient your email infrastructure and employees are against phishing with a social engineering test, and review your email security settings as part of audit preparation with our compliance and audit support service.