Files
EasyTier/easytier/src/instance
KKRainbow 969bf4948a feat(dns): add native per-domain desktop resolver integration (#2832)
* feat(dns): configure native per-domain system resolvers

Add native split DNS adapters for systemd-resolved, Windows NRPT and
macOS resolver files. Refuse automatic Linux integration when resolved
is not in the query path; retain the existing DNS server and root
forwarder.

Elect the shared server and install its packet handler and fake-IP route
before enabling system DNS. Serialize DNS record and OS updates, retain
empty authorities across partial failures, and refresh native settings
without restarting publishers.

Attempt to restore resolved link settings on explicit instance stop and
scope Windows/macOS cleanup to EasyTier markers. Keep finite D-Bus
waits, possible remote late writes and best-effort shared-link cleanup.
macOS writes requested regular files directly and does not restore
originals.

Exclude resolv.conf takeover, recovery/forwarder overrides and generic
process-exit handling. Preserve upstream same-zone publisher tests and
add private D-Bus and temporary-file lifecycle coverage.

Validation: DNS suite in the root rust container, run serially: 52
passed and one legacy-core test ignored. Strict full all-target clippy,
fmt and diff checks pass. Private D-Bus and file fixtures do not
establish real systemd-resolved or native Windows/macOS daemon
integration.

* fix(dns): disable resolved TLS on the Magic DNS link

A link inherits strict global DNS-over-TLS when no override is set, but
Magic DNS serves UDP/53. Snapshot the link effective mode with the other
owned settings and set it to no during setup and maintenance. Restore
the observed mode on close and track partial writes.

The D-Bus property exposes effective mode, so restoration does not
reconstruct whether the link originally inherited its value. Keep the
existing generation and timeout behavior, including possible late
writes.

Extend the private D-Bus fixture to cover mode restoration, partial
failure and networkd fallback. All 20 resolved tests pass; fmt and
strict workspace all-target clippy pass. Real resolved strict-DoT
queries remain unverified.

* fix(dns): preserve Windows DNS setup and cleanup retries

Allow missing IPv4 or IPv6 interface registry keys when checking and
updating search suffixes. Do not create missing protocol keys; retain
access errors and external-change checks on existing keys. Adapt the
existing lifecycle test to optional protocol keys.

Clear in-memory NRPT and search-list ownership immediately after durable
recovery cleanup succeeds, before attempting the DNS cache flush. Keep
flush errors visible without carrying stale ownership into a retry.
Leave state intact when recovery cleanup fails.

Windows GNU all-target cargo check passes. Linux strict workspace
all-target clippy and fmt pass; Windows-native registry and
flush-failure behavior was not executed.

* fix(dns): disable resolved DNSSEC for native Magic DNS

Private Magic DNS answers are unsigned. A link inheriting strict
systemd-resolved DNSSEC can reject the default et.net records even when
the fake-IP path returns the intended answers.

Include the sampled effective DNSSEC mode in the existing link state.
Set it to no before publishing DNS servers or domains and restore the
sampled mode after withdrawing them. Reuse partial-write tracking,
same-link maintenance, networkd delegation and owner-change handling.
The D-Bus property cannot distinguish an inherited mode from an explicit
one, so cleanup restores the sampled effective value.

Cover ordering, permission denial, partial cleanup, retries, maintenance
and owner changes with the existing private-bus fixtures. Give simulated
AccessDenied and UnknownMethod errors their exact D-Bus names rather
than the generic zbus wrapper name.

Validation:
- 23 resolved tests passed in the root rust container.
- Workspace fmt and strict all-target clippy with full features passed.
- Real isolated systemd-resolved 261.2 with global DNSSEC=yes resolved
  default et.net records and authenticated a separate signed control.
- Runtime updates and explicit stop cleaned the native link; a surviving
  link manager restored the sampled yes mode, with host DNS unchanged.

No NTA, resolver-file takeover or general process-exit changes.
2026-11-15 22:14:35 +08:00
..
2026-10-13 21:00:03 +08:00