Prompt

how to set up dkim for email api

Technology / API Platforms1 observationLast seen Nov 12, 2026

Latest observation

Nov 12, 2026OpenAI APIWeb search: off

Setting up DKIM for an email API usually means: generate a DKIM key pair, publish the public key in DNS, then configure your email provider/API to sign outgoing mail with the private key.

Basic steps

1) Decide your DKIM domain and selector

  • Domain: usually your sending domain, e.g. example.com
  • Selector: a label to identify the key, e.g. s1, mail, or dkim1

Your DKIM DNS record will look like:

s1._domainkey.example.com

2) Generate a DKIM key pair

You need:

  • Private key → uploaded/configured in your email API
  • Public key → published in DNS

If you manage your own mail server, you can generate it with OpenSSL:

openssl genrsa -out dkim-private.key 2048
openssl rsa -in dkim-private.key -pubout -out dkim-public.key

Most email APIs will either:

  • generate the key for you, or
  • ask you to paste/add a DNS record they provide

3) Publish the public key in DNS

Create a TXT record:

Host/name:

s1._domainkey.example.com

Value:

v=DKIM1; k=rsa; p=PUBLIC_KEY_HERE

The p= value is the public key, usually as one long base64 string without headers/footers.

Example:

v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3...

4) Configure your email API to sign outgoing emails

In your email API/dashboard/config:

  • add the selector
  • add the domain
  • add the private key or connect the DNS record they generated
  • enable DKIM signing

The API will add a DKIM-Signature header to outgoing messages.


5) Verify it

Send a test email to:

  • Gmail / Outlook and inspect headers
  • DKIM testing tools
  • dig / nslookup for the DNS record

Check the email headers for something like:

DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=s1; ...

And look for:

  • dkim=pass

If you’re using a common email API

Some providers have a setup like this:

  • SendGrid: authenticate domain, add DKIM CNAME/TXT records
  • Mailgun: add DKIM DNS records they provide
  • Amazon SES: add CNAME records for DKIM
  • Postmark: add DNS records for DKIM

In many cases, the provider gives you DNS records to add, and they handle signing automatically.


Common gotchas

  • DNS not propagated yet
  • Wrong selector name
  • Public key copied incorrectly
  • Using the wrong domain (example.com vs mail.example.com)
  • Private key not installed in the API/provider
  • Key too long for a single TXT record; needs splitting per provider guidance

Important

DKIM alone is not enough for good deliverability. You should also set up:

  • SPF
  • DMARC

These work together to improve authentication and inbox placement.

If you want, I can give you exact DKIM setup steps for a specific email API like SendGrid, Mailgun, Amazon SES, Postmark, or a self-hosted server.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.