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:

  • status and flush are 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 #

FieldAccepted
nameAny string: no name is refused at decoding. It is handed to the engine as it is, which parses it (§4.1).
typeAny value from 0 to 65 535, forwarded as it is — ANY (255), OPT (41) and types resolvd has no parser for included.
no_cacheBoolean; 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:

KeyContent
nameThe 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.
typeThe record type number
ttlAs sent by the server, lowered on a cache hit (§4.5); 0 for a synthetic record
dataThe record data in uncompressed wire form
textThe record data in presentation form (below)
Typetext
A, AAAAThe address
CNAME, PTR, NSThe target name, written as name is
SOAmname rname serial refresh retry expire minimum
MXpreference exchange
SRVpriority weight port target
TXTEach 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 #

KeyContent
hostnameThe hostname in use (§3.3), or an empty string when there is none
netdWhether the netd channel is connected at this moment
scopesEvery scope in the latest snapshot, in snapshot order — including scopes with no servers and scopes that take no part in routing
fallback_serversFallbackServers as parsed (§2.3)
cache_entriesThe 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:

  • subnets holds the interface's addresses as address/prefix — the address itself, not the network it is in;
  • demoted holds those of the scope's servers that are demoted at this moment (§4.6);
  • a scope's level is not reported.

5.3.6 flush #

  • Every cache entry, for every scope, is discarded, resolvd logs cache flushed at info level, and the reply is ok: true with no kind.
  • Demotions and counters are left as they are.

Edit this page