Leadaxe 说明 lx 分支补齐 app_dns 应答、来源与缓存诊断属性

Leadaxe 表示,sing-box-lx 的 lx 分支已补充连接检查 app_dns 的诊断属性:每条应答单独输出 answer,包含 TTL 与 HTTPS 的 SvcParam;区分 network、cache、local 来源,缓存附 cache_age,并标记过期缓存应答;NXDOMAIN/NODATA 按记录输出 authority。此次仅调整属性,不改 .proto。他表示 daemon 与 DNS 测试已在 -race 下验证,尚未进行设备实测,issue 继续保持开启。

作者原文

The app_dns request from the field run is on lx as of aaf212857. Attributes only, no .proto change.

  1. One answer per record, in answer-section order, in presentation format without the class: A 300 192.0.2.1, CNAME 300 youtube-ui.l.google.com., HTTPS 300 1 . alpn="h2,h3" ech="…" ipv4hint="…". The owner name leads only when it differs from the queried name, so after a CNAME the address shows whose it is: youtube-ui.l.google.com. A 300 142.251.154.119. SvcParam values are quoted the way dig prints them. The joined answers attr is gone.
  2. Answer source: source=network, source=cache with cache_age in seconds (and stale=true for an expired answer served while a refresh runs), or source=local for fakeip and hosts, where the core answers without a query. No source when a rule answers by itself (predefined, reject). The cached dns stage under app_dns carries cache_age too, at every nesting level.
  3. Authority on NXDOMAIN/NODATA: one authority per record in the same format, e.g. google.com. SOA 30 ns1.google.com. dns-admin.google.com. …. The TTL is the one the negative answer is cached with, min(SOA TTL, minimum).

Commits: 45a36e298 cache_age on the cached dns stage, 366d05f59 the two // lx: lines in dns/client.go, 66cd4e9af and 0306f5e1c the app_dns attrs and a test through a real DNS router (UDP server, CNAME chain, NODATA, NXDOMAIN, fakeip, hosts), 359733c56 and aaf212857 SPEC §4 and TASKS.

Verified under -race in the daemon and dns tests, not yet on a device. The issue stays open until that run.