From cf5913748109cfc50529297a9b1dac5a8722ac60 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sat, 12 Apr 2025 10:00:18 +0800 Subject: [PATCH] fix dns leak (#7110) --- v2rayN/ServiceLib/Models/V2rayConfig.cs | 1 + v2rayN/ServiceLib/Sample/dns_v2ray_normal | 1 + v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/V2rayConfig.cs index d080d14c..2e5ed4b4 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/V2rayConfig.cs @@ -210,6 +210,7 @@ public class DnsServer4Ray { public string? address { get; set; } public List? domains { get; set; } + public bool? skipFallback { get; set; } } public class Routing4Ray diff --git a/v2rayN/ServiceLib/Sample/dns_v2ray_normal b/v2rayN/ServiceLib/Sample/dns_v2ray_normal index 9aecbd6e..3f9c8b22 100644 --- a/v2rayN/ServiceLib/Sample/dns_v2ray_normal +++ b/v2rayN/ServiceLib/Sample/dns_v2ray_normal @@ -15,6 +15,7 @@ }, { "address": "223.5.5.5", + "skipFallback": true, "domains": [ "geosite:cn" ], diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs index 1bd23872..95511836 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs @@ -1185,6 +1185,7 @@ public class CoreConfigV2rayService var dnsServer = new DnsServer4Ray() { address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress, + skipFallback = true, domains = [node.Address] }; servers.AsArray().Add(JsonUtils.SerializeToNode(dnsServer));