mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
Fix DNS issue in TUN mode (#824)
This commit is contained in:
@@ -93,7 +93,7 @@ namespace Netch.Controllers
|
||||
|
||||
if (_tunConfig.UseCustomDNS)
|
||||
{
|
||||
Dial(NameList.TYPE_DNSADDR, _tunConfig.DNS);
|
||||
Dial(NameList.TYPE_DNSADDR, DnsUtils.AppendPort(_tunConfig.DNS));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -175,8 +175,13 @@ namespace Netch.Controllers
|
||||
|
||||
if (_tunConfig.UseCustomDNS)
|
||||
{
|
||||
// NOTICE: DNS metric is network interface metric
|
||||
RouteUtils.CreateRoute(_tun.FillTemplate(_tunConfig.DNS, 32));
|
||||
if (_tunConfig.ProxyDNS)
|
||||
{
|
||||
// NOTICE: DNS metric is network interface metric
|
||||
RouteUtils.CreateRoute(_tun.FillTemplate(_tunConfig.DNS, 32));
|
||||
}
|
||||
|
||||
tunNetworkInterface.SetDns(_tunConfig.DNS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user