Email security

How to Check DKIM Records: 4 Ways to Verify Your Domain

Your DKIM public key lives in DNS at selector._domainkey.yourdomain.com. Here is how to find it, read it and confirm it actually works.

Cysoro Security TeamPublished · 8 min read
$ dig TXT google._domainkey. example.com +short "v=DKIM1; k=rsa; p=MIIBIj..." dkim=pass signature verified EMAIL SECURITY Check your DKIM record dig, nslookup, headers — four ways.
Quick answer

To check a DKIM record, run dig TXT selector._domainkey.yourdomain.com +short (or nslookup -type=TXT on Windows), replacing selector with the value from the s= tag in a DKIM-Signature header. A healthy record starts with v=DKIM1 and contains a p= public key. You can also use an online DKIM checker or read the Authentication-Results header of a delivered message to confirm dkim=pass.

Key takeaways

  • DKIM keys live at selector._domainkey.yourdomain.com — you need the selector, which comes from the s= tag in a DKIM-Signature header.
  • A valid record starts with v=DKIM1 and includes a p= public key; an empty p= means the key was revoked, and no answer means the selector is not published.
  • DNS only proves the record exists; the Authentication-Results header of a real delivered message proves DKIM actually passed.

DKIM is the signature on your email: it proves a message really came from your domain and was not altered on the way. But the signature only works if the matching public key is published correctly in DNS — and a surprising number of domains get that part wrong. Checking your DKIM record takes about a minute once you know where to look.

What is a DKIM record?

A DKIM record is a TXT record in your domain's DNS that publishes the public key for one of your email signing keys. It lives at a name built from three parts: the selector, the fixed label _domainkey, and your domain — for example google._domainkey.example.com.

DKIM works as a key pair. Your mail server holds the private key and uses it to sign the headers and body of every outbound message, adding a DKIM-Signature header. The receiving server reads the d= (domain) and s= (selector) tags from that header, fetches the public key from your DNS record, and checks the signature. If the signature matches, the message is authentic and unaltered, as defined in RFC 6376, the DKIM standard.

One detail trips people up: a domain can have several DKIM records, one per selector, and DNS gives you no way to list them. You cannot ask DNS "show me all the DKIM keys for example.com" — you have to know the selector first.

How do I find my DKIM selector?

Before you can check a DKIM record, you need the selector. The fastest way is to read it from a message your domain already sent.

  1. Send yourself a test email from the domain you want to check, to a personal Gmail or Outlook address.
  2. Open the full headers. In Gmail, open the message, click the three dots and choose "Show original". In Outlook, open the message properties and look at the internet headers.
  3. Find the DKIM-Signature header. It looks like this: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=google; ...
  4. Read the s= value. Here the selector is google and the signing domain is example.com, so the DNS name to check is google._domainkey.example.com.

If you cannot find a DKIM-Signature header at all, your mail is probably not being signed — that is a setup problem, not a checking problem. Your email provider's admin settings will also show the selector: Google Workspace shows it on the Authenticate email page, and Microsoft 365 uses selector1 and selector2 by default. Common selectors used by well-known providers include google for Google Workspace, selector1 and selector2 for Microsoft 365, and protonmail, protonmail2 and protonmail3 for Proton Mail.

Reading a DKIM-Signature header DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=google; bh=...; b=... d=example.comthe signing domain s=googlethe selector DNS name to check: google._domainkey.example.com Selector + _domainkey + domain — that is the whole address.
Where the selector and domain hide in a DKIM-Signature header. Illustration by Cysoro.

How do I check a DKIM record with dig?

The dig command is the most direct way to check a DKIM record, because it shows you exactly what DNS returns, with nothing in between. It is built into macOS and Linux; on Windows 10 and later you can use nslookup or PowerShell instead.

Run this command, replacing google with your selector and example.com with your domain:

dig TXT google._domainkey.example.com +short

A healthy answer looks like this:

"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."

The p= value is the public key itself, usually a long base64 string. What matters is that it is present and non-empty. An empty p= means the key was deliberately revoked. No answer at all means that selector is not published — either the selector is wrong, the record is missing, or DNS has not picked up a recent change yet.

