Lock down a domain that sends no email: null MX, SPF, DMARC and DKIM
A domain you only use for a website, or one you keep parked, can still appear in the From line of a phishing email. Four DNS records tell every receiver that checks them that no mail from that domain is real.
The short answer
Publish four records: a null MX (MX 0 .) so nobody can deliver mail to the domain, v=spf1 -all so no server passes SPF, a DMARC record with p=reject, and an empty DKIM key at *._domainkey. Receivers that follow DMARC policies then reject any message that uses the domain in its From address.
The four records to copy
Replace example.com with your domain:
example.com. MX 0 .
example.com. TXT "v=spf1 -all"
_dmarc.example.com. TXT "v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s"
*._domainkey.example.com. TXT "v=DKIM1; p="
This is the set the UK government publishes for its own domains that send no email, without its reporting tags (fo=1 and rua) [7]. The reserved domains example.com, example.net and example.org publish these same four records today [9].
In most DNS panels you enter them like this:
| Type | Host | Value |
|---|---|---|
| MX | @ (or empty) |
priority 0, target . |
| TXT | @ |
v=spf1 -all |
| TXT | _dmarc |
v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s |
| TXT | *._domainkey |
v=DKIM1; p= |
What each record does
Null MX: the domain accepts no mail
A null MX is a single MX record with priority 0 and . as the mail server [1]. It tells senders that the domain accepts no mail, so mail sent to it fails at once instead of sitting in a queue for days [1]. RFC 7505 also lets receivers refuse mail whose sender address uses a null MX domain, with reply code 550 and status 5.7.27 [1]. The same RFC says domains that send no mail can add an SPF -all record to declare it [1].
SPF -all: no server may send
v=spf1 -all contains one mechanism, and all matches every IP address [3]. With the - qualifier the result is fail for every server that tries to send as your domain [3]. That covers the envelope sender (MAIL FROM), and receivers are advised to check the HELO name of the sending server with SPF too [3]. The From address people see is left to DMARC. An SPF record also covers only the exact name it sits on, so www.example.com needs its own if it has DNS records [3]. The UK guidance shows the same v=spf1 -all record on a subdomain [7].
DMARC p=reject: receivers reject forged mail
DMARC is the record receivers act on for the From address people see [4]. With no server allowed by SPF and no valid DKIM key, no message can pass DMARC, and the DMARC policy p=reject asks receivers to reject every one of them [4].
sp=rejectapplies the same policy to subdomains that exist [4].- Subdomains that do not exist fall back to
sp, thenp, when the record has nonptag [4]. Here both sayreject. adkim=sandaspf=sask for strict alignment: the authenticated domain must be identical to the From domain [4].
This record asks for no reports. To receive them, add a rua tag with a mailbox on another domain that receives mail, such as rua=mailto:dmarc@example.net. A mailbox on this domain cannot receive anything once the null MX is in place [1]. Receivers ignore a rua address on another domain unless that domain accepts the reports with a TXT record v=DMARC1 at example.com._report._dmarc.example.net [10]. A DMARC report service publishes that record on its own domain, and can use a wildcard that accepts reports for every domain [10].
Empty DKIM key: any signature fails
A DKIM key record with an empty p= means the key has been revoked, and a verifier must treat any signature that points to it as failed [5]. The * makes the record answer for every selector name that does not exist in your zone [6]. A receiver that checks a forged signature with any of those selectors finds a revoked key and fails it [5][6]. A selector with no record fails too, and RFC 6376 defines no difference between a revoked key and a removed one [5]. The wildcard states the revocation explicitly, as the UK guidance does [7].
What forged mail gets
When a receiver applies your p=reject, the sender sees a rejection. Gmail’s version [8]:
DMARC protects the exact domain. It does not cover lookalike domains, such as a domain one letter off yours, or a familiar name in the display part of the From line [4].
Why having no MX record is not enough
With no MX record at all, senders fall back to the domain’s own address records. RFC 5321 calls this the implicit MX: “If an empty list of MXs is returned, the address is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host” [2]. Mail to anything@example.com then goes to your web server. The null MX ends that [1].
An MX record only says where mail to the domain goes [2]. SPF, DKIM and DMARC say who may send as the domain [3][4][5], and they stop spoofing.
Mistakes to avoid
- Adding the null MX next to other MX records. A domain with a null MX MUST NOT publish any other MX record [1]. Remove the old ones first.
- Publishing a null MX on a domain that sends mail. RFC 7505 says domains used in sender addresses SHOULD NOT publish one, because receivers may reject their mail [1]. Use this set only when nothing sends or receives mail as the domain.
- Giving up when the panel refuses
.. Some DNS providers do not support a null MX record [7]. Publish the other three: they still make forged mail fail DMARC. - Leaving old DKIM selectors in place. The wildcard answers only for names that do not exist [6]. An old key at
s1._domainkey.example.com, or a CNAME there to a former provider, still works. The UK guidance says to revoke existing selectors in both TXT and CNAME records [7]. See removing old DKIM records. - Using
~allorp=none.~allgives softfail, a weaker statement than fail [3], andp=noneasks receivers to do nothing with mail that fails [4]. A domain that sends nothing has no mail to lose, so go straight to-allandp=reject. A domain that does send mail needs the gradual route in moving from p=none to p=reject. - Adding a second SPF record. If the domain already has a
v=spf1record, replace it withv=spf1 -all. Two SPF records make SPF return permerror [3]. See two SPF records on one domain.
If one subdomain does send mail, sp=reject applies to it too. Publish a DMARC record on that subdomain itself: receivers look for the record on the exact domain first [4]. More on forged mail and how DMARC stops it: how to stop email spoofing.
Check if your domain can be spoofed
The checker reads your domain’s MX, SPF, DKIM and DMARC records in your browser, tells you whether anyone can send email as you and gives the records that fix it.
Runs in your browser. Your domain is not sent to this site or stored.
See it on a test domain
Check these names under badmail.dev to see this in a result, without checking your own domain.
parked.badmail.dev: check it or see its recordsmx-missing.badmail.dev: check it or see its records
Related guides
DKIM records still pointing at your old provider: what to keep and what to remove
Old DKIM keys keep validating mail signed for your domain. Find the selectors an old provider left, remove or revoke them safely, and fix dangling CNAMEs.
From DMARC p=none to p=reject without blocking your own mail
Move DMARC from p=none to quarantine and then reject without losing real mail. What to fix first, how long to wait, and how t=y, pct and subdomains behave.
Two SPF records on one domain: why both stop working, and how to merge them
Two SPF records on one domain make SPF fail for both providers. Receivers return permerror. Find the duplicate and merge them into one valid TXT record.
