Skip to content

How to Check Whether Your Email Domain Has SPF and DKIM

SPF and DKIM help receivers trust mail from your domain. Learn three simple ways to check whether they exist, read what you find and fix common mistakes.

10 min readUpdated Nov 22, 2026By XPASS Editorial Team

How to Check Whether Your Email Domain Has SPF and DKIM

When mail from your company goes to spam, or a client says your messages never arrive, the first technical question is usually whether your domain is properly authenticated. Two small DNS records, SPF and DKIM, carry most of that proof. They are invisible to normal users, which is why many small businesses run for years without knowing whether they exist.

The good news is that checking them takes about fifteen minutes and needs no special software. This guide shows three methods: reading the DNS records directly, reading the headers of a real message, and using an online checker. It then explains how to interpret what you see and what the usual mistakes look like. If spam is your main concern, our overview of where to start when company email gets too much spam puts these records in context, and a look at what SpamExperts is and how spam filtering works shows how receivers use such signals.

What SPF and DKIM are, in plain words

SPF (Sender Policy Framework) is a list, published in DNS, of the servers allowed to send mail for your domain. When a receiving server gets a message that claims to be from your domain, it looks up your list and checks whether the sending server is on it. The rules are defined in RFC 7208.

DKIM (DomainKeys Identified Mail) is a digital signature. Your sending server signs each message with a private key. The matching public key is published in DNS. The receiver fetches the public key and checks that the signature matches and that the signed parts of the message were not changed on the way. The mechanism is specified in RFC 6376.

A third record, DMARC, builds on both. It tells receivers what to do when SPF and DKIM do not line up with the From domain, and where to send reports. It is described in RFC 7489. This article focuses on SPF and DKIM, but a check of DMARC takes the same method and is worth doing at the same time.

Record Where it lives What it proves Looks like
SPF TXT record on the domain itself The sending server is allowed Begins with v=spf1
DKIM TXT record at selector._domainkey.domain The message is signed and unchanged Contains v=DKIM1 and p= with a long key
DMARC TXT record at _dmarc.domain What to do when checks fail Begins with v=DMARC1

Method 1: Look up the DNS records

This is the most direct method, because it shows what the world sees.

Check SPF

On a computer with a command line, run one of these, replacing the example with your domain:

  • On Windows, macOS or Linux with nslookup: type the command nslookup -type=TXT example.com
  • On macOS or Linux with dig: type dig TXT example.com +short

Look through the results for a line that starts with v=spf1. A typical record is:

v=spf1 include:_spf.provider.example ip4:203.0.113.10 ~all

Read it from left to right:

  • v=spf1 marks the record as SPF.
  • include: pulls in the allowed senders of another service, such as your mail host or a newsletter tool.
  • ip4: or ip6: allows specific addresses.
  • mx or a allows the servers named in your MX or A records.
  • The last part says what to do with everyone else: -all means reject, ~all means treat as suspicious (soft fail), ?all means no opinion. The form +all allows everyone and defeats the purpose.

If you cannot use a command line, any reputable web-based DNS lookup tool can show TXT records for a domain. Type your domain, choose the TXT record type and read the results.

Check DKIM

DKIM records are stored at a name built from a selector, so you need to know the selector. It looks like selector._domainkey.example.com. Your mail provider's setup page usually lists it; selectors such as default, mail or a provider-specific name are common, but you must confirm yours. Then run:

  • nslookup -type=TXT selector._domainkey.example.com
  • or dig TXT selector._domainkey.example.com +short

A good result looks like v=DKIM1; k=rsa; p= followed by a long string of characters. If the lookup returns nothing, the key is not published under that selector. Either the selector name is wrong or the record was never added.

Long keys sometimes appear as several quoted strings in a row. That is normal; DNS splits them, and receivers join them together.

Method 2: Read the headers of a real message

Records in DNS show what is published. Message headers show what actually happened to a real message, which is usually the more convincing proof.

  1. From the mailbox you want to test, send a message to an address you control at a different provider, for example a personal webmail account.
  2. Open the received message and choose the option to view the original, source or full headers. The wording differs from one mail program to another.
  3. Find the line that begins with Authentication-Results. Many receivers add it.
  4. Read the verdicts. You are looking for spf=pass, dkim=pass and dmarc=pass.
  5. Also look for the line that begins DKIM-Signature. The d= value is the signing domain and the s= value is the selector.

Here is how to read common verdicts:

Verdict Meaning What to do
spf=pass The sending server is on your list Nothing
spf=softfail or fail Server is not on your list Add the correct sending service to SPF
spf=none No SPF record found Publish one
dkim=pass Signature verified Nothing
dkim=fail Signature did not verify Check the published key and whether something modifies messages
dkim=none No signature on the message Turn on DKIM signing at your sending service

Test from every system that sends mail for you, not only from the main mailbox. A website contact form, an invoicing tool and a newsletter service can each sign or fail separately.

Method 3: Use an online checker

Several web tools let you type your domain, and sometimes a DKIM selector, and report the SPF, DKIM and DMARC records they find with a short explanation. Others give you a unique address to send a test message to and then show a full report. These tools are convenient, but keep a few points in mind:

  • Use a well-known service and avoid pasting private message contents into any tool.
  • A checker shows a snapshot. After you change DNS, wait for caches to expire before running it again.
  • Treat the result as a pointer, not a verdict. Confirm the findings with Method 1 or 2.
  • Some tools guess common selectors. If a tool says "no DKIM found", it might simply have tried the wrong selector.

Common problems and how to fix them

