How to Set Up SPF, DKIM and DMARC for Your Domain
SPF, DKIM and DMARC are three DNS records that prove that email really comes from your domain. Together they make sure your email arrives in the inbox and that nobody can send mail on behalf of your domain. Gmail, Outlook and other major providers expect these records. Without them your email increasingly ends up in spam.
What is SPF?
With an SPF record you indicate which servers may send email on behalf of your domain. You add it as a TXT record on your domain name:
v=spf1 a mx ip4:JOUW-IP ~all - a and mx: the servers from the A and MX records of your domain may send mail.
- ip4: an extra IP address that may send mail, such as your VPS.
- ~all: all other servers are marked as suspicious.
Use only one SPF record per domain. If you also send mail via an external service, add it to the same record.
What is DKIM?
DKIM puts a digital signature on every outgoing email. The receiving server checks that signature with a public key in your DNS. If you use DirectAdmin, you enable DKIM per domain and DirectAdmin adds the record to the DNS automatically. On your own mail server you generate the key with OpenDKIM, for example.
What is DMARC?
DMARC determines what a receiving server does with email that fails the SPF or DKIM check. You add it as a TXT record on _dmarc.jedomein.nl:
v=DMARC1; p=none; rua=mailto:dmarc@jedomein.nl - p=none: report only. Start with this.
- p=quarantine: suspicious email goes to the spam folder.
- p=reject: suspicious email is rejected.
Review the reports for a few weeks and then tighten the policy step by step.
Check your records
With dig you check whether the records are correctly in the DNS:
dig TXT jedomein.nl +short
dig TXT _dmarc.jedomein.nl +short Related articles
Web hosting with email and DirectAdmin
Fast SSD web hosting with unlimited email, free SSL and DirectAdmin, in the data centre in Amsterdam.