MailSpecto
SPF, DKIM and DMARC 2 min read

SPF, DKIM and DMARC – what they are and how to set them up

A hands-on implementation guide for IT administrators and marketing teams. Learn the role DNS records play in email authentication and the most common configuration mistakes.

MailSpecto Engineering Team

Mail infrastructure and deliverability

Sending server IP + DKIM signature Checks against DNS (TXT) records SPF: may this IP send? DKIM: is the signature valid? DMARC: alignment + action Recipient mailbox Delivered (PASS)

1. Why authentication matters

SMTP was designed without any built-in way to verify the sender. Without extra DNS records, almost any server can send a message with your domain in the From: field. Mailbox providers (such as Gmail, Microsoft 365 and other large providers) now require a correct SPF, DKIM and DMARC setup to tell legitimate campaigns apart from phishing.

2. SPF – the list of authorised servers

SPF (Sender Policy Framework) is a TXT record published in your domain's DNS zone that lists the IP addresses or domains allowed to send mail on your behalf.

Sample SPF TXT record

v=spf1 ip4:198.51.100.12 include:_spf.your-provider.com -all

Watch the 10 DNS lookup limit

The SPF specification allows at most 10 mechanisms that need DNS lookups (include:, a, mx, exists:, redirect=). Going over the limit ends the check with permerror, and the message is treated as if it failed SPF.

3. DKIM – a cryptographic signature

DKIM (DomainKeys Identified Mail) adds a digital signature to the message header, generated with the sending server's private key. The receiving server fetches the public key from DNS (at selector._domainkey.yourdomain.com) and checks that the content was not modified in transit.

ms2026._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A..."

4. DMARC – policy and reporting

DMARC ties SPF and DKIM together into a single policy. It checks domain alignment and tells the receiving server what to do with a message that fails the checks, and where to send aggregate reports (rua).

_dmarc.example.com. IN TXT "v=DMARC1; p=quarantine; pct=100; rua=mailto:[email protected]"

5. DMARC policies compared

PolicyWhat the receiving server doesWhen to use it
p=noneNothing is blocked; reports are collectedThe first 2–4 weeks after rollout
p=quarantineSuspicious messages go to spamOnce every sending source has been verified
p=rejectUnauthorised email is rejected outrightThe target protection against spoofing

6. Rollout checklist

  1. Find out which systems (CRM, online store, newsletter) send mail from your domain.
  2. Publish one consistent SPF record (never two separate SPF TXT records).
  3. Enable DKIM signing with a 2048-bit RSA key at every provider.
  4. Start with p=none and move gradually to p=quarantine or p=reject.

Keep your contact list clean

Verify email addresses before you send, and explore our upcoming SPF/DKIM/DMARC diagnostics module.

Try MailSpecto

MailSpecto Engineering Team

We build tools for email address verification, deliverability monitoring and mail infrastructure security diagnostics for companies in Poland and Europe.

Related articles

SPF, DKIM and DMARC

DMARC reports – how to read them and move from p=none to p=reject

How to read DMARC aggregate reports (rua) and move step by step from p=none to p=quarantine and p=reject.

Read article →
SPF, DKIM and DMARC

Multiple SPF or DMARC records on one domain – why it breaks and how to merge them

Why two SPF records or two DMARC records break email authentication, how to merge them, and how to list several DMARC report addresses in one record.

Read article →
SPF, DKIM and DMARC

No DMARC record found – what a missing DMARC record means and how to add one

What "No DMARC record found" means, exactly where to add the _dmarc record, a safe starter record, and the most common DNS panel mistakes.

Read article →