How to Configure SPF, DKIM, and DMARC for Your Sending Domain

How to Configure SPF, DKIM, and DMARC for Your Sending Domain

Strong email authentication is essential for inbox placement. This guide shows how to set up SPF, DKIM, and DMARC for your sending domain on a VPS.

1) SPF

Add a TXT record at your root domain:

Type: TXT
Name: @
Value: v=spf1 a mx ip4:[YOUR.SERVER.IP] ~all
TTL: 3600

Replace [YOUR.SERVER.IP] with your VPS IP. Use -all once you confirm everything works to harden your policy.

2) DKIM

  1. Generate a 2048-bit DKIM key pair (via your MTA or OpenDKIM).
  2. Create a TXT record:
    Type: TXT
    Name: selector1._domainkey
    Value: v=DKIM1; k=rsa; p=[YOUR_PUBLIC_KEY]
    TTL: 3600
    
  3. Enable DKIM signing in your MTA and test by sending to a Gmail inbox, then check “Show original”.

3) DMARC

Add a TXT record at _dmarc.yourdomain.com:

Type: TXT
Name: _dmarc
Value: v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc@yourdomain.com; fo=1; adkim=s; aspf=s; pct=100
TTL: 3600

After monitoring, consider p=reject to fully enforce alignment.

Testing & Tips

  • Use DNS lookups to verify: dig TXT yourdomain.com, dig TXT _dmarc.yourdomain.com.
  • Keep selector names consistent (e.g., selector1).
  • Ensure your From domain aligns with the DKIM domain and SPF envelope domain.

FAQ

  • Q: Should I use ~all or -all in SPF?
    A: Start with ~all for monitoring and switch to -all after validation.
  • Q: What DMARC policy is best?
    A: Begin with p=none or quarantine, then move to reject once alignment is stable.
  • dkim, dns, dmarc, email authentication, spf, deliverability
  • 0 Корисниците го најдоа ова како корисно
Дали Ви помогна овој одговор?

Понудени резултати

How to Order a VPS with a Dedicated IPv4 for Email Marketing

When doing email marketing, having a VPS with a dedicated IPv4 is crucial for reputation and...

Why PTR/rDNS is Important for Email Marketing and How to Set It Up

PTR (also known as rDNS) is a crucial DNS record that links your IP address to your domain name....

How to Configure Your Email Server for Better Inbox Delivery

Properly configuring your email server is key to getting your emails into inboxes, not spam....

IP Warming Strategies for New IP Addresses in Email Marketing

New IPs used for email marketing need to be warmed up to build a good sending reputation. Here’s...

Common Pitfalls to Avoid in Email Marketing with VPS

Email marketing from a VPS can be powerful, but you need to avoid these common pitfalls:...