File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
v2rayN/ServiceLib/Services/CoreConfig/Singbox Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -148,15 +148,20 @@ private void GenDnsRules()
148148 _coreConfig . dns ??= new Dns4Sbox ( ) ;
149149 _coreConfig . dns . rules ??= [ ] ;
150150
151- _coreConfig . dns . rules . AddRange ( new [ ]
151+ _coreConfig . dns . rules . Add ( new ( ) { ip_accept_any = true , server = Global . SingboxHostsDNSTag } ) ;
152+
153+ if ( context . ProtectDomainList . Count > 0 )
152154 {
153- new Rule4Sbox { ip_accept_any = true , server = Global . SingboxHostsDNSTag } ,
154- new Rule4Sbox
155+ _coreConfig . dns . rules . Add ( new ( )
155156 {
156157 server = Global . SingboxDirectDNSTag ,
157158 strategy = Utils . DomainStrategy4Sbox ( simpleDnsItem . Strategy4Freedom ) ,
158159 domain = context . ProtectDomainList . ToList ( ) ,
159- } ,
160+ } ) ;
161+ }
162+
163+ _coreConfig . dns . rules . AddRange ( new [ ]
164+ {
160165 new Rule4Sbox
161166 {
162167 server = Global . SingboxRemoteDNSTag ,
You can’t perform that action at this time.
0 commit comments