Skip to content
DevOps & Tools⏱️ 13 min read·

How to Set Up a Professional Domain Email and Fix SPF/DKIM/DMARC Deliverability Issues

Stop your business emails from landing in client Spam or Junk folders. Learn how to configure custom domain email with Zoho or Google Workspace and set up SPF, DKIM, and DMARC records.

MN
Manoj NeupaneSoftware Developer & Programming Instructor
#Email#DNS#SPF#DKIM#DMARC#Zoho
🎯 Who This Tutorial Is For

Developers and businesses setting up custom email addresses (e.g. contact@yourdomain.com) whose emails are landing in Gmail spam folders.

📋 Prerequisites
  • ✓A registered domain name with access to DNS records
  • ✓Free Zoho Mail or Google Workspace account

🚀 What You Will Learn & Build

  • ▸Configuring MX records to route incoming emails
  • ▸What SPF is and how to create the correct TXT record
  • ▸Generating and publishing DKIM cryptographic keys
  • ▸Setting up a DMARC policy for email authentication
1

1. Why Your Emails Land in the Spam Folder

Major email providers (Google, Yahoo, Microsoft) enforce strict anti-spam rules. If an email claims to come from `info@yourdomain.com`, but your DNS does not have **SPF** and **DKIM** records authorizing the sending server, the recipient's mail server automatically flags it as spoofed / phishing and diverts it to Spam.
2

2. Setting up the SPF (Sender Policy Framework) Record

SPF is a single TXT record listing all IP addresses and mail services permitted to send email on your domain's behalf.
DNS TXT Record
# For Zoho Mail users:
Type: TXT
Host / Name: @
Value: v=spf1 include:zoho.com ~all

# For Google Workspace (Gmail):
Type: TXT
Host / Name: @
Value: v=spf1 include:_spf.google.com ~all

# For shared cPanel server:
Type: TXT
Host / Name: @
Value: v=spf1 +a +mx ~all
3

3. Configuring DKIM (DomainKeys Identified Mail)

DKIM adds a cryptographic signature to email headers. Your mail provider generates a public/private key pair. You publish the public key in your DNS as a TXT record.
DNS TXT Record
# Example DKIM for Zoho:
Type: TXT
Host / Name: zoho._domainkey
Value: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ...[publicKey]...DAQAB
4

4. Setting up DMARC (Domain-based Message Authentication)

DMARC tells receiving servers what to do if an incoming email fails SPF or DKIM checks:
DNS TXT Record
Type: TXT
Host / Name: _dmarc
Value: v=DMARC1; p=none; rua=mailto:admin@yourdomain.com; pct=100; sp=none

✨ Expected Output & Verification

Sending a test email to mail-tester.com scores 10/10 with SPF, DKIM, and DMARC passing with zero warnings.

🧪 How to Test the Implementation

  1. 1Send a test message to https://www.mail-tester.com
  2. 2Check headers in received Gmail: Click three dots → 'Show Original' and verify SPF, DKIM, DMARC all show 'PASS'

⚠️ Common Errors & How to Fix Them

❌Multiple SPF records found

Root Cause: Publishing two separate TXT records containing v=spf1.

Fix: Combine them into one: 'v=spf1 include:zoho.com include:_spf.google.com ~all'. A domain can only have ONE SPF record.

🛡️ Security Considerations & Best Practices

  • !Never publish private DKIM keys in public repositories or client files.

❓ Frequently Asked Questions (FAQ)

Yes, Zoho Mail offers a Forever Free plan supporting up to 5 users on your custom domain with 5GB storage per user.

📌 Summary of Key Takeaways

  • ✓MX handles inbound email; SPF and DKIM authenticate outbound email.
  • ✓Never create more than one SPF TXT record per domain.

Official References & Further Reading