Guide / 22 November 2026
SPF, DKIM and DMARC explained: stop fake email sent in your company's name
SPF says which servers may send email for your domain, DKIM signs each message, and DMARC tells receiving servers what to do when those checks fail. Set up together, they make it much harder for someone else to send fake invoices from your address.
Publish one SPF record that lists everyone who sends email for the company, turn on DKIM with your email provider and with every app that sends on your behalf, then add DMARC with p=none and reports. Once the reports show your legitimate mail passing, move to quarantine and finally to reject.
Why fake invoices "from your company" work
Email was designed without any check on who the sender really is. Anyone can put an address such as accounts@company.com in the "From" field. If the domain has no correctly configured SPF, DKIM and DMARC, the receiving server has no way to tell the message is forged and will usually deliver it to the inbox.
That is where messages that seem to come from your company to customers or partners come from: an invoice with a changed bank account, an urgent payment request, a link to a fake sign-in page. The recipient sees your name and trusts it. The three records below do not stop every kind of phishing, but they do stop the exact use of your company's domain.
SPF: who may send
SPF (Sender Policy Framework) is a TXT record in your domain's DNS. It lists the servers and services that send legitimate email for the company. The receiving server compares the technical sender address against that list.
company.com. TXT "v=spf1 include:spf.email-provider.example include:mail.invoicing-app.example ip4:203.0.113.10 -all"
- include: adds the list published by a provider (your email service, invoicing app, newsletter platform).
- ip4: / ip6: adds a specific address, for example your own server that sends notifications.
- -all at the end means "no other server may send". The softer ~all (softfail) is often used during a transition.
DKIM: a signature on every message
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to each email. The sending server signs with a private key, and the public key sits in DNS under a name called a selector. If the message was altered in transit or was not signed by an authorised server, the check fails.
selector1._domainkey.company.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq...PUBLIC_KEY...IDAQAB"
Do not type the key by hand: your email provider or app generates it and tells you exactly which record to publish. Use 2048-bit keys where the provider offers them. Each service that sends for you normally has its own selector.
DMARC: what happens to messages that fail
DMARC ties SPF and DKIM to the address people actually see in the "From" field. A message passes DMARC if it passes SPF or DKIM for a domain aligned with the "From" domain. DMARC also does two more things: it states what to do with messages that fail, and it sends you reports on who is sending email in your domain's name.
_dmarc.company.com. TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@company.com"
- p=none: only observe and report, block nothing.
- p=quarantine: failing messages usually go to spam.
- p=reject: failing messages are refused.
- rua=: the address that receives daily aggregate reports in XML. A DMARC report reader makes them easy to follow.
- sp=: a policy for subdomains, if you want one different from the main domain.
The safe path to p=reject
Jump straight to reject and you risk blocking your own company's mail: invoices sent by the invoicing app, the newsletter, website notifications. So work in steps:
- p=none with rua. Leave it for a few weeks and read the reports. They show every server sending email in your domain's name.
- Fix legitimate senders. For each service in the reports that is yours, add it to SPF and turn on DKIM.
- p=quarantine. When legitimate mail passes consistently, change the policy. You can use pct= to apply it gradually, for example pct=25.
- p=reject. After another quiet period, move to the final policy. Keep reading the reports: new services keep appearing.
_dmarc.company.com. TXT "v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc-reports@company.com"
_dmarc.company.com. TXT "v=DMARC1; p=reject; rua=mailto:dmarc-reports@company.com"
The second line is the end state. Keep only one DMARC record in DNS at any time.
Common mistakes
| Mistake | What happens | What to do |
|---|---|---|
| Two SPF records on the same domain | SPF becomes invalid and protects nothing | Merge everything into one record starting with v=spf1 |
| +all at the end | Any server in the world may send | Use -all or, for a while, ~all |
| More than 10 DNS lookups in SPF | The check errors (permerror) and SPF fails | Count include, a, mx, ptr, exists and redirect, including those inside each include; remove what you no longer use |
| Forgotten senders | Invoices or the newsletter land in spam once you move to quarantine | List the invoicing app, CRM, newsletter platform, web shop and the printer that scans to email |
| Subdomains with no records | Attackers send from addresses such as payments.company.com | For subdomains that send no email, publish an SPF record that authorises no one and a strict DMARC policy |
payments.company.com. TXT "v=spf1 -all"
_dmarc.payments.company.com. TXT "v=DMARC1; p=reject"
If no subdomain sends email at all, you can instead set sp=reject in the main domain's DMARC record. The same applies to domains you hold only to protect your name: if they send no email, publish "v=spf1 -all" and DMARC with p=reject.
Microsoft 365 and Google Workspace
Both services publish SPF instructions and support DKIM, but DKIM is not always switched on automatically for your own domain. Go to the admin console, find the email authentication section, generate DKIM keys for the company domain, publish the records it shows in DNS, then turn signing on. No provider sets up DMARC for you: you add it yourself in DNS, with whoever manages your domain.
Check in a few seconds
The free website check reads your domain's public SPF, DMARC and DKIM records and tells you in plain words what is missing. It needs no account and does not keep the domain you check. It is a good first step before you change anything in DNS.
People are the last check
SPF, DKIM and DMARC protect your own domain, but they do not stop a message sent from a lookalike domain such as cornpany.example, or from a free address using the managing director's name. A few simple rules for staff help a great deal:
- Any change to a supplier's bank account is confirmed by phone, on a number you already know, not the one in the email.
- Urgent payment requests, even ones that seem to come from management, are checked on another channel.
- Sign-in pages are opened by typing the address, not from a link in an email.
- Email accounts use two-step sign-in.
When to ask for help
If the DMARC reports show servers you do not recognise, if SPF has gone over the lookup limit, or if you are not sure who sends email in the company's name, an outside check is worth it. The security audit covers email and domain protection, plus forgotten subdomains and staff accounts that have appeared in data leaks. Monthly monitoring tells you when something changes, for example a deleted record or a certificate about to expire.
Last updated: 22 November 2026.