mirror of
https://github.com/2dust/v2rayN.git
synced 2026-03-22 08:20:03 +05:00
Fix DNS rule (#8866)
This commit is contained in:
@@ -148,15 +148,20 @@ public partial class CoreConfigSingboxService
|
|||||||
_coreConfig.dns ??= new Dns4Sbox();
|
_coreConfig.dns ??= new Dns4Sbox();
|
||||||
_coreConfig.dns.rules ??= [];
|
_coreConfig.dns.rules ??= [];
|
||||||
|
|
||||||
_coreConfig.dns.rules.AddRange(new[]
|
_coreConfig.dns.rules.Add(new() { ip_accept_any = true, server = Global.SingboxHostsDNSTag });
|
||||||
|
|
||||||
|
if (context.ProtectDomainList.Count > 0)
|
||||||
{
|
{
|
||||||
new Rule4Sbox { ip_accept_any = true, server = Global.SingboxHostsDNSTag },
|
_coreConfig.dns.rules.Add(new()
|
||||||
new Rule4Sbox
|
|
||||||
{
|
{
|
||||||
server = Global.SingboxDirectDNSTag,
|
server = Global.SingboxDirectDNSTag,
|
||||||
strategy = Utils.DomainStrategy4Sbox(simpleDnsItem.Strategy4Freedom),
|
strategy = Utils.DomainStrategy4Sbox(simpleDnsItem.Strategy4Freedom),
|
||||||
domain = context.ProtectDomainList.ToList(),
|
domain = context.ProtectDomainList.ToList(),
|
||||||
},
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_coreConfig.dns.rules.AddRange(new[]
|
||||||
|
{
|
||||||
new Rule4Sbox
|
new Rule4Sbox
|
||||||
{
|
{
|
||||||
server = Global.SingboxRemoteDNSTag,
|
server = Global.SingboxRemoteDNSTag,
|
||||||
|
|||||||
Reference in New Issue
Block a user