mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-03 02:55:01 +03:00
Try fix dns (#10485)
This commit is contained in:
@@ -214,6 +214,7 @@ public class DnsServer4Ray
|
|||||||
public List<string>? domains { get; set; }
|
public List<string>? domains { get; set; }
|
||||||
public bool? skipFallback { get; set; }
|
public bool? skipFallback { get; set; }
|
||||||
public List<string>? expectedIPs { get; set; }
|
public List<string>? expectedIPs { get; set; }
|
||||||
|
public bool? finalQuery { get; set; }
|
||||||
public string? tag { get; set; }
|
public string? tag { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -374,13 +374,20 @@ public partial class CoreConfigV2rayService
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach (var dnsAddress in dnsAddresses)
|
//foreach (var dnsAddress in dnsAddresses)
|
||||||
|
for (var i = 0; i < dnsAddresses.Count; i++)
|
||||||
{
|
{
|
||||||
|
var dnsAddress = dnsAddresses[i];
|
||||||
var dnsServer = CreateDnsServer(dnsAddress, domains, expectedIPs);
|
var dnsServer = CreateDnsServer(dnsAddress, domains, expectedIPs);
|
||||||
if (isDirectDns)
|
if (isDirectDns)
|
||||||
{
|
{
|
||||||
dnsServer.tag = $"{Global.DirectDnsTag}-{directDnsTagIndex++}";
|
dnsServer.tag = $"{Global.DirectDnsTag}-{directDnsTagIndex++}";
|
||||||
}
|
}
|
||||||
|
if (expectedIPs is not null
|
||||||
|
&& i == expectedIPs.Count - 1)
|
||||||
|
{
|
||||||
|
dnsServer.finalQuery = true;
|
||||||
|
}
|
||||||
var dnsServerNode = JsonUtils.SerializeToNode(dnsServer);
|
var dnsServerNode = JsonUtils.SerializeToNode(dnsServer);
|
||||||
dnsItem.servers.Add(dnsServerNode);
|
dnsItem.servers.Add(dnsServerNode);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user