Google Partner
Resources/Guides/DNS Setup
Technical Guide

Complete DNS Setup Guide for Email Authentication

Step-by-step instructions to configure SPF, DKIM, DMARC, and other DNS records for maximum email deliverability.

Technical Level
30 min setup
Copy & Paste Ready

What You'll Configure

SPF
Sender Policy Framework
Authorize mail servers
DKIM
DomainKeys Identified Mail
Digital signatures
DMARC
Domain Authentication Policy
Policy enforcement
MX
Mail Exchange Records
Mail routing
PTR
Reverse DNS Lookup
IP verification

Understanding DNS for Email

DNS (Domain Name System) records are critical for email authentication and deliverability. They prove you own your domain and authorize servers to send email on your behalf.

Prerequisites

  • • Access to your domain's DNS management panel
  • • Domain ownership verification completed
  • • Email service provider account details
  • • 24-48 hours for full propagation

DNS Record Types for Email

Authentication Records

  • • SPF - Authorized senders
  • • DKIM - Message signing
  • • DMARC - Policy enforcement

Routing Records

  • • MX - Mail server routing
  • • PTR - Reverse DNS lookup
  • • CNAME - Aliasing records

SPF Record Configuration

SPF (Sender Policy Framework) tells receiving servers which IP addresses and domains are authorized to send email for your domain.

SPF Record Structure

v=spf1 # SPF version (required)
include:_spf.google.com # Include Google's SPF
ip4:192.168.1.1 # Specific IP address
a:mail.example.com # A record lookup
~all # Soft fail for others

Common SPF Examples

Basic SPF (single provider)

v=spf1 include:_spf.google.com ~all

For Google Workspace only

Multiple providers

v=spf1 include:_spf.google.com include:spf.sendgrid.net include:mail.zendesk.com ~all

Google + SendGrid + Zendesk

With IP addresses

v=spf1 ip4:192.168.1.1 ip4:10.0.0.0/24 include:_spf.google.com ~all

Specific IPs + Google

InboxKit optimized

v=spf1 include:_spf.inboxkit.com include:_spf.google.com ~all

InboxKit + Google Workspace

SPF Limitations

  • • Maximum 10 DNS lookups allowed
  • • Only one SPF record per domain
  • • Record cannot exceed 255 characters
  • • Use ~all (soft fail) initially, then -all (hard fail)

DKIM Setup Guide

DKIM (DomainKeys Identified Mail) adds a digital signature to your emails, allowing receivers to verify the message hasn't been tampered with.

DKIM Setup Process

  1. 1

    Generate DKIM Keys

    Your email provider will generate a public/private key pair

    # Example selector and domain
    google._domainkey.yourdomain.com
  2. 2

    Add TXT Record

    Add the public key to your DNS as a TXT record

    # Name:
    google._domainkey
    # Value:
    v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ...
  3. 3

    Enable DKIM Signing

    Activate DKIM signing in your email provider's settings

  4. 4

    Verify DKIM

    Send a test email and check DKIM signature validation

Multiple DKIM Records

Unlike SPF, you can have multiple DKIM records for different services:

  • google._domainkey → Google Workspace
  • s1._domainkey → SendGrid
  • zendesk._domainkey → Zendesk
  • inboxkit._domainkey → InboxKit

DMARC Policy Implementation

DMARC (Domain-based Message Authentication, Reporting & Conformance) tells receiving servers what to do with emails that fail SPF or DKIM checks.

DMARC Record Format

v=DMARC1; # Version
p=quarantine; # Policy
rua=mailto:dmarc@yourdomain.com; # Aggregate reports
ruf=mailto:forensic@yourdomain.com; # Forensic reports
pct=100; # Percentage
sp=none; # Subdomain policy

DMARC Policy Levels

LevelPolicyUse CaseRisk
Monitor Onlyp=noneInitial setup, monitoringLow
Quarantinep=quarantineTesting phaseMedium
Rejectp=rejectFull protectionHigh

Progressive DMARC Implementation

  1. 1
    Week 1-2: p=none - Monitor only
  2. 2
    Week 3-4: p=quarantine; pct=25 - Test with 25%
  3. 3
    Week 5-6: p=quarantine; pct=50 - Increase to 50%
  4. 4
    Week 7-8: p=quarantine; pct=100 - Full quarantine
  5. 5
    Week 9+: p=reject - Full enforcement

MX Records Configuration

MX (Mail Exchange) records direct incoming email to the correct mail servers. Priority values determine the order of server attempts.

Google Workspace MX Records

PriorityMail ServerTTL
1aspmx.l.google.com3600
5alt1.aspmx.l.google.com3600
5alt2.aspmx.l.google.com3600
10alt3.aspmx.l.google.com3600
10alt4.aspmx.l.google.com3600

MX Priority Rules

  • • Lower numbers = higher priority
  • • Same priority = load balancing
  • • We recommend having backup servers (priority 5-10)
  • • Remove old MX records to prevent mail loops

PTR Records (Reverse DNS)

PTR records enable reverse DNS lookups, mapping IP addresses back to domain names. They're crucial for email server reputation.

Setting Up PTR Records

Important Note

PTR records are set by your IP address owner (ISP or hosting provider), not in your domain's DNS. Contact them to configure reverse DNS.

PTR Record Requirements:

  • Must match forward DNS (A record)
  • Use mail server hostname (mail.yourdomain.com)
  • One PTR record per IP address
  • Critical for email deliverability

Testing Your DNS Setup

After configuring DNS records, thoroughly test each component to ensure proper setup and propagation.

Command Line Testing

# Test SPF record
nslookup -type=txt yourdomain.com
# Test DKIM record
nslookup -type=txt selector._domainkey.yourdomain.com
# Test DMARC record
nslookup -type=txt _dmarc.yourdomain.com
# Test MX records
nslookup -type=mx yourdomain.com
# Test PTR record
nslookup 192.168.1.1

Online Testing Tools

Troubleshooting Common Issues

SPF PermError: Too many DNS lookups

Your SPF record exceeds the 10 DNS lookup limit.

Solution: Flatten your SPF record or use SPF macros. Consider using InboxKit's SPF optimization service.

DKIM signature verification failed

DKIM key in DNS doesn't match the signature.

Solution: Verify selector name, regenerate keys if needed, and ensure no extra spaces in the DNS record.

DMARC reports not received

Not receiving aggregate or forensic reports.

Solution: Check rua/ruf email addresses are valid, ensure email server accepts DMARC reports, verify DNS propagation.

Provider-Specific Guides

ProviderDefault TTLInterfaceAPI Available
CloudflareAutoWeb Portal
Route 53300AWS Console
GoDaddy600Web Portal
Namecheap1800Web Portal
Google Domains3600Web Portal

Ongoing Maintenance

DNS Maintenance Checklist

Automate Your DNS Management

Let InboxKit handle your DNS configuration automatically. One-click setup for SPF, DKIM, and DMARC across all your domains.