To compare what the public internet sees with what your own DNS server holds, query your authoritative server directly. First find your name servers with dig NS example.com +short, then run the same TXT query against one of them, for example dig TXT google._domainkey.example.com @ns1.your-dns-host.net. If the authoritative server has the record but public resolvers do not, you are looking at propagation delay, not a broken record.

How do I check a DKIM record on Windows?

Windows has no dig by default, but nslookup and PowerShell do the same job. Open Command Prompt or PowerShell and run:

nslookup -type=TXT google._domainkey.example.com

Or in PowerShell:

Resolve-DnsName google._domainkey.example.com -Type TXT

Both return the same TXT record text as dig. The PowerShell version is often easier to read, because it formats each record on its own line instead of wrapping one long quoted string. If nslookup returns "Non-existent domain", the selector is wrong or the record is not published — the same conclusion as an empty dig answer.

One Windows quirk: nslookup sometimes appends your local DNS suffix to the name you type. If you get a strange result, add a trailing dot to the full name — google._domainkey.example.com. — which tells the resolver the name is already complete.

How do I check a DKIM record with an online tool?

If you would rather not use the command line, an online DKIM checker does the same DNS lookup and adds a syntax check on the result. Enter your domain and selector, and the tool fetches the record and tells you whether the key is valid.

Our own free DKIM checker runs the lookup and validates the record syntax and the public key in one step. It tries common selectors automatically, which helps when you are checking a domain whose selector you do not know — though no tool can find a selector that is not on its list, so the header method above is still the reliable way to learn it.

Online checkers are also useful for checking from several locations at once, which matters right after a DNS change. A record that shows up from one resolver but not another is still propagating. Wait, then check again rather than editing the record a second time and making the problem worse.

How do I read a DKIM record and know it is valid?

A DKIM TXT record is a short list of tags separated by semicolons. You only need to understand four of them to judge whether a record is healthy.

TagMeaningWhat a healthy value looks like
v=Versionv=DKIM1 — always first, always this value
k=Key typek=rsa in almost all cases
p=Public keyA long base64 string; empty means revoked
t=Flags (optional)t=y means testing mode; remove it when live

Watch for three common faults. First, a record split across lines or with stray spaces can break the key — DNS TXT strings longer than 255 characters are stored as several strings, and your DNS host must join them correctly. Second, a t=y testing flag left in place tells receivers to treat failures leniently, which weakens the protection. Third, a 1024-bit key is still common but weaker than the 2048-bit key Google Workspace and Microsoft both recommend for new setups.

Microsoft 365 is a special case worth knowing: its selectors are published as CNAME records pointing at Microsoft's own infrastructure, not as TXT records directly, as Microsoft Learn explains. Dig follows the CNAME automatically and still returns the underlying key data, so the check works the same way — do not be surprised when the answer starts with a CNAME line instead of a TXT line.

How do I verify DKIM on a real message?

A DNS lookup proves the key is published. It does not prove your mail is actually being signed correctly. That proof lives in the Authentication-Results header of a message that was really delivered, which the receiving server adds before the message reaches the inbox.

Send a test message to a Gmail address, open "Show original", and look for a line like this near the top:

Authentication-Results: mx.google.com; dkim=pass header.d=example.com;

dkim=pass means the receiving server fetched your public key, verified the signature and found the message unaltered. dkim=fail means the signature did not verify — the message may have been modified after signing, or signed with a key whose public half is not in DNS. dkim=none means the message carried no DKIM signature at all.

This header check is the only test that covers the whole chain: the signing, the DNS record and the receiving server's verdict. Run it after every change to your DKIM setup, and re-run it after any change to your mail flow — for example, adding an email signature tool after signing can break DKIM, because the signature covers the body as it was when signed.

If you want a fuller picture of your domain's email authentication, our guide to what DKIM is explains how it fits with SPF and DMARC.

Our email header analyzer reads the full Authentication-Results header for you.

Three checks, three different answers 1 DNS lookup dig TXT selector. _domainkey.domain Proves the key exists 2 Record syntax v=DKIM1, k=rsa, non-empty p= value Proves the key is usable 3 Real message Authentication-Results: dkim=pass Proves signing works Do all three after any DKIM change — each one catches failures the others miss.
The three DKIM checks and what each one proves. Illustration by Cysoro.

