Email Security Explained: SPF, DKIM, DMARC & How to Protect Your Domain
If you send email from your domain (business email, WordPress contact forms, newsletters, etc.) you MUST set up SPF, DKIM, and DMARC — otherwise your messages may go to spam or hackers may impersonate your domain.
❗ Why Email Security Matters
Your domain email (example@yourdomain.com) can be abused by spammers if your DNS records are not configured correctly. Without SPF, DKIM, and DMARC:
- Hackers can send fake email pretending to be you
- Your domain can be blacklisted
- Emails go to spam instead of inbox
- Mail delivery becomes unreliable
⚠️ If you use business email, hosting email, or webmail — and have no SPF/DKIM/DMARC — your email is not secure.
✔️ What Are SPF, DKIM, and DMARC?
SPF (Sender Policy Framework)
SPF is a DNS record that tells receiving mail servers which servers are allowed to send email for your domain.
✔️ SPF stops spammers from sending fake email using your domain.
DKIM (DomainKeys Identified Mail)
DKIM adds a digital signature to your emails so receiving servers can verify the message came from your domain and wasn’t modified.
✔️ DKIM improves email deliverability and verifies identity.
DMARC (Domain-based Message Authentication Reporting & Conformance)
DMARC tells receiving servers what to do when SPF/DKIM fail (e.g., reject, quarantine, or allow).
✔️ DMARC prevents spoofed email from being delivered and gives you reports about abuse.
⚙️ Step-by-Step: Setting Up SPF, DKIM, and DMARC on Nairahost
These DNS records must be created where your domain DNS is hosted. That may be:
- Nairahost cPanel or DirectAdmin DNS
- Cloudflare DNS
- Your domain registrar
✔️ If you are using Nairahost nameservers, everything can be set inside cPanel or DirectAdmin.
✔️ Step 1: Add SPF Record
Example SPF record for Nairahost email:
v=spf1 +a +mx +include:spf.nairahost.cloud -all
How to Add SPF in cPanel
- Login to cPanel
- Open Zone Editor
- Click Add Record
- Select TXT
- Enter name:
@and paste value above
How to Add SPF in DirectAdmin
- Go to DNS Management
- Create TXT record
- Paste the SPF value
⚠️ Only ONE SPF record should exist per domain. Multiple SPF records = email failure.
✔️ Step 2: Add DKIM Record
DKIM records are usually created automatically when you enable email hosting in cPanel or DirectAdmin.
Enable DKIM in cPanel
- Open Email Deliverability menu
- Click Manage on your domain
- Click Enable DKIM
DNS Example of DKIM
default._domainkey.yourdomain.com → TXT → long DKIM value
✔️ Step 3: Add DMARC Record
Add this TXT record to your DNS:
_dmarc TXT v=DMARC1; p=quarantine; rua=mailto:admin@yourdomain.com;
DMARC Policies
- p=none → Monitor only
- p=quarantine → Send suspicious to spam folder
- p=reject → Block all spoofed mail entirely
✔️ Beginners should start with p=none or p=quarantine before using p=reject.
❗ Test Your Email Security
Use these tools:
- mail-tester.com
- MXToolbox SPF / DKIM / DMARC check
- Google Postmaster Tools
⚠️ Testing is important. SPF or DKIM errors can make ALL your emails go to spam.
⚙️ Common Mistakes to Avoid
- Multiple SPF records ❗
- No DMARC record at all ❗
- DKIM selector not matching ❗
- Using wrong formatting or quotes in TXT records
- DNS not updated because of wrong nameservers
✔️ What Nairahost Does to Protect Your Email
- Secure mail servers
- Automatic DKIM support
- Recommended SPF templates
- SMTP authentication required
- Spam filtering
- DNS hosted on secure nameservers:
cPanel: ns1.nairahost.cloud ns2.nairahost.cloud DirectAdmin: ns1.nairahost.com.ng ns2.nairahost.com.ng
✔️ Final Email Security Checklist
- ✔️ SPF record exists & is valid
- ✔️ DKIM is enabled and detected
- ✔️ DMARC policy is configured
- ✔️ No duplicate SPF records
- ✔️ Domain is not being spoofed
- ✔️ Emails arrive in inbox, not spam
- ✔️ Mail-tester.com score is high