From 1412036b100eb15f89fd4683f7c855d2bf43f337 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sun, 17 May 2026 17:46:05 +0800 Subject: [PATCH] Fix --- v2rayN/ServiceLib/Sample/SampleTunInbound | 2 +- .../CoreConfig/Singbox/SingboxRoutingService.cs | 12 +++++++++--- .../Services/CoreConfig/V2ray/V2rayRoutingService.cs | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/v2rayN/ServiceLib/Sample/SampleTunInbound b/v2rayN/ServiceLib/Sample/SampleTunInbound index 95cefbc1..e9ac95e7 100644 --- a/v2rayN/ServiceLib/Sample/SampleTunInbound +++ b/v2rayN/ServiceLib/Sample/SampleTunInbound @@ -1,5 +1,5 @@ { - "tag": "tun", + "tag": "tun-in", "protocol": "tun", "settings": { "name": "xray_tun", diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs index 2b6bdf2b..b39312eb 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs @@ -87,8 +87,14 @@ public partial class CoreConfigSingboxService }); _coreConfig.route.rules.Add(new() { - protocol = ["dns"], - action = "hijack-dns" + type = "logical", + mode = "or", + action = "hijack-dns", + rules = + [ + new() { port = [53] }, + new() { protocol = ["dns"] }, + ], }); } else @@ -96,7 +102,7 @@ public partial class CoreConfigSingboxService _coreConfig.route.rules.Add(new() { port = [53], - action = "hijack-dns" + action = "hijack-dns", }); } diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs index 4f7431fc..5ad9ed9e 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs @@ -27,6 +27,7 @@ public partial class CoreConfigV2rayService }); _coreConfig.routing.rules.Add(new() { + inboundTag = ["tun-in"], port = "53", outboundTag = Global.DnsOutboundTag, });