Under RFC 9989's DNS tree walk, whose DMARC record governs mail From app.shop.example.com when shop.example.com and example.com both publish one, and when would a PSL-based receiver disagree?
answer
- the Author Domain is queried first
- the topmost record wins by default
- psd=n stops the walk
- eight queries at most
- RFC 7489 used a suffix list
basics
~20 sexample.com's record, through its sp or np: with no psd tag, the tree walk takes the name with the fewest labels as the organizational domain. A psd=n at shop.example.com would stop the walk there, which a Public Suffix List receiver ignores.
solid answer
~40 sRFC 9989 (May 2026) queries `_dmarc.app.shop.example.com` first; finding nothing, it walks up: `_dmarc.shop.example.com`, `_dmarc.example.com`, `_dmarc.com`. A single valid record with `psd=n` or `psd=y` stops the walk. Otherwise the organizational domain is the name with the fewest labels that has a record, here `example.com`, so its `sp` (or `np`, if the name does not exist) applies. `shop.example.com`'s record governs only mail From `shop.example.com` itself. If it carried `psd=n`, `shop.example.com` would be the organizational domain and its own `sp` or `np` would govern. A receiver still on RFC 7489 takes the registered domain from a Public Suffix List, gets `example.com` regardless, and ignores `psd`, so the two disagree. The walk makes at most eight queries.
code
pseudocode · 14 linesfunction org_domain(name):
labels = split(name)
if len(labels) >= 8: target = last_labels(name, 7)
else: target = parent(name)
found = []
loop until target is empty: # never more than 8 queries in all
recs = valid_dmarc_records("_dmarc." + target)
if len(recs) == 1:
found.append(target)
if recs[0].psd == "n": return target
if recs[0].psd == "y": return one_label_below(target, name)
target = parent(target)
if found is empty: return name
return fewest_labels(found)go deeper
Recall that a From domain without its own DMARC record is covered by a record found higher up the DNS tree.
Explain the order: Author Domain first, then the walk up, with the fewest-labels rule picking the organizational domain unless psd is set.
Show you can predict where RFC 9989 and RFC 7489 receivers diverge, especially on psd=n and deep names, and how reports reveal the method used.
Judge whether delegating subtrees with psd=n is worth the split policy and reporting it creates, against explicit records everywhere.
## Why the organizational domain matters here The **organizational domain** is the top of the part of the namespace under one administrative authority. DMARC uses it twice: to find the policy record for a `From:` domain that has no record of its own, and to judge relaxed alignment (covered in the material on DMARC alignment). This answer is about the first use: which record covers a subdomain. **RFC 7489** (2015) defined the organizational domain as the domain registered with a registrar and found it with a **Public Suffix List** (PSL): match the longest listed suffix, add one label. It mandated no particular list and no refresh schedule, and acknowledged that receivers using different lists could disagree. **RFC 9989** (May 2026) replaced the PSL with the **DNS tree walk**, which also absorbs PSD DMARC from RFC 9091. ## The tree walk, step by step Policy discovery first queries `_dmarc.<Author Domain>`. A valid record there supplies the policy from `p`. Otherwise the walk begins at the parent: 1. Query the target; discard any record not starting with `v=DMARC1`, and discard all of them if more than one is returned. 2. If a single record remains and it contains `psd=n` or `psd=y`, stop. 3. Remove the left-most label and repeat, until the walk stops or no labels remain. 4. If the name has eight or more labels, cut it to seven before walking, so no Author Domain causes more than **eight queries**. Then the organizational domain is chosen, from the longest name with a record to the shortest: - a record with `psd=n` makes that name the organizational domain; - a record with `psd=y` (a public suffix operator) makes the name one label below it the organizational domain; - otherwise, the name with the **fewest labels** that has a record wins. ```pseudocode author = "app.shop.example.com" if record_at("_dmarc." + author): use its p # none here walk: _dmarc.shop.example.com -> record, no psd, continue _dmarc.example.com -> record, no psd, continue _dmarc.com -> nothing org_domain = "example.com" # fewest labels with a record policy = exists(author) ? sp : np # each falls back to p if absent ``` ## The worked case | Records published | Mail From `app.shop.example.com` gets | Mail From `shop.example.com` gets | |---|---|---| | `example.com` and `shop.example.com`, neither with `psd` | `example.com`'s `sp` or `np` | `shop.example.com`'s `p` | | as above, but `shop.example.com` has `psd=n` | `shop.example.com`'s `sp` or `np` | `shop.example.com`'s `p` | | only `example.com` | `example.com`'s `sp` or `np` | `example.com`'s `sp` | The surprise is the first row: publishing a record at `shop.example.com` does not, by itself, make it govern the names below it. Only `psd=n` declares it an organizational domain. RFC 9989 section 5.1.8 describes exactly this use: a department in a large organisation declaring its own subtree with `psd=n` to set its own policy and report addresses. ## Where the two methods disagree - **A `psd=n` record.** The tree walk stops at it; a PSL receiver ignores `psd` as an unknown tag, takes `example.com` as the registered domain, and applies `example.com`'s `sp` or `np`. - **A suffix on the PSL whose operator publishes a record without `psd=y`.** A PSL receiver treats each name under that suffix as a separate organization; the tree walk, finding no `psd=y`, treats the suffix itself as the organizational domain. RFC 9989 says a public suffix operator that publishes a DMARC record MUST include `psd=y`. - **Deep names.** A `psd=n` record at a zone cut deeper than the eight-query window is never queried. RFC 9989 says owners who want a specific record applied to an Author Domain longer than eight labels MUST publish it at that exact name, which is always queried first. RFC 9989 Appendix C.3 names the remedy: the disagreement "is entirely avoided by the use of strict alignment and publishing explicit DMARC Policy Records for all Author Domains". Aggregate reports under the companion reporting RFC carry a discovery method of `psl` or `treewalk`, so an owner can see which receivers still use the old method. ## What a domain owner takes from this - Expect a subdomain's record to cover that name only, unless it carries `psd=n`. - Put the strictest record you rely on at every Author Domain that sends mail, not only at a parent. - Treat `psd=n` as a deliberate split of the namespace, with its own owner, reports and policy.
- How many DNS queries can an RFC 9989 tree walk make, and what happens with a twelve-label From domain?At most eight. The Author Domain is queried first; if it has eight or more labels, the walk then cuts it to seven labels and continues up one label at a time. A twelve-label name is queried once in full, then at seven labels, six, and so on to the top-level name. A record at a name of eight to eleven labels is never queried.
- Why can a record carrying psd=n produce different policies at different receivers?A receiver following RFC 9989 stops its tree walk at the `psd=n` record and treats that name as the organizational domain. A receiver still on RFC 7489 ignores `psd` as an unknown tag, takes the registered domain from a Public Suffix List, and applies the parent's `sp` or `np` instead. Explicit records at every sending name avoid the split.
- The nearest parent record always governs a subdomain
- RFC 9989 receivers still use the Public Suffix List
- The tree walk queries every label however long the name
- psd=n marks a domain as a public suffix
- A subdomain's record automatically covers all names below it