Skip to content

Domains and DNSEmail authentication

Email authentication: SPF, DKIM and DMARC

SPF, DKIM, and DMARC are DNS records that prove your email really comes from you. Without them, more of your email lands in spam or gets rejected.

Last updated

SPF (Sender Policy Framework)

SPF lists the servers allowed to send email for your domain. When a server gets an email that claims to be from your domain, it looks up your SPF record. If the sending server is not on the list, the email fails SPF.

TypeHostValue
TXT@v=spf1 include:spf.shipmail.to -all

How it works

  1. You publish a TXT record that lists the allowed sending servers.
  2. A receiving server looks up this record when it gets an email from your domain.
  3. The "-all" suffix means "reject anything not explicitly listed."
  4. The "include:spf.shipmail.to" directive authorizes Shipmail's mail servers.

DKIM (DomainKeys Identified Mail)

DKIM signs every outgoing email. Shipmail signs each message with a private key, and your DKIM record publishes the matching public key. A receiving server uses that key to check that the message came from your domain and nobody changed it on the way.

TypeHostValue
TXTshipmail._domainkeyv=DKIM1; k=rsa; p=MIGf...

How it works

  1. Shipmail signs outgoing email with a private key.
  2. You publish the matching public key as a TXT record.
  3. The receiving server checks the signature against the public key.
  4. If the signature is invalid, the email fails DKIM authentication.

The DKIM public key is unique to your domain. Copy the exact value shown in your Shipmail dashboard. Do not use the example value above.

DMARC (Domain-based Message Authentication, Reporting and Conformance)

DMARC tells receiving servers what to do with an email that fails both SPF and DKIM. You can add a reporting address later if you want DMARC aggregate reports.

TypeHostValue
TXT_dmarcv=DMARC1; p=reject

How it works

  1. You publish a TXT record with your policy.
  2. Receiving servers check the policy when SPF or DKIM fails.
  3. "p=reject" tells receivers to reject email that fails.
  4. Optional fields like "rua=mailto:..." say where to send aggregate reports.

Common mistakes and how to fix them

Multiple SPF records on the same domain

Problem: DNS allows only one SPF TXT record per domain. Adding a second one causes both to fail.

Fix: Merge all include statements into a single SPF record. For example: v=spf1 include:spf.shipmail.to include:_spf.google.com -all

Using ~all instead of -all in SPF

Problem: ~all (soft fail) tells receivers to accept email that fails SPF and only flag it. That weakens your policy and can hurt deliverability.

Fix: Use -all (hard fail) unless you are mid-migration and need a softer policy for a while.

Copying the DKIM example value instead of the real key

Problem: Each domain gets its own DKIM key. A placeholder or another domain's key makes every DKIM check fail.

Fix: Copy the exact DKIM value from your Shipmail dashboard after adding your domain.

Wrong host for DKIM record

Problem: Most DNS providers add your domain to the host field for you. Entering "shipmail._domainkey.example.com" as the host creates "shipmail._domainkey.example.com.example.com".

Fix: Enter only shipmail._domainkey as the host. Your DNS provider adds the domain.

Starting DMARC with p=reject before testing

Problem: If other services send email from your domain, such as a newsletter tool or a transactional sender, and your SPF and DKIM do not cover them, p=reject blocks their email.

Fix: Keep p=reject if Shipmail is your only sender. If other services still send from your domain, use a custom DMARC policy until their SPF and DKIM pass alignment.

How to verify your records

Shipmail checks the records for you when you add a domain. To check them yourself, use dig (Linux/macOS) or nslookup (Windows). Replace example.com with your domain.

Check SPF

dig TXT example.com +short

You should see a record containing "v=spf1 include:spf.shipmail.to".

Check DKIM

dig TXT shipmail._domainkey.example.com +short

You should see a record starting with "v=DKIM1; k=rsa; p=".

Check DMARC

dig TXT _dmarc.example.com +short

You should see a record starting with "v=DMARC1;".

Frequently asked questions

Is DMARC required?

Yes, in the default Shipmail setup. A domain needs a DMARC record to finish verification, though you can choose to manage your own DMARC policy instead. Without DMARC, each receiving server decides what to do with email that fails SPF or DKIM. With DMARC, you decide.

Can I use Shipmail alongside Google Workspace or Microsoft 365?

Yes. Merge the SPF include statements into a single record. DKIM records use different selectors, so they do not conflict. To roll out DMARC slowly, switch to Shipmail's custom DMARC mode and publish your own policy while you check that both services pass.

How long does DNS propagation take?

Most changes show up within a few minutes. Some DNS providers cache records for up to 48 hours. Set a low TTL, such as 300 seconds, on new records to speed this up.

What does a DMARC aggregate report look like?

Receiving mail servers send DMARC reports as XML files once a day. They show how many emails from your domain passed or failed SPF and DKIM. Free tools like DMARC Analyzer or Postmark's DMARC tool turn them into readable dashboards.

My emails are going to spam. What should I check?

Check all three records with the dig commands above. Make sure you have only one SPF record and that your DKIM key matches the one in your dashboard. If everything looks right, read your DMARC report for clues, and check that your sending domain is not on a blocklist.