mirror of
https://github.com/2dust/v2rayN.git
synced 2025-09-17 23:43:05 +00:00
parent
ec627bdb82
commit
cb182125f6
1 changed files with 15 additions and 9 deletions
|
@ -72,11 +72,6 @@ public partial class CoreConfigSingboxService
|
|||
}
|
||||
|
||||
var hostsDomains = new List<string>();
|
||||
var systemHostsMap = Utils.GetSystemHosts();
|
||||
foreach (var kvp in systemHostsMap)
|
||||
{
|
||||
hostsDomains.Add(kvp.Key);
|
||||
}
|
||||
var dnsItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
||||
if (dnsItem == null || dnsItem.Enabled == false)
|
||||
{
|
||||
|
@ -89,12 +84,23 @@ public partial class CoreConfigSingboxService
|
|||
hostsDomains.Add(kvp.Key);
|
||||
}
|
||||
}
|
||||
if (simpleDNSItem.UseSystemHosts == true)
|
||||
{
|
||||
var systemHostsMap = Utils.GetSystemHosts();
|
||||
foreach (var kvp in systemHostsMap)
|
||||
{
|
||||
hostsDomains.Add(kvp.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hostsDomains.Count > 0)
|
||||
{
|
||||
singboxConfig.route.rules.Add(new()
|
||||
{
|
||||
action = "resolve",
|
||||
domain = hostsDomains,
|
||||
});
|
||||
}
|
||||
|
||||
singboxConfig.route.rules.Add(new()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue