DEV Community

Cover image for How to add DKIM Records For Emails
Chetan Rohilla
Chetan Rohilla

Posted on • Edited on • Originally published at w3courses.org

How to add DKIM Records For Emails

Basically to prevent spamming, phishing or hacking our emails system we needs some TXT Records in Our DNS like SPF, DMARC, DKIM. DKIM is one of these which refers to DomainKeys Identified Mail. It is a technical standard that helps protect email senders and recipients from spamming, spoofing, and phishing. It is a form of email authentication that allows an organization to claim responsibility for a message in a way that can be validated by the recipient. Here we are adding DKIM Records For Emails to prevent emails bouncing, spamming or phishing.

Adding DKIM Records For Emails

  1. Generate DKIM Public Key and Private Key and add the key or DomainKey Selector(this can be any random alphabets or numbers)

  2. Add TXT Record in DNS as:

Name: {key}._domainkey.YourDomain.com.
Value: v=DKIM1\; k=rsa\; p=[YourPublicKey]
TTL: 1800

  1. Add Private Key at Email Service Provider, generated at step 1

  2. After adding you can check TXT DNS here


Please like share and give positive feedback to motivate me to write more.

For more tutorials visit my website.

Thanks:)
Happy Coding:)

Top comments (0)

Heroku

Build AI apps faster with Heroku.

Heroku makes it easy to build with AI, without the complexity of managing your own AI services. Access leading AI models and build faster with Managed Inference and Agents, and extend your AI with MCP.

Get Started

👋 Kindness is contagious

Explore this practical breakdown on DEV’s open platform, where developers from every background come together to push boundaries. No matter your experience, your viewpoint enriches the conversation.

Dropping a simple “thank you” or question in the comments goes a long way in supporting authors—your feedback helps ideas evolve.

At DEV, shared discovery drives progress and builds lasting bonds. If this post resonated, a quick nod of appreciation can make all the difference.

Okay