diff --git a/v2rayN/ServiceLib/Sample/tun_singbox_inbound b/v2rayN/ServiceLib/Sample/tun_singbox_inbound index db5b0b32..b23346c1 100644 --- a/v2rayN/ServiceLib/Sample/tun_singbox_inbound +++ b/v2rayN/ServiceLib/Sample/tun_singbox_inbound @@ -1,6 +1,6 @@ { "type": "tun", - "tag": "tun-in", + "tag": "tun", "interface_name": "singbox_tun", "address": [ "172.18.0.1/30", 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..c3bcf616 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"], port = "53", outboundTag = Global.DnsOutboundTag, });