5.3 Requests
The requests, their fields and their reply shapes are PSPU §6.5. This article covers what resolvd accepts and what it fills in.
5.3.1 Common to every request #
A request that passes the access check (§5.2) is handled at once:
statusandflushare answered within the same loop iteration;- the other three become engine questions (§4.1), and the connection is held until the engine answers; the reply is written then.
5.3.2 resolve #
| Field | Accepted |
|---|---|
name | Any string: no name is refused at decoding. It is handed to the engine as it is, which parses it (§4.1). |
type | Any value from 0 to 65 535, forwarded as it is — ANY (255), OPT (41) and types resolvd has no parser for included. |
no_cache | Boolean; absent means false. Skips the cache lookup (§4.5). |
The reply's outcome, source, server, interface and rcode are
as §4.1 describes. Each record carries:
| Key | Content |
|---|---|
name | The owner name in presentation form, without a trailing dot; the root is .. A dot or backslash inside a label is written \. or \\, and any byte outside ! to ~ as a backslash and three decimal digits. |
type | The record type number |
ttl | As sent by the server, lowered on a cache hit (§4.5); 0 for a synthetic record |
data | The record data in uncompressed wire form |
text | The record data in presentation form (below) |
| Type | text |
|---|---|
A, AAAA | The address |
CNAME, PTR, NS | The target name, written as name is |
SOA | mname rname serial refresh retry expire minimum |
MX | preference exchange |
SRV | priority weight port target |
TXT | Each string in double quotes, separated by spaces; inner quotes are escaped as \", backslashes are not escaped, and bytes that are not UTF-8 become U+FFFD |
| Anything else | \# <length> <hex>, the hex in lower case |
5.3.3 The lookup family #
family takes any, inet or inet6. Absent, or any other string,
means any. The reply is built as §4.9 describes.
5.3.4 The reverse address #
address is an IPv4 or IPv6 address in textual form; anything else is
the error missing or malformed field address. The question is built as
§4.9 describes.
5.3.5 status #
| Key | Content |
|---|---|
hostname | The hostname in use (§3.3), or an empty string when there is none |
netd | Whether the netd channel is connected at this moment |
scopes | Every scope in the latest snapshot, in snapshot order — including scopes with no servers and scopes that take no part in routing |
fallback_servers | FallbackServers as parsed (§2.3) |
cache_entries | The number of entries held, expired ones included (§4.5) |
counters | §4.10 |
5.3.5.1 Each scope in status #
Each scope carries interface (the interface name), servers and
domains as parsed from the snapshot (§3.3), default_route,
exclusive, metric, subnets, and demoted:
subnetsholds the interface's addresses asaddress/prefix— the address itself, not the network it is in;demotedholds those of the scope's servers that are demoted at this moment (§4.6);- a scope's
levelis not reported.