In an SPF review of example.com, which DNS names need their own v=spf1 record, given that the apex record does not cover subdomains?
answer
- no inheritance down the tree
- envelope domains and host names
- silence gives receivers nothing
- the shortest useful record
basics
~20 sEvery name a receiver will check needs its own record: each domain used in MAIL FROM, each host name announced in HELO, and each name that sends no mail, which gets v=spf1 -all. SPF never inherits from a parent domain.
solid answer
~40 sAn SPF check looks up exactly the domain of the identity being checked, and RFC 7208 places each record at the owner name it pertains to, so `example.com`'s record says nothing about `news.example.com`. A name with no record gives `none`. So a review lists: every **envelope domain** used in `MAIL FROM`, including subdomains set aside for outside senders; every **host name** the servers announce in `HELO`, which RFC 7208 section 10.1.2 calls best practice to cover with a record such as `v=spf1 a -all`, and which is also the domain checked when `MAIL FROM` is empty; and every **name that sends no mail**, for which `v=spf1 -all` is a well-established best practice. Wildcard records are discouraged, because a wildcard does not cover names that exist with other records.
go deeper
Recall that SPF records do not inherit to subdomains, and that a domain sending no mail publishes v=spf1 -all.
Explain which identities get looked up, the MAIL FROM domain and the HELO host name, and why each needs a record at its exact name.
Show the inventory: envelope subdomains, HELO host names with v=spf1 a -all, parked and web-only names with v=spf1 -all, and why wildcards are a poor substitute.
Decide coverage as policy: every owned name either sends through a documented record or publishes v=spf1 -all, with an owner and a review cadence for the inventory.
## SPF looks up exactly one name An SPF check takes an identity, either the domain in the SMTP `MAIL FROM` (the envelope sender) or the host name in `HELO`/`EHLO`, and fetches the `TXT` records at **exactly that domain**. RFC 7208 section 3 says each SPF record "is placed in the DNS tree at the owner name it pertains to, not in a subdomain under the owner name." There is no walk up the tree: - `example.com`'s record covers mail whose envelope domain is `example.com`, and nothing else. - A message with `MAIL FROM:<[email protected]>` is checked against `news.example.com`. If that name has no SPF record, the result is `none`, whatever the apex says. - If the name does not exist at all, the check also ends in `none` (section 4.3). A `none` gives a receiver no signal: it cannot tell a legitimate sender from a stranger using the name in the envelope. Every name that can appear in a checked identity therefore needs its own record, and a review starts by listing those names. ## Names that send mail through the envelope 1. **The main envelope domain**, usually the apex, carrying the servers and services that send as it. 2. **Envelope subdomains** set aside for outside services, such as `news.example.com` for a newsletter platform. Each holds the policy for that sender only, which keeps the apex record short. 3. **Every other domain the organisation owns that is used in `MAIL FROM`**, including regional or product domains. Each of these is a separate record at a separate name, and each follows the same shape rules: exactly one record beginning `v=spf1`, best closed with an explicit `all`. ## Host names announced in HELO RFC 7208 section 10.1.2 calls publishing SPF records for individual hosts best practice. The host name is generally the identity in the `HELO`/`EHLO` command, and the RFC gives a standard record for a host involved in mail processing: ```dns relay.example.com. IN TXT "v=spf1 a -all" ``` The `a` term authorises the host's own addresses, and `-all` closes it. The host record matters twice: receivers that check the `HELO` identity read it directly, and when a message has an empty `MAIL FROM` (the null sender used by bounces and other notifications), that host name is the domain used for the `MAIL FROM` check as well. How a receiver runs those two checks belongs to the material on SPF results; for the review, the point is that every name the servers announce needs a record. ## Names that send no mail Section 10.1.2 again: "Publishing SPF records for domains that send no mail is a well-established best practice." The record is the shortest useful SPF record there is: ```dns www.example.com. IN TXT "v=spf1 -all" ``` It says that no host is authorised, so a receiver gets a definite result instead of `none`. Candidates include parked and defensively registered domains, web-only names such as `www`, and any subdomain that should never appear in an envelope. | Name in the review | Why it is checked | Record to publish | |---|---|---| | `example.com` (sends mail) | `MAIL FROM` domain | One record listing its senders, ending in `all` | | `news.example.com` (one outside sender) | `MAIL FROM` domain | One record for that sender only | | `relay.example.com` (outbound host) | `HELO` name, and the null-sender check | `v=spf1 a -all` | | `www.example.com` (sends nothing) | Could be used in an envelope | `v=spf1 -all` | | `example.net` (parked) | Could be used in an envelope | `v=spf1 -all` | ## Wildcards: discouraged Publishing a wildcard SPF record to cover every subdomain at once is tempting. RFC 7208 section 3.5 discourages it. A DNS wildcard does not answer for names that already exist with other records, so the declaration **MUST** be repeated for any host that has any records at all, and for subdomains under it. In practice SPF records end up listed twice for every name: once for the name, once as a wildcard for the tree under it. Explicit records for the names in the inventory are easier to reason about. ## A review checklist 1. List every domain seen in `MAIL FROM` in outbound logs and reports. 2. List every host name the outbound servers announce in `HELO`. 3. List every owned name that should never send. 4. Query each name's `TXT` records: exactly one beginning `v=spf1`, ending in `all`. 5. Record what each name is for, so a later reviewer knows why `-all` sits where it does. Whether a non-existent subdomain is also covered by a DMARC policy is a separate question, answered with DMARC's own records.
- Why publish v=spf1 -all on a domain nobody sends from, instead of leaving it empty?Without a record the result is `none`, which tells a receiver nothing, so the name can appear in envelopes with no evidence against it. `v=spf1 -all` gives a definite statement that no host is authorised, which RFC 7208 section 10.1.2 calls a well-established best practice.
- Why does an outbound relay's own host name need a record if the apex domain already has one?Because SPF never inherits: the host name is a separate name. Receivers that check `HELO` look up `relay.example.com` itself, and when `MAIL FROM` is empty the same host name becomes the domain checked for `MAIL FROM`, so bounces depend on it. RFC 7208 gives `v=spf1 a -all` as the standard host record.
- The apex SPF record automatically covers every subdomain.
- A domain that sends no mail needs no SPF record.
- A wildcard SPF record covers every name under the domain.
- Only the MAIL FROM domain matters; HELO names never need records.
- v=spf1 with no terms is the record for a domain that sends no mail.