4.9 Lookup and Reverse
4.9.1 lookup #
A lookup (PSPU §6.5) asks for A, AAAA, or both:
4.9.1.1 Each task is an ordinary question #
Each task is an ordinary question (§4.1): it has its own synthetic
check, its own expansion, its own routing per candidate, its own cache
lookups and its own attempts. The two tasks of an any lookup run at
the same time and can be answered from different sources. The reply is
built when the last of them is done.
4.9.1.2 The outcome #
| Tasks' outcomes | outcome |
|---|---|
At least one found, with or without records | found |
None found, at least one unavailable | unavailable |
Every one notfound | notfound |
An A answer and an AAAA that is unavailable is found, with IPv4
addresses only.
4.9.1.3 Chasing CNAMEs #
For each found task, resolvd looks for addresses in that task's
answer records, starting at the candidate the answer was found at.
Names are compared case-insensitively.
- If the first record at the current name is a
CNAME, and no record of the asked type is at the current name, the chase moves to theCNAME's target. - This repeats at most 16 times; a loop stops there.
- The addresses are the
A(for theAtask) orAAAA(for theAAAAtask) records at the name the chase ended at, in answer order, each with its record's TTL.
4.9.1.4 The chase asks nothing further #
Only the records in the task's own answer are used. A chain that leaves
them — a CNAME whose target's addresses the server did not include —
ends with no addresses, and no further question is asked.
4.9.1.5 The reply fields #
addresseslists each finished task's addresses in turn, in the order the tasks finished, so whether IPv4 or IPv6 addresses come first depends on which family was answered first.canonicalandsourcecome from the same selectedfoundtask. Prefer a task that produced addresses; when both or neither did, preferAoverAAAA. Completion order does not affect this choice.canonicalis the name that task's CNAME chase ended at, after search expansion. Without afoundtask it is the name asked, as parsed, in presentation form without a trailing dot (the root is.).- A
foundwith no addresses still reports the expanded or chased name. - A name that does not parse is answered at once with
outcomenotfound,canonical., no addresses andsourcelocal; no task is started. sourceis the source of the selected task, andlocalwhen no task wasfound. It describes that task; the other family's records can have a different source.validationisunvalidated.- A
lookupadds one toquerieshowever many tasks it makes.
4.9.2 reverse becomes a PTR question #
A reverse turns its address into the reverse-mapping name — the four
octets reversed under in-addr.arpa for IPv4, the 32 nibbles reversed,
in lower-case hexadecimal, under ip6.arpa for IPv6 — and resolves that
name for PTR exactly as a resolve without no_cache would. The
reply is an ordinary answer (§5.3).