← All chapters
Chapter 21· 10 min read · illustrated

DNS Records & Email Security

The record types you will actually configure — and how they stop email spoofing

DNS does far more than name-to-IP. Its records power web hosting, email routing, and — through three special TXT records — the entire modern defence against email spoofing and spam. This is knowledge you will use every time you set up a domain.

01

What is a DNS record?

A DNS record is a single entry in a domain’s zone that answers a particular kind of query. Each has a name, a type (which decides what the value means), and a value. Setting up a domain is largely a matter of creating the right records.

Tap to enlarge
02

The records you need to know

A / AAAA
Name → IPv4 / IPv6 address.
CNAME
An alias pointing one name at another.
MX
Which mail servers receive email for the domain.
NS
Which name servers are authoritative for the domain.
TXT
Arbitrary text — used for verification and email security.
Tap to enlarge
03

A and AAAA

The workhorses. An A record maps a name to an IPv4 address; an AAAA record maps it to an IPv6 address. When you point a domain at a server, you are creating an A/AAAA record.

Tap to enlarge
04

CNAME (alias)

A CNAME makes one name an alias of another. For example, www.example.com as a CNAME to example.com means both resolve to the same place — change the target once and everything follows.

Tap to enlarge
05

MX (mail routing)

An MX (Mail Exchange) record tells other mail servers where to deliver email for your domain. Each MX has a priority; lower numbers are tried first, so you can list backups. Without a correct MX, your domain simply cannot receive mail.

Tap to enlarge
06

SPF — who may send

SPF (Sender Policy Framework) is a TXT record listing which servers are allowed to send email for your domain. A receiving server checks whether the mail came from an authorized IP; if not, it is likely spoofed and can be rejected. This is the first line of defence against forged senders.

Tap to enlarge
07

DKIM — a signature

DKIM (DomainKeys Identified Mail) adds a cryptographic signature to each outgoing email. The receiver fetches the sender’s public key from a TXT record and verifies the signature — proving the message really came from the domain and was not altered in transit.

Tap to enlarge
08

DMARC — the policy

DMARC ties SPF and DKIM together and tells receivers what to do when checks fail — do nothing, quarantine (spam folder), or reject outright. It also asks receivers to report abuse back to you. Together, SPF + DKIM + DMARC are why modern email spoofing is hard.

The trio: SPF = which servers may send. DKIM = proof it was not tampered. DMARC = the policy that enforces both.

Tap to enlarge