Why it matters
Anyone can put your address in the From line of an email. Without protection, spammers and phishers send mail in your name, receivers cannot tell the difference, and your real mail ends up in spam. Three DNS records fix this: SPF, DKIM and DMARC.
The three records
- SPF lists the servers allowed to send mail for your domain. Publish a single record that does not allow everyone (
+all) and needs at most 10 DNS lookups. Above that limit, receivers treat it as invalid. - DKIM signs your mail, so receivers can check it was not altered and really came from you. Use keys of at least 2048 bits.
- DMARC tells receivers what to do with mail that fails SPF and DKIM, and where to send reports.
Set them up
- SPF. Add a TXT record with your email provider's include, such as
v=spf1 include:_spf.google.com -all. If you have several providers, merge them into one record, because two SPF records are invalid. - DKIM. Turn it on in your email provider and publish the key it gives you at the selector it names.
- DMARC. Start by monitoring. Add a TXT record at
_dmarc.yourdomain:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain
- Read the reports for a few weeks. When legitimate mail passes, move to
p=quarantine, then top=reject. A policy ofp=noneonly watches, and apctbelow 100 protects part of your mail only.
Domains that send no email
A domain you never send mail from still needs protection, or spammers can use it freely. Publish v=spf1 -all and a DMARC policy of p=reject.
Keep it in place
Records break quietly: a provider change, a forgotten include, a lookup limit crossed after adding a tool. The email authentication check reads your records once a day and fails on several SPF records, an SPF that allows anyone or one over the lookup limit. It warns about a missing record, a DMARC policy of none or below 100%, and a weak DKIM key. Set your DKIM selector on the monitor so a missing key is reported too.