DNS Records, SPF & DMARC Email Security Explained

Category: DNS & Email Security Updated: November 28, 2026 Reading time: 8 minutes

The Domain Name System (DNS) does far more than point websites to IP addresses — it also governs where your email is delivered and publishes the cryptographic and policy records that prevent attackers from impersonating your domain in phishing campaigns.

1. How a DNS Query Resolves Step by Step

When your browser looks up api.example.com and the answer is not already cached, your device contacts a recursive resolver (provided by your ISP or a public resolver like 1.1.1.1 or 8.8.8.8). That resolver walks the global DNS hierarchy in milliseconds:

  1. Root Nameservers: Direct the resolver to the TLD servers responsible for .com.
  2. TLD Nameservers (.com): Return the domain's authoritative NS records (for instance, Cloudflare or Route 53).
  3. Authoritative Nameservers: Return the exact A, AAAA, MX, or TXT record along with its Time To Live (TTL) value in seconds.

2. Planning Zero-Downtime Migrations with TTL

DNS changes do not "propagate" instantly across the globe — resolvers simply hold the old answer until its TTL expires. If your A record currently has a TTL of 86400 (24 hours) and you swap IPs without preparing, visitors behind caching resolvers may hit the old server for up to a full day.

Best practice before a server move: Lower the record's TTL to 300 seconds (5 minutes) at least 24 hours before the migration window. Perform the cutover, confirm traffic shifts cleanly within minutes, and then raise the TTL back to 3600–14400 seconds to reduce lookup latency.

3. Stopping Email Spoofing: SPF, DKIM, and DMARC

The original SMTP email protocol did not verify whether the server transmitting a message was actually authorized to use the sender's domain in the From: header. Modern inbox providers (including Gmail, Yahoo, and Microsoft 365) now strongly require three DNS-based authentication layers — and routinely bounce or spam-folder unauthenticated mail.

SPF (Sender Policy Framework)

Published as a TXT record on your root domain, SPF lists every IP range and mail service allowed to send email on your behalf:

v=spf1 include:_spf.google.com include:sendgrid.net -all

DKIM (DomainKeys Identified Mail)

DKIM attaches a cryptographic digital signature to each outgoing email header. Your sending server signs the message with a private key, and receivers verify it against the public key published under a selector subdomain such as google._domainkey.example.com. Unlike SPF, DKIM survives email forwarding as long as the signed headers and body are not altered in transit.

DMARC (Domain-based Message Authentication, Reporting & Conformance)

Published as a TXT record at _dmarc.yourdomain.com, DMARC ties SPF and DKIM together by requiring domain alignment (the domain authenticated by SPF or DKIM must match the visible From: header) and telling receivers what action to take on failures:

_dmarc.example.com  TXT  "v=DMARC1; p=reject; rua=mailto:[email protected]; adkim=r; aspf=r"

4. Safe 3-Phase DMARC Rollout Plan

  1. Phase 1 — Monitor (p=none): Publish v=DMARC1; p=none; rua=mailto:... and inspect XML aggregate reports for 2–4 weeks to discover every legitimate third-party sender (CRM, billing, helpdesk, newsletter tools) using your domain.
  2. Phase 2 — Quarantine (p=quarantine; pct=25 → pct=100): Once all legitimate senders pass SPF/DKIM alignment, route failing messages to spam gradually using the pct= percentage tag.
  3. Phase 3 — Reject (p=reject): Block spoofed messages outright at the SMTP gateway so forged emails never reach recipients' inboxes.
Pro Tip for Parked / Non-Sending Domains: Even if a domain never sends email, attackers can still spoof it unless you lock it down with a null SPF record (v=spf1 -all) and strict DMARC (v=DMARC1; p=reject; sp=reject;).
Check your domain right now: Use our Live DNS & Email Security Auditor to query live records and verify your SPF and DMARC enforcement status in seconds.