SPF, DKIM and DMARC are three DNS records that prove to receiving servers that mail sent in your domain's name really comes from you. Set up together and correctly, they make your mail less likely to land in spam and protect your domain against spoofing.
What each record does
SPF (Sender Policy Framework)
A TXT record listing which servers may send mail for your domain. The receiving server checks whether a message came from one of them.
DKIM (DomainKeys Identified Mail)
The sending server signs every message with a private key. The public key is published in DNS, and the recipient verifies the signature to confirm the message wasn't altered in transit.
DMARC
Tells receiving servers what to do with mail that fails SPF and DKIM (monitor, send to spam, reject) and, if you like, sends you reports.
Before you start
- Know where your domain's DNS is managed. If your nameservers point to Voligen, DNS is managed in the Client Area or cPanel; if they point elsewhere, add the records there.
- List every service that sends mail for your domain: your e-mail service (UltraMail or cPanel hosting), your website, newsletter tool, CRM and so on.
- The SPF and DKIM values for your service: for UltraMail in the activation e-mail or the admin interface, for cPanel hosting on the Email Deliverability page.
Step-by-step setup
- Add the SPF record. In DNS management, add a TXT record at the domain root (
@). The value is the SPF string your e-mail service gives you. The general shape is:
Type: TXT Name: @
v=spf1 a mx include:spf.provider-example.com ~all
The include: part is only an example; take the value for your service from the activation e-mail or the panel. If several services send for you, merge them all into one SPF record.
- Enable DKIM. On cPanel hosting, the Email Deliverability page usually sets DKIM up automatically; if your DNS is elsewhere, copy the record it shows and add it there. On UltraMail, generate the key in the DKIM (mail signing) section of the domain administrator settings; the interface shows the record to add:
Type: TXT Name: selector._domainkey
v=DKIM1; k=rsa; p=MIIBIjANBgkqh...(the long key from the panel)
- Add the DMARC record. Start with a monitor-only policy:
Type: TXT Name: _dmarc
v=DMARC1; p=none; rua=mailto:dmarc@example.com
- Verify. Wait for DNS to propagate, then look in the headers of a message you sent to another mailbox for
spf=pass,dkim=passanddmarc=pass. Online SPF/DKIM/DMARC checkers work too.
A domain can have only one SPF record. Adding a second v=spf1 record makes both invalid. When you add a new sender, edit the existing record.
Tightening the DMARC policy
Collect reports with p=none for a few weeks. Once every legitimate sender passes SPF and DKIM, move to p=quarantine (send to spam) and then, if you wish, p=reject. Starting straight with reject can make mail from a forgotten sender disappear.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
spf=permerror | Two SPF records, or a typo | Merge into one SPF record and check the syntax. |
| SPF "too many DNS lookups" | The 10-lookup limit is exceeded | Remove include entries you no longer use. |
dkim=fail | Key copied incompletely, or wrong selector name | Copy the record from the panel again and check the name field. |
| Website form e-mails land in spam | The web server isn't in SPF | Send forms over SMTP, or add the web server to SPF. |
Frequently asked questions
Are these records mandatory?
Not technically, but large mailbox providers are increasingly strict with unauthenticated mail. For business sending we recommend all three.
How long until the records take effect?
Usually anywhere from a few minutes to a few hours. It can take longer if the old record had a long TTL.
How do I read DMARC reports?
Reports arrive as XML. Free DMARC report analysers turn them into readable tables.
For delivery problems, also see "Why do my e-mails land in spam?". Our business e-mail plans are on the Business E-mail page; for DNS help, open a support ticket from the Client Area.