ENHEIT

payless.host

SPF, DKIM and DMARC: keeping your email out of spam

Updated Nov 22, 2026

Set an SPF record that names every server allowed to send for your domain

SPF tells receiving mail servers which IP addresses are authorised to send email on behalf of your domain. Without it, anyone can claim to send from your address, and most spam filters will assume the worst. Add a TXT record to your DNS with all legitimate sending sources — your web host's mail server, any third-party email service, your CRM. Miss one and legitimate mail from that source gets blocked.

Keep your SPF record under ten DNS lookups

SPF has a hard limit: ten DNS lookups per record. Go over and the record fails validation, which means your mail fails too. Every "include:" statement counts as a lookup, and some services nest several more inside. If you use multiple email tools, you will hit this limit faster than you expect. The fix is to flatten the record by replacing includes with the actual IP addresses they resolve to, though you then lose automatic updates when a service changes its infrastructure.

Add a DKIM signature so mail cannot be altered in transit

DKIM attaches a cryptographic signature to every outgoing message, proving it left your server unmodified. The sending server signs with a private key; the receiving server checks against a public key published in your DNS. Most hosting control panels generate the keys for you. Namecheap includes DKIM setup in its Private Email service, which starts free for one month then costs 1.24 USD monthly. Without DKIM, there is no way to prove a message was not tampered with, and filters treat it accordingly.

Publish a DMARC policy that tells receivers what to do with failures

DMARC ties SPF and DKIM together and instructs receiving servers how to handle mail that fails either check. Set it to "none" at first to collect reports without affecting delivery, then move to "quarantine" or "reject" once you are certain legitimate mail passes. A DMARC record is another DNS TXT entry, and it includes an email address where you receive daily XML reports showing who is sending mail claiming to be you. Ignore this and you will never know your authentication is broken until customers stop receiving invoices.

Start with monitoring mode and read the reports before enforcing

A DMARC policy set to "reject" will silently discard every message that fails authentication. If your SPF record is incomplete or a mailing service is not signing with DKIM, that legitimate mail vanishes. Set the policy to "p=none" first and collect a week of reports. They will show every source sending as your domain and whether it passed or failed. Only move to "quarantine" or "reject" after you have fixed every failure that matters.

Align the domain in the From header with the domain that passes SPF or DKIM

DMARC requires alignment: the domain in the visible From address must match the domain that passes SPF or DKIM. If your mail is sent through a third-party service that uses its own domain in the Return-Path, SPF will pass for their domain but not yours, and DMARC will fail unless DKIM is aligned instead. Most email platforms offer a way to align one or both; find it in their SPF and DKIM setup documentation. Misalignment is the most common reason DMARC fails even when SPF and DKIM both pass.

Check your records with a DNS lookup tool after every change

DNS changes propagate slowly and typos are invisible until mail starts bouncing. After publishing or editing an SPF, DKIM or DMARC record, query it directly with a tool like dig or an online DNS checker. An SPF record with a syntax error is treated as though no record exists. A DKIM key with one wrong character fails every signature. Test by sending mail to a Gmail address and examining the headers for authentication results before assuming everything works.

The providers in this article