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 resolv operator 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 #

  1. Read the effective state:

    resolv status
    
  2. Query the failing name. For example:

    resolv query example.org
    resolv lookup example.org
    
  3. Compare an answer obtained without consulting the cache:

    resolv query example.org --no-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:

reg new Machine/System/Network/Dns/Hosts
reg set Machine/System/Network/Dns/Hosts printer sz:10.0.2.9
resolv query printer
resolv reverse 10.0.2.9

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 #

ObservationNext check
notfound from DNS or cacheCheck spelling and compare a query without cache lookup.
notfound locally for a bare nameCheck applicable search domains.
unavailableCheck the selected scope, its servers, and reachability.
netd disconnected, no scopesCheck netd; only local answers and configured fallbacks are available.
netd disconnected, scopes listedThese are the last snapshot, not a fresh view of the links.
A demoted serverCheck its failures; healthy servers are tried before demoted ones.
A stale answerCheck static overrides, then compare a query without cache lookup.
Access deniedInspect the native control permission separately from stub reachability.

Read the service log when startup or updates fail:

evctl 'LOGS FROM resolvd SINCE 1h ago TAKE 40'

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.

Edit this page