When you check, these are the issues that turn up most often.

  • No SPF record. Publish one that lists your mail host and any other service that sends as your domain. Your mail provider's setup instructions give the exact include value to use.
  • Two SPF records. This is invalid. Merge them into one record that lists every sender.
  • More than ten DNS lookups. SPF allows a limited number of lookup-causing terms (such as include, a, mx and redirect). Chains of many services can exceed it and produce a permanent error. Remove services you no longer use.
  • +all or an overly open record. This lets anyone send as your domain. Replace it with ~all or -all after listing real senders.
  • A service sends as you but is missing. Newsletter, invoicing, CRM and helpdesk tools often send on your behalf. Add each to SPF and, where offered, enable DKIM for your domain.
  • DKIM not enabled. Many services publish a key only after you turn on domain authentication. Follow the instructions, add the DNS record they give you and then activate signing.
  • Wrong selector or typo in the key. Copy the value exactly. A single missing character breaks the signature.
  • Records on the wrong name. The SPF record belongs on the domain used in the envelope sender, and DKIM at the selector host. A sub-domain used for sending needs its own records.
  • Forgetting to wait. DNS changes take time to spread, depending on the record's time-to-live.

After fixing, repeat Method 2 with a fresh test message. A pass in the headers is the confirmation that matters.

A plain example

Nina runs a small online shop and uses a mailbox on her own domain, nina.example. Customers say that order confirmations sometimes land in spam.

She runs a TXT lookup for nina.example and finds two lines starting with v=spf1: one from her mail host and one added years ago for a newsletter service. She merges them into a single record that includes both senders, ending with ~all.

Next she sends a test message from her mailbox to a personal webmail account and opens the headers. The Authentication-Results line shows spf=pass but dkim=none. She opens her mail host's setup page, finds the DKIM selector and the public key to publish, adds the TXT record at selector._domainkey.nina.example and turns on signing.

An hour later she sends another test. This time the header shows spf=pass, dkim=pass and dmarc=pass. No setup can promise that every confirmation reaches every inbox, but she has removed the most common technical reason for them to be treated with suspicion.

Keep a record of what you find

Whatever method you use, write down the results in a short note: the date, the domain, the SPF record text, the DKIM selector and the verdicts you saw in the headers. Add the name of the person who changed DNS last and the services that send mail for you. This note turns the next check from a puzzle into a five-minute comparison, and it helps a colleague or a support team understand the setup when you are away. Review it whenever you adopt a new tool that sends email on behalf of your company.

Limits and what to watch for

  • Pass does not mean inbox. Authentication proves who sent the message. Receivers also weigh reputation, content, complaint rates and sending patterns.
  • SPF breaks on forwarding. When a message is forwarded, the forwarding server is not on your list, so SPF may fail even for a legitimate message. DKIM usually survives forwarding, which is one reason to have both.
  • Be careful with strict policies. Move to a strict DMARC policy only after you have confirmed that every legitimate sender passes.
  • Do not publish secrets in DNS. Only the public DKIM key belongs there; the private key stays on the signing server.
  • Third-party tools change. If you remove a service, remove its entries from SPF too, so that former tools cannot send as you.
  • Layered defences help. Authentication protects your outgoing mail; it does not filter incoming spam. For that, see how a cloud spam filter differs from a mailbox filter.

Summary

To check SPF and DKIM, look up the TXT records for your domain, send a real test message and read its Authentication-Results header, and optionally confirm with an online checker. A good SPF record starts with v=spf1, appears once and lists every sender you use. A good DKIM setup publishes a public key at selector._domainkey and signs outgoing messages so that receivers see dkim=pass. Fix the common faults first, such as duplicate records, missing services and unpublished keys, then retest. Authentication improves how receivers treat your mail, but it is only one part of good deliverability.

If you want to see how filtering and authentication fit into a company mail setup, the Email Security and Business Email pages describe the services in more detail.

Frequently asked questions

How can I tell if my domain has an SPF record?

Look up the TXT records of your domain with a DNS lookup tool, or with a command such as nslookup or dig. An SPF record is a TXT record that begins with v=spf1. If you find none, the domain has no SPF policy published.

How do I check DKIM when I do not know the selector?

DKIM records live under a selector name, in the form selector._domainkey.yourdomain. The easiest way to learn the selector is to send a message to a mailbox you control, open the full headers and read the s= value in the DKIM-Signature line. Your mail provider's setup page also lists it.

Can a domain have more than one SPF record?

No. A domain should publish exactly one SPF record. Two records beginning with v=spf1 cause a permanent error for many receivers. Combine all allowed senders into a single record.

Is an SPF or DKIM pass enough to reach the inbox?

No. Passing authentication shows the message is allowed to claim your domain, but receivers also look at reputation, content and user behaviour. Authentication is a necessary foundation, not a guarantee of inbox placement.

Why does SPF pass but DMARC fail?

DMARC requires that a passing SPF or DKIM result is aligned with the domain in the visible From address. A message can pass SPF for a service's own domain and still fail DMARC if that domain differs from your From domain.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Protect your email and stop spoofing

Spam filtering and DMARC monitoring for your domain.

See email security

Keep reading

Business Email Guides

What Is SpamExperts and How Does It Filter Spam?

SpamExperts is a hosted spam and malware filter that checks mail before it reaches your server. This guide explains how filtering works, how to set it up and where it falls short.

10 min read

Business Email Guides

Company Email Getting Too Much Spam? Where to Start

When a company mailbox fills with junk, jumping straight to a tool rarely helps. This guide gives a practical order for diagnosing the cause and reducing spam step by step.

10 min read

Business Email Guides

Cloud Spam Filter vs Mailbox Filter: What Is the Difference?

Cloud spam filters and mailbox filters both fight junk, but they act at different points on the mail path. Learn the differences, trade-offs and how to choose or combine them.

10 min read