Why is my DKIM record not working?

When a DKIM check fails, work through the causes in order of likelihood. Most problems are one of these five.

  • Wrong selector. You queried a selector that does not exist. Go back to a real message header and copy the s= value exactly — selectors are case-sensitive in practice and easy to mistype.
  • Propagation delay. You added the record minutes ago. Google says DKIM can take up to 48 hours to start working. Check the authoritative name server directly; if it has the record, wait.
  • Record published at the wrong host. The TXT record must live at the DNS host that is actually authoritative for your domain. If you recently changed name servers, the record may be sitting at the old host where nobody looks.
  • Broken key format. A line break, extra space or missing character inside the p= value corrupts the key. Re-copy the value from your email provider and paste it as one continuous string.
  • Signing is off. The DNS record is fine, but your mail provider is not signing. In Google Workspace, DKIM must be turned on with "Start authentication" in the Admin console after the record is added. In Microsoft 365, DKIM signing for custom domains must be enabled per domain.

If the record looks right but real messages still fail, check whether something between signing and delivery is modifying the message — mailing lists, forwarding rules and signature tools are the usual suspects. The Authentication-Results header will show dkim=fail while the DNS lookup still passes, which is the signature of this exact problem.

The bottom line

Checking a DKIM record is a three-minute job once you know the selector: one dig command, one look at the record tags, and one test message to confirm dkim=pass. Do it after setup, after any DNS change, and whenever deliverability drops — a missing or broken DKIM record is one of the most common reasons legitimate mail starts landing in spam.

Run the full check in seconds with our free DKIM checker.

While you are there, confirm the rest of your email authentication with the DMARC checker — DKIM is only one third of the SPF, DKIM and DMARC trio that protects your domain from spoofing.

Frequently asked questions

What is a DKIM record?

A DKIM record is a TXT record in your domain's DNS that publishes the public key used to verify your email signatures. It lives at selector._domainkey.yourdomain.com, where the selector is a label chosen by your email provider. Your mail server signs outbound messages with the matching private key, and receiving servers fetch the public key from DNS to check the signature.

How do I find my DKIM selector?

Open a message your domain sent and look at the DKIM-Signature header. The s= tag is the selector and the d= tag is the signing domain. For example, in s=google; d=example.com, the selector is google. Your email provider's settings page also shows the selector it uses.

Why does my DKIM check return no record?

The most common reason is a wrong selector — DKIM keys cannot be listed in DNS, so a guessed selector simply returns nothing. Other causes are DNS propagation delay after a recent change, a typo in the record name, or the record being published at the wrong DNS host. Wait up to 48 hours after adding a record, then check again.

What does v=DKIM1 mean?

It is the version tag that identifies the record as a DKIM key record, defined in RFC 6376. A valid DKIM TXT record starts with v=DKIM1, followed by the key type (k=rsa) and the public key itself (p=). If the v= tag is missing or wrong, receiving servers will not treat the record as a DKIM key.

What is the difference between checking a DKIM record and testing DKIM?

Checking the record only confirms the public key is published correctly in DNS. Testing DKIM means sending a real message and reading the Authentication-Results header to see whether the receiving server reported dkim=pass. A record can be published correctly and still fail if the signing itself is broken, so both checks matter.

How long does a DKIM record take to work?

Google says it can take up to 48 hours after adding the key for DKIM authentication to start working, because DNS changes need time to propagate to resolvers around the world. In practice most changes are visible within an hour, but you should not judge a setup by a check run two minutes after saving the record.

Can I check DKIM records for someone else's domain?

Yes, for any selector you know. DKIM records are public DNS records, so anyone can query them. What you cannot do is list all of a domain's selectors — DNS gives you no way to enumerate them — so you need the selector from a message that domain actually sent.

Sources

  1. IETF — RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
  2. Google Workspace Help — Set up DKIM
  3. Microsoft Learn — How to use DKIM for email in your custom domain
  4. HostTracker — How to check SPF, DKIM and DMARC records
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against RFC 6376, Google Workspace Help and Microsoft Learn DKIM documentation.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free