systemd-resolved: README names uplink-names, its files and the guard's new duty (issue 960)
Says the verb and its answer, the two new files (uplink-names, its applied record) and fallback.json, the guard's round over the default- route link, the sudo -n install / mv -f commands, and that uplink-names only sets how resolved answers those names over a link, never the link itself. Builds: design 08 sign-in-page §10
This commit is contained in:
@@ -20,6 +20,10 @@ itself (NetworkManager's VPNs, WireGuard set up by networkd, Tailscale) needs no
|
||||
| `/etc/node-resolver/suffix` | the mesh's own domain, which a route may never take |
|
||||
| `/etc/systemd/resolved.conf.d/50-mesh.conf` | every mesh resolver as the default route for names (`DNS=`, `Domains=~.`), no public fallback, the stub on loopback and on the private address, no cache, no LLMNR or mDNS |
|
||||
| `/etc/node-resolver/answer-within` | the config value `answer-within`: how long the guard gives each of the mesh's resolvers to answer before it takes them for silent (issue 1981) |
|
||||
| `/etc/node-resolver/private-interface` | the private network's own interface name, so the guard never gives the uplink's names to it (design 08 sign-in-page §7, DQ-1) |
|
||||
| `/var/lib/node-resolver/uplink-names` | the host names `uplink-names` gave, one a line, root's, written through `sudo -n install` then `sudo -n mv -f` (§6); stays until an empty list or a person's cleanup, even once the module leaves |
|
||||
| `/var/lib/node-resolver/uplink-names.applied` | the guard's own record of what it last gave the link carrying the default route: the names, the link, when, and resolved's refusal or empty (§8); read at the guard's start, so a restart takes the names off the link it names, never inferring which |
|
||||
| `/run/node-resolver/fallback.json` | whether the mesh's resolvers are silent now, by ADR 0688's guard, and since when; `routes`' `mesh_resolvers` field reads it; gone at the next boot, and the guard's first round writes it again |
|
||||
|
||||
**On the private address, so containers reach it.** A container copies its machine's resolver file and
|
||||
cannot reach the machine's loopback, so the file names the address the machine has on the private
|
||||
@@ -61,6 +65,20 @@ One long-running process, as root: `resolver-tools guard`.
|
||||
its journal, and the node's network check still says the mesh's names do not resolve.
|
||||
- **What it says elsewhere** — the `routes` verb's `outside_writes`, from `/run/node-resolver/history.json`
|
||||
— is when, the writer's name and what became of each write. It never includes a server or a domain.
|
||||
- **It gives the uplink's holder's check names to the link carrying the default route.** Every round it
|
||||
reads `/var/lib/node-resolver/uplink-names` and finds the link that carries the default route: among the
|
||||
kernel's IPv4 default routes, or the IPv6 ones when there is none, the one with the lowest metric whose
|
||||
link is neither one `route` routed (a VPN's) nor the private network's own interface (its own fact,
|
||||
`/etc/node-resolver/private-interface`); none when there is no such link. It gives that link its own
|
||||
domains plus one routing-only domain `~<name>` per name, keeping every search domain and routing domain it
|
||||
already has, and takes the names off the link they were on before, when that differs: never a link's
|
||||
servers, its default route for names (that stays the fallback's alone), its addresses or its routes. It
|
||||
never counts its own names when it judges whether a link is `route` routed, so a link holding only them
|
||||
still has its default route given back by the fallback while the mesh's resolvers are silent. What it
|
||||
gave is kept in `/var/lib/node-resolver/uplink-names.applied`, read at the guard's own start, so a
|
||||
restart never infers which link to take them off; a refusal by resolved is journalled once per change,
|
||||
never every round. `uplink-names` only sets how resolved answers those names over a link — never the
|
||||
link itself, which the network manager chooses.
|
||||
|
||||
## Its verbs
|
||||
|
||||
@@ -68,14 +86,16 @@ On the mesh, through the node's runtime as the operator account (writes escalate
|
||||
|
||||
| verb | does |
|
||||
|---|---|
|
||||
| `<node>/node-resolver.routes` (r) | the mesh's resolvers, each link given servers of its own with its routed domains and whether it is a default route, and the resolver file's outside writes |
|
||||
| `<node>/node-resolver.routes` (r) | the mesh's resolvers, each link given servers of its own with its routed domains and whether it is a default route, and the resolver file's outside writes. Also `uplink_names {names, link, refused}` (the applied list's names resolved holds on that link now, never the file's) and `mesh_resolvers {silent, since}` (ADR 0688's fallback). The machine's own socket answers the same |
|
||||
| `<node>/node-resolver.route` (a) | `{link, domains, servers}`: these domains, and every name under them, to these servers over this link, and only them. The mesh's own domain and the root are refused |
|
||||
| `<node>/node-resolver.unroute` (a) | `{link}`: that link's domains go to the mesh's resolvers again |
|
||||
| `<node>/node-resolver.uplink-names` (a) | `{names}`: at most 8 host names (letters, digits, hyphens and dots, lower-cased); an empty list takes them away. Writes `/var/lib/node-resolver/uplink-names` whole, through `sudo -n install -m 0644 -o root -g root /dev/stdin uplink-names.new` then `sudo -n mv -f uplink-names.new uplink-names`. Answers `{names, link, set_at}`: the names now given, the link they are answered over now (empty when no link carries a default route), and when. Refused, naming the name and why: not a host name (a wildcard, a trailing dot, a label over 63 bytes), the root, the mesh's own domain or under it, or more than 8 names |
|
||||
|
||||
**On the machine, to its own root processes**, over `/run/node-resolver/verbs.sock` (mode 0600). The path
|
||||
is the seat's, so a caller does not need to know which holder answers. The protocol is one JSON line
|
||||
`{"verb": …, "args": {…}}` and one JSON line back, `{"result": …}` or `{"error": "…"}`. The verbs are the
|
||||
same three, plus:
|
||||
`{"verb": …, "args": {…}}` and one JSON line back, `{"result": …}` or `{"error": "…"}`. The verbs are
|
||||
`routes`, `route` and `unroute` (`uplink-names` is the bus's alone, never the machine's: its caller is
|
||||
always on the bus), plus:
|
||||
|
||||
- `displaced`: the write standing now, with what it held, or null;
|
||||
- `route` with `takes` (the write's `id`) and `by` (the module's name): route, then take that write, so
|
||||
|
||||
Reference in New Issue
Block a user