mirror of https://github.com/2dust/v2rayN
Uses correct DNS strategy for direct connections
parent
687becd59c
commit
a90fb8eed4
|
@ -1245,16 +1245,18 @@ public class CoreConfigSingboxService
|
||||||
var item = _config.SimpleDNSItem;
|
var item = _config.SimpleDNSItem;
|
||||||
|
|
||||||
var defaultDomainResolverTag = Global.SingboxOutboundResolverTag;
|
var defaultDomainResolverTag = Global.SingboxOutboundResolverTag;
|
||||||
|
var directDNSStrategy = item.SingboxStrategy4Direct.IsNullOrEmpty() ? Global.SingboxDomainStrategy4Out.FirstOrDefault() : item.SingboxStrategy4Direct;
|
||||||
|
|
||||||
var rawDNSItem = await AppHandler.Instance.GetDNSItem(ECoreType.sing_box);
|
var rawDNSItem = await AppHandler.Instance.GetDNSItem(ECoreType.sing_box);
|
||||||
if (rawDNSItem != null && rawDNSItem.Enabled == true)
|
if (rawDNSItem != null && rawDNSItem.Enabled == true)
|
||||||
{
|
{
|
||||||
defaultDomainResolverTag = Global.SingboxFinalResolverTag;
|
defaultDomainResolverTag = Global.SingboxFinalResolverTag;
|
||||||
|
directDNSStrategy = rawDNSItem.DomainStrategy4Freedom.IsNullOrEmpty() ? Global.SingboxDomainStrategy4Out.FirstOrDefault() : rawDNSItem.DomainStrategy4Freedom;
|
||||||
}
|
}
|
||||||
singboxConfig.route.default_domain_resolver = new()
|
singboxConfig.route.default_domain_resolver = new()
|
||||||
{
|
{
|
||||||
server = defaultDomainResolverTag,
|
server = defaultDomainResolverTag,
|
||||||
strategy = item.SingboxStrategy4Direct
|
strategy = directDNSStrategy
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_config.TunModeItem.EnableTun)
|
if (_config.TunModeItem.EnableTun)
|
||||||
|
|
Loading…
Reference in New Issue