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

pull/7754/head
2dust 2025-08-13 21:19:51 +08:00
parent 0fb6b2e54b
commit f45290eb3a
1 changed files with 7 additions and 7 deletions

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)
{
@ -1873,12 +1879,6 @@ public class CoreConfigSingboxService
rule.server = Global.SingboxRemoteDNSTag;
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);
}