From cba60703001d6f7a7a1d6ee8931b03c27fbf6033 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 24 Nov 2025 16:43:24 +0000 Subject: [PATCH] fix(dns): prevent dns restart crash if `DOT=off` and `DNS_KEEP_NAMESERVER=off` --- internal/dns/run.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/dns/run.go b/internal/dns/run.go index b8cef81f..ce657f09 100644 --- a/internal/dns/run.go +++ b/internal/dns/run.go @@ -74,7 +74,8 @@ func (l *Loop) runWait(ctx context.Context, runError <-chan error) (exitLoop boo for { select { case <-ctx.Done(): - if !*l.GetSettings().KeepNameserver { + settings := l.GetSettings() + if !*settings.KeepNameserver && *settings.DoT.Enabled { l.stopServer() // TODO revert OS and Go nameserver when exiting } @@ -82,7 +83,8 @@ func (l *Loop) runWait(ctx context.Context, runError <-chan error) (exitLoop boo case <-l.stop: l.userTrigger = true l.logger.Info("stopping") - if !*l.GetSettings().KeepNameserver { + settings := l.GetSettings() + if !*settings.KeepNameserver && *settings.DoT.Enabled { const fallback = false l.useUnencryptedDNS(fallback) l.stopServer()