From 870955fee18a61e924f3cc32cd53b023d4ecd7b1 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 11 Apr 2024 08:07:21 +0800 Subject: [PATCH] Bug fix --- v2rayN/v2rayN/Handler/CoreConfigSingbox.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs index 37b0a235..d63f997e 100644 --- a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs +++ b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs @@ -1045,6 +1045,12 @@ namespace v2rayN.Handler { dnsServer.detour = singboxConfig.route.rules.LastOrDefault()?.outbound; } + var dnsRule = singboxConfig.dns?.rules.Where(t => t.outbound != null).FirstOrDefault(); + if (dnsRule != null) + { + singboxConfig.dns.rules = []; + singboxConfig.dns.rules.Add(dnsRule); + } //msg = string.Format(ResUI.SuccessfulConfiguration"), node.getSummary()); return 0;