Email security
SPF, DKIM and DMARC: stop others sending email in your name.
Anyone can send an email that claims to come from your domain. Three DNS records let receiving mail servers check whether it really did: SPF, DKIM and DMARC. This guide explains what each one does, in which order to set them up and how our own domain is set up.
Why it matters
Your domain can be used without your server.
A fake invoice or password reset that appears to come from your company needs no access to your website or mailbox. The sender simply puts your address in the From field. Whether the message lands in the inbox, in spam or nowhere depends on what your domain tells receiving servers.
In the November 2026 edition of our Croatian web index, 46% of the 4,500 measured domains had no DMARC record and another 38% had one that only monitors. Only 17% told receiving servers to quarantine or reject fake messages, and 7% had no SPF record at all.
The three records
What each record does.
01
SPF
A TXT record on the domain that lists the servers allowed to send its email, such as your mail provider and the tool that sends your newsletter. It ends with -all (reject the rest) or ~all (treat the rest as suspicious). A record that ends with +all allows everyone and protects nothing.
02
DKIM
Your mail provider signs each message with a private key and publishes the matching public key in DNS, under a selector such as zmail._domainkey. The receiving server checks the signature, so it knows the message was not changed on the way and was signed for your domain.
03
DMARC
A TXT record at _dmarc on your domain. It tells receiving servers what to do with a message that uses your domain in the From address but passes neither SPF nor DKIM for it: nothing (p=none), the spam folder (p=quarantine) or rejection (p=reject). It can also ask them to send you daily reports.
SPF and DKIM alone do not protect the address people see. SPF checks a hidden sender address, and a message can carry a valid DKIM signature from any domain. DMARC ties both to the From address, which is why it is the record that actually stops spoofing.
Order
Set them up in this order.
- List everything that sends email in your domain’s name: the mailbox provider, the website contact form, the online shop, invoicing software, the newsletter tool and the CRM.
- Publish one SPF record that includes all of them. Two SPF records on the same domain make both invalid, and the record must stay within ten DNS lookups.
- Turn on DKIM in each service that supports it and publish the keys it gives you.
- Publish DMARC with p=none and an address for reports. Read the reports for two to four weeks.
- When only your own services appear in the reports and they pass, move to p=quarantine and later to p=reject.
Website forms are the most common blind spot. If WordPress sends mail through the server’s own mail function, it usually passes neither SPF nor DKIM, and a strict DMARC policy will send your own enquiries to spam. Send them through your mail provider over SMTP with a login instead.
Domains without email
A domain that sends no email needs records too.
An unused or parked domain is an easy target, because nobody notices fake mail sent from it. Publish v=spf1 -all and a DMARC record with p=reject, so receiving servers reject anything that claims to come from it.
Our own domain
How hiperlink.digital is set up.
- SPF allows only our mail provider and ends with ~all.
- DKIM signs every message, including the ones from our website forms, which go out through the mail provider over SMTP with a login, not through the server’s mail function.
- DMARC started at p=none, with daily reports collected in Cloudflare. We move to p=quarantine only after the reports show that our own services are the only ones sending in our name.
- DNSSEC signs the DNS answers, so they cannot be forged on the way, and a CAA record lists the certificate authorities allowed to issue certificates for the domain. In the web index, only 1% of domains use DNSSEC and 2% have a CAA record.
Checking
How to check that it works.
- Send a message from each service to an outside mailbox, such as Gmail, open the original message and look for SPF, DKIM and DMARC: PASS.
- Read the DMARC reports: each row is a server that sent mail in your name, with its results.
- Check again whenever you add a tool that sends mail, such as a new shop or newsletter service.
These records live in the domain’s DNS, so whoever manages the DNS sets them up. Our guide to security headers covers the settings on the website itself.
See how your domain does.
The web index lookup shows missing SPF, DMARC, DNSSEC and CAA records for 4,500 Croatian websites, together with their scores in four other areas.
More guides
Keep reading.
Last updated:
Related services: Website security · Online store development