Skip to content
HOSTIGAN
Email

What are SPF, DKIM and DMARC? Protect your domain's email

SPF, DKIM and DMARC prove that mail from your domain is genuine. Learn what each record does, how to set them up in cPanel and how to move DMARC to reject safely.

Intermediate 5 min read Updated November 24, 2026

Anyone can type your address into the "From" field of an email. The protocol that moves mail around the internet, SMTP, was designed in a more trusting era and does not check who the sender really is. SPF, DKIM and DMARC fix that. They are three DNS records that let receiving servers verify that a message claiming to come from your domain actually did. Gmail, Yahoo and Microsoft now expect them, and without them your mail is far more likely to land in spam. This guide explains each one, shows you what the records look like, and walks you through a safe rollout.

How the three work together

When a message arrives, the receiving server runs through a short checklist:

  1. SPF — was it sent from a server your domain has authorised?
  2. DKIM — does it carry a valid cryptographic signature from your domain?
  3. DMARC — does at least one of those checks pass and match the domain in the visible From address? If not, what does the domain owner want done with it?

Based on the answers, the server delivers the message, sends it to spam or rejects it. All three records are ordinary DNS entries — if you're new to DNS, read what DNS is first.

SPF: who may send for your domain

SPF (Sender Policy Framework) is a TXT record on your domain that lists the servers allowed to send mail as you.

example.com.  3600  IN  TXT  "v=spf1 a mx include:_spf.newsletter-service.example ~all"

The parts you will meet most often:

MechanismMeaning
aThe server in the domain's A record may send
mxThe servers in the domain's MX records may send
ip4:203.0.113.25 / ip6:A specific address or range may send
include:Also trust the SPF record of another service, such as a newsletter tool
~allEverything else is suspicious (softfail)
-allEverything else should fail (hard fail)

Two rules trip people up:

  • One record only. If your newsletter tool tells you to "add an SPF record", add its include: to your existing record instead of creating a second one.
  • Ten DNS lookups at most. Every include, a and mx costs lookups. Exceed ten and SPF returns a permanent error. Remove services you no longer use.

DKIM: a signature on every message

DKIM (DomainKeys Identified Mail) signs each outgoing message with a private key kept on the mail server. The matching public key is published in DNS under a selector, so the receiver can check the signature and confirm the message wasn't altered on the way.

default._domainkey.example.com.  3600  IN  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."

Here default is the selector — cPanel typically uses that name. Each service that sends mail for you, such as a newsletter platform or an invoicing system, gets its own selector and its own DKIM record. Unlike SPF, having several DKIM records is normal.

DMARC: the policy that ties it together

DMARC is a TXT record at _dmarc.yourdomain. It adds two things: alignment (SPF or DKIM must pass for the same domain the reader sees in From) and a policy telling receivers what to do with mail that fails.

_dmarc.example.com.  3600  IN  TXT  "v=DMARC1; p=none; rua=mailto:dmarc@example.com; fo=1"
TagWhat it does
pPolicy: none (only report), quarantine (spam folder) or reject (refuse)
ruaWhere to send daily aggregate reports
pctApply the policy to only a percentage of failing mail
spSeparate policy for subdomains
adkim / aspfAlignment mode: r relaxed (default) or s strict
foWhen to generate failure reports

The DMARC standard is described in RFC 7489.

Rolling out DMARC safely

Jumping straight to p=reject is the quickest way to block your own invoices. Go in stages:

  1. Monitor with p=none and a rua address. Read the reports for a few weeks — a free DMARC report viewer makes the XML readable.
  2. Fix every legitimate sender that fails: add it to SPF, set up its DKIM, or stop it using your domain.
  3. Quarantine with p=quarantine, optionally starting with pct=25 and increasing.
  4. Reject with p=reject once the reports stay clean.

Tip: Domains you never send mail from should still get records, so nobody can abuse them: v=spf1 -all and a DMARC record with p=reject.

Setting it up in cPanel

cPanel has a tool that does most of the work. Go to Email → Email Deliverability. For each domain it shows whether SPF, DKIM and reverse DNS look right.

  • If your DNS is hosted on the same server, click Repair and cPanel installs the suggested SPF and DKIM records.
  • If DNS is managed elsewhere, cPanel shows the records it expects. Copy them to your DNS provider — and merge the SPF suggestion into your existing record rather than adding a second one.
  • DMARC is not created automatically. Add it yourself as a TXT record named _dmarc in Domains → Zone Editor or at your DNS provider.

Testing your records

Check what the world sees with dig on Linux or macOS:

dig +short TXT example.com
dig +short TXT default._domainkey.example.com
dig +short TXT _dmarc.example.com

On Windows, use Resolve-DnsName:

Resolve-DnsName -Type TXT _dmarc.example.com

Then send a message to a Gmail address, open it, and choose Show original. You want to see PASS next to SPF, DKIM and DMARC. In any client you can also read the Authentication-Results header directly.

What the big mailbox providers expect

Since 2024, Gmail and Yahoo have required every sender to authenticate with SPF or DKIM, to send from servers with valid reverse DNS, and to use TLS. Bulk senders — Google draws the line at around 5,000 messages a day to Gmail addresses — must have SPF, DKIM and DMARC in place, keep their spam complaint rate low, and offer one-click unsubscribe in marketing mail. Microsoft has introduced similar rules for Outlook.com. Google's email sender guidelines list the current requirements. Even if you only send a handful of messages a day, meeting the bulk-sender bar costs nothing and keeps you on the safe side.

Common mistakes

  • Two SPF records after adding a new service. Merge them.
  • The website sends mail from another server that isn't in SPF, for example a contact form on a different host.
  • DKIM never switched on at a newsletter service, so only SPF is checked — and SPF alone often fails alignment.
  • Jumping to p=reject before reading a single report.
  • DMARC reports sent to an address nobody reads.

In short

SPF lists who may send for your domain, DKIM signs every message, and DMARC checks that the two match the visible sender and tells receivers what to do when they don't. Set up SPF and DKIM with cPanel's Email Deliverability tool, add DMARC with p=none, read the reports and tighten the policy step by step. If mail still ends up in junk, continue with why emails go to spam.

Email authentication with Hostigan

Mailboxes on Hostigan email hosting and cPanel web hosting can be protected with SPF, DKIM and DMARC like any standard mail server. If you're unsure which records your domain needs, ask our support team and include the domain name.

Frequently asked questions

Start with ~all (softfail) while you check that every legitimate sender is listed. Once DMARC reports show nothing missing, -all (fail) gives a clearer signal, although with DMARC in place the difference is small.

Next in “Professional email on your domain” · 5 of 5Why do my emails go to spam? How to find and fix the cause