diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/V2rayConfig.cs index 354e33dc..702bbae1 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/V2rayConfig.cs @@ -203,8 +203,15 @@ public class Response4Ray public class Dns4Ray { - public Dictionary>? hosts { get; set; } + public Dictionary? hosts { get; set; } public List servers { get; set; } + public string? clientIp { get; set; } + public string? queryStrategy { get; set; } + public bool? disableCache { get; set; } + public bool? disableFallback { get; set; } + public bool? disableFallbackIfMatch { get; set; } + public bool? useSystemHosts { get; set; } + public string? tag { get; set; } } public class DnsServer4Ray @@ -214,6 +221,12 @@ public class DnsServer4Ray public bool? skipFallback { get; set; } public List? expectedIPs { get; set; } public List? unexpectedIPs { get; set; } + public string? clientIp { get; set; } + public string? queryStrategy { get; set; } + public int? timeoutMs { get; set; } + public bool? disableCache { get; set; } + public bool? finalQuery { get; set; } + public string? tag { get; set; } } public class Routing4Ray diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs index 43911046..a91c4549 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs @@ -1340,10 +1340,13 @@ public class CoreConfigV2rayService return await Task.FromResult(0); } v2rayConfig.dns ??= new Dns4Ray(); - v2rayConfig.dns.hosts ??= new Dictionary>(); + v2rayConfig.dns.hosts ??= new Dictionary(); if (simpleDNSItem.AddCommonHosts == true) { - v2rayConfig.dns.hosts = Global.PredefinedHosts; + v2rayConfig.dns.hosts = Global.PredefinedHosts.ToDictionary( + kvp => kvp.Key, + kvp => (object)kvp.Value + ); } if (simpleDNSItem.UseSystemHosts == true)