Skip to content

Commit

Permalink
feat: Add setting ”Modified DNS“ for Process Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chsbuffer committed Oct 23, 2020
1 parent 6f82149 commit 41e74e0
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Netch/Controllers/NFController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Threading.Tasks;
Expand Down Expand Up @@ -78,7 +80,9 @@ public bool Start(in Mode mode)
{
// 备份并替换系统 DNS
_sysDns = DNS.OutboundDNS;
DNS.OutboundDNS = "1.1.1.1,8.8.8.8";
if (string.IsNullOrWhiteSpace(Global.Settings.ModifiedDNS))
Global.Settings.ModifiedDNS = "1.1.1.1,8.8.8.8";
DNS.OutboundDNS = Global.Settings.ModifiedDNS;
}

return aio_init();
Expand Down
Loading

0 comments on commit 41e74e0

Please sign in to comment.