Email was designed without any proof of who sent a message. Four DNS-based mechanisms fix that today. Each checks something different - and only together do they stop someone from sending mail that looks like it came from your domain.
SPF - which servers may send
A TXT record on your domain lists the IP addresses and services allowed to send mail for it. The receiver compares the connecting server's IP with that list.
SPF checks the envelope sender (Return-Path), not the visible From address, and it fails when mail is forwarded.
example.com. TXT "v=spf1 include:_spf.google.com ip4:203.0.113.10 ~all"
More in our SPF guide · check your SPF
DKIM - a signature the message carries
The sending server signs each message with a private key and adds a DKIM-Signature header. The header names the signing domain (d=) and a selector (s=);
receivers fetch the public key from selector._domainkey.domain and verify that the signed headers and body were not changed. Unlike SPF, DKIM survives forwarding.
s1._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh..."
- Use 2048-bit RSA keys (1024-bit keys are considered weak).
- Every service that sends as your domain should sign with your domain (d=example.com), not its own - otherwise DKIM won't align for DMARC.
- Rotate keys occasionally by publishing a new selector, switching the signer, then removing the old key.
Check a DKIM key - leave the selector empty and we try the common ones.
DMARC - ties it to the From address
DMARC is what actually protects the address people see. A message passes DMARC when SPF or DKIM passes and is aligned: the domain they authenticated matches the domain in the From: header
(relaxed alignment allows subdomains, strict requires an exact match). The DMARC record then tells receivers what to do with mail that fails, and where to send reports.
_dmarc.example.com. TXT "v=DMARC1; p=quarantine; rua=mailto:[email protected]"
p=none- only monitor; failing mail is delivered. Start here and read the aggregate reports (rua) to find all your legitimate senders.p=quarantine- failing mail goes to spam.p=reject- failing mail is refused. The goal for every domain.
Since 2024, Gmail, Yahoo and Microsoft require a DMARC record (at least p=none) from anyone sending larger volumes. Check your DMARC
PTR - reverse DNS of the sending server
A PTR record maps the mail server's IP address back to a host name, e.g. 203.0.113.10 → mail.example.com. Receivers expect that name to resolve back to the same IP
(forward-confirmed reverse DNS) and ideally to match the name the server announces in its SMTP HELO. Servers without a valid PTR are often rejected outright.
The PTR record is not in your domain's DNS - it is set by whoever owns the IP range, usually your hosting or internet provider. Check a PTR record
Putting it together
- Publish one SPF record that lists all your sending services.
- Turn on DKIM signing with your own domain in every service.
- Add DMARC with
p=noneand a report address, then move to quarantine and reject. - Make sure your own mail servers have a matching PTR record.
- Send a test with our Email Deliverability Test to see the result a real receiver gets.