Add dns for tun mode

pull/3773/head
2dust 2023-04-26 20:53:43 +08:00
parent bfc8bf91ee
commit 3c4ae902fd
2 changed files with 13 additions and 5 deletions

View File

@ -168,10 +168,6 @@ namespace v2rayN.Handler
{
config.constItem.defIEProxyExceptions = Global.IEProxyExceptions;
}
//if (Utils.IsNullOrEmpty(config.remoteDNS))
//{
// config.remoteDNS = "1.1.1.1";
//}
if (config.speedTestItem == null)
{

View File

@ -640,7 +640,19 @@ namespace v2rayN.Handler
{
if (_config.tunModeItem.enableTun)
{
var tunDNS = Utils.GetEmbedText(Global.TunSingboxDNSFileName);
string tunDNS = String.Empty;
if (_config.tunModeItem.bypassMode)
{
tunDNS = _config.tunModeItem.directDNS;
}
else
{
tunDNS = _config.tunModeItem.proxyDNS;
}
if (tunDNS.IsNullOrEmpty() || Utils.ParseJson(tunDNS)?.ContainsKey("servers") == false)
{
tunDNS = Utils.GetEmbedText(Global.TunSingboxDNSFileName);
}
var obj = Utils.ParseJson(tunDNS);
singboxConfig.dns = obj;
}