fix: initialize DNS before NTP - #3103
Merged
Merged
Conversation
moooyo
pushed a commit
to moooyo/mihomo
that referenced
this pull request
Aug 20, 2026
上游 24 个提交,改动 30 个文件;其中与 fork 相交的只有 go.mod / go.sum 两个, 其余 28 个文件 fork 从未动过,属于纯上游内容。 上游带来的主要变化: - 安全:CVE-2026-56862(crypto/tls),随 metacubex/tls v0.1.8 一起进来。 - 修复:DNS 在 NTP 之前初始化(MetaCubeX#3103);OpenVPN 能扛住服务端发起的 soft reset 与 rekey(MetaCubeX#3109)。 - 特性:AmneziaWG v3.1;anytls 的 client-metadata(默认不发送); mipstack 支持 bbr3。 - 其余为 ZeroTier 数据面开销、gVisor / tailscale v1.102.2 等依赖推进。 go.mod / go.sum 的取舍: - 取上游的模块版本推进(mieru、amneziawg-go、mipstack、sing-tun、 sing-wireguard、tailscale、tls、zerotier-go、gvisor)。 - 保留 fork 自己的 go 1.25.0、以及 fork 引入的直接依赖 (brotli、cascadia、regexp2/v2、goja、gojq、tdewolff/parse、x/text) 和更高的 x/crypto、x/net、x/sync、x/sys、miekg/dns —— 上游那边仍停在 go 1.20 的兼容线上,这些不能回退。 - 核对过 go.sum:go.mod 里每一条 require 都有对应的 go.mod 与 zip 哈希, 无重复条目;唯一的例外 google.golang.org/protobuf 走 replace 指向 metacubex/protobuf-go,哈希记在被替换方,符合预期。 核对过 5gpn 标记在 99 个文件里的分布,合并前后逐文件计数完全一致, 没有 fork 意图被静默抹掉。 尚未验证:按约定不在本机跑 go build / go test,需在 test-env 上执行。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ohmycggk
pushed a commit
to ohmycggk/mihomo
that referenced
this pull request
Sep 3, 2026
ohmycggk
pushed a commit
to ohmycggk/mihomo
that referenced
this pull request
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Initialize Mihomo DNS before starting the NTP service.
ntp.serverdefaults to the hostnametime.apple.com.updateNTPstarts its first sync asynchronously immediately, but the existing startup order creates the DNS resolver only afterwards. On a cold start this makes the first NTP lookup race DNS initialization and can emit a misleading warning even when DNS becomes usable moments later.Reproduction
e183c58on OpenWrt, with DNS enabled and NTP enabled (default hostname server).updateNTP; shortly afterwardspool.ntp.organdtime.google.comresolve normally through Mihomo DNS.Change
Move
updateDNS(cfg.DNS, cfg.General.IPv6)beforeupdateNTP(cfg.NTP)inApplyConfig.This keeps all settings and NTP retry behavior unchanged, but ensures the resolver exists before the NTP goroutine begins its initial hostname lookup.
Validation
All commands completed successfully.