Diagnosing Name Resolution
Use resolv to identify whether a name is missing, resolution is unavailable,
or an unexpected interface is being used. Interface DNS policy belongs to
netd. resolvd applies that policy and machine-wide fallback and static-name
settings.
Before you start #
- Install resolvd and the
resolvoperator command. - Identify the failing name and the network it should use.
- Obtain registry write access before changing policy. Queries use the resolver's separate query permission, granted publicly by default.
resolv(1) owns command syntax and exit statuses. The regman entry for
Machine\System\Network\Dns owns machine-wide settings. Do not edit
/etc/hosts, /etc/resolv.conf, or nsswitch.conf to change this policy.
Check a name first #
-
Read the effective state:
-
Query the failing name. For example:
-
Compare an answer obtained without consulting the cache:
The final command bypasses cache lookup but can store the resulting answer. Read the reported outcome, source, server, and interface. If connecting to an address also fails, investigate connectivity.
Where the servers come from #
netd sends resolvd each interface's servers, domains, and addresses as a
scope. Compare the scopes in resolv status with net status and the
intended interface profile.
Use Configuring Profiles to change offered or explicit interface DNS settings. A profile change can restart address clients; follow that guide's recovery checks.
Machine-wide fallback servers, extra search domains, and static names live
under Machine\System\Network\Dns. They apply after a successful complete
configuration read. A read failure retains the previous configuration and is
logged. A lost registry watch can prevent later changes from being observed.
Verify which interface gets a name #
A query selects one scope. The order is exclusive scope, longest matching search domain, matching reverse subnet, default route, then lowest metric among up scopes with servers. Fallback servers are considered only when no earlier step chooses a scope.
An exclusive scope must be at addressed or better. It still wins without
servers; upstream work then becomes unavailable rather than using another
interface. At link alone, the exclusive rule does not apply. Verify the
interface state as well as its flags when diagnosing VPN name routing.
A bare name such as printer requires a search domain. All up scopes can
contribute domains, including scopes without servers. A qualifying exclusive
scope supplies only its own domains. With no applicable domain, a bare name
is answered locally as not found and is never sent upstream unchanged.
See the routing and search expansion chapters for tie-breaking and failure behavior.
Static names #
With registry write access, add a static name when this machine should answer it without DNS. Replace the sample address with the intended host:
Verify both directions. Static names apply without a cache flush after the
configuration is read. Synthetic localhost names take precedence over static
names. The synthetic-name
chapter
describes hostname, reverse, and .local handling.
The resolv command #
resolv query reports individual records and where the answer came from.
resolv lookup returns addresses and a canonical name. resolv reverse
queries names for an address. resolv status reports scopes and counters.
resolv flush clears the shared cache and requires the resolver control
right. Registry editing has separate permissions. Every command exchange
has a ten-second deadline; a failed exchange is not evidence that a name
is absent. See resolv(1) for scripting contracts.
Not found versus unavailable #
| Observation | Next check |
|---|---|
notfound from DNS or cache | Check spelling and compare a query without cache lookup. |
notfound locally for a bare name | Check applicable search domains. |
unavailable | Check the selected scope, its servers, and reachability. |
| netd disconnected, no scopes | Check netd; only local answers and configured fallbacks are available. |
| netd disconnected, scopes listed | These are the last snapshot, not a fresh view of the links. |
| A demoted server | Check its failures; healthy servers are tried before demoted ones. |
| A stale answer | Check static overrides, then compare a query without cache lookup. |
| Access denied | Inspect the native control permission separately from stub reachability. |
Read the service log when startup or updates fail:
A restart replaces resolvd's stale socket and clears transient state. Do not remove its runtime directory as a routine diagnostic step. Inspect permissions and the exact startup error using the failure guide.
Three doors #
Programs reach the same resolver engine through the native socket, the local
DNS stub at 127.0.0.53, or glibc's Name Service Switch (NSS) module.
Native applications can use libresolvd.so; other DNS clients use the
constant resolver configuration pointing at the stub.
A direct query to another server tests that server and bypasses normal scope selection. It does not establish how Peios applications resolve the name.
Implementation boundaries {#what-is-not-there-yet} #
resolvd does not implement DNSSEC validation, DNS over TLS, multicast DNS,
or per-program resolution policy. Answers report unvalidated. Allowed
callers use the same policy; native query access controls permission to ask.
Going deeper #
- PSPU, Name Resolution Interface, defines the protocol contract. defines request and outcome contracts.
- resolvd TRM explains the implementation and its limits.
- netd's resolver channel describes the live network information sent to resolvd.