mirror of
https://github.com/2dust/v2rayN.git
synced 2026-03-12 19:33:01 +00:00
Fix DNS rule (#8866)
This commit is contained in:
parent
a71ebbd01c
commit
56f1794e47
1 changed files with 9 additions and 4 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue