fix dns leak (#7110)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run

This commit is contained in:
DHR60 2025-04-12 10:00:18 +08:00 committed by GitHub
parent 519e588124
commit cf59137481
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View file

@ -210,6 +210,7 @@ public class DnsServer4Ray
{ {
public string? address { get; set; } public string? address { get; set; }
public List<string>? domains { get; set; } public List<string>? domains { get; set; }
public bool? skipFallback { get; set; }
} }
public class Routing4Ray public class Routing4Ray

View file

@ -15,6 +15,7 @@
}, },
{ {
"address": "223.5.5.5", "address": "223.5.5.5",
"skipFallback": true,
"domains": [ "domains": [
"geosite:cn" "geosite:cn"
], ],

View file

@ -1185,6 +1185,7 @@ public class CoreConfigV2rayService
var dnsServer = new DnsServer4Ray() var dnsServer = new DnsServer4Ray()
{ {
address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress, address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress,
skipFallback = true,
domains = [node.Address] domains = [node.Address]
}; };
servers.AsArray().Add(JsonUtils.SerializeToNode(dnsServer)); servers.AsArray().Add(JsonUtils.SerializeToNode(dnsServer));