diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs index a01b624e..9faf4df3 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs @@ -187,9 +187,9 @@ public partial class CoreConfigV2rayService foreach (var profile in new[] { subItem.PrevProfile, subItem.NextProfile }) { var profileNode = await AppManager.Instance.GetProfileItemViaRemarks(profile); - if (profileNode is not null && - Global.XraySupportConfigType.Contains(profileNode.ConfigType) && - Utils.IsDomain(profileNode.Address)) + if (profileNode is not null + && Global.XraySupportConfigType.Contains(profileNode.ConfigType) + && Utils.IsDomain(profileNode.Address)) { directDomainList.Add(profileNode.Address); } @@ -217,11 +217,11 @@ public partial class CoreConfigV2rayService AddDnsServers(directDNSAddress, directGeositeList); AddDnsServers(directDNSAddress, expectedDomainList, expectedIPs); - var useDirectDns = rules?.LastOrDefault() is { } lastRule && - lastRule.OutboundTag == Global.DirectTag && - (lastRule.Port == "0-65535" || - lastRule.Network == "tcp,udp" || - lastRule.Ip?.Contains("0.0.0.0/0") == true); + var useDirectDns = rules?.LastOrDefault() is { } lastRule + && lastRule.OutboundTag == Global.DirectTag + && (lastRule.Port == "0-65535" + || lastRule.Network == "tcp,udp" + || lastRule.Ip?.Contains("0.0.0.0/0") == true); var defaultDnsServers = useDirectDns ? directDNSAddress : remoteDNSAddress; v2rayConfig.dns.servers.AddRange(defaultDnsServers);