Fixed a bug in dns rule processing when outbound in routing rules is a other server

This commit is contained in:
2dust
2025-08-13 21:19:51 +08:00
parent 0fb6b2e54b
commit f45290eb3a

View File

@@ -1862,7 +1862,13 @@ public class CoreConfigSingboxService
} }
} }
} }
else if (item.OutboundTag == Global.ProxyTag) else if (item.OutboundTag == Global.BlockTag)
{
rule.action = "predefined";
rule.rcode = "NOERROR";
rule.answer = new List<string> { "A" };
}
else
{ {
if (simpleDNSItem.FakeIP == true) if (simpleDNSItem.FakeIP == true)
{ {
@@ -1873,12 +1879,6 @@ public class CoreConfigSingboxService
rule.server = Global.SingboxRemoteDNSTag; rule.server = Global.SingboxRemoteDNSTag;
rule.strategy = string.IsNullOrEmpty(simpleDNSItem.SingboxStrategy4Proxy) ? null : simpleDNSItem.SingboxStrategy4Proxy; rule.strategy = string.IsNullOrEmpty(simpleDNSItem.SingboxStrategy4Proxy) ? null : simpleDNSItem.SingboxStrategy4Proxy;
} }
else if (item.OutboundTag == Global.BlockTag)
{
rule.action = "predefined";
rule.rcode = "NOERROR";
rule.answer = new List<string> { "A" };
}
singboxConfig.dns.rules.Add(rule); singboxConfig.dns.rules.Add(rule);
} }