Compare commits

...

4 Commits

Author SHA1 Message Date
Space Time
f428de3fd7 1.1.4 -> 1.1.5 第15次更新 2024-12-29 22:16:58 +08:00
Space Time
bcccb73520 1.1.4 -> 1.1.5 第14次更新 2024-12-29 20:53:56 +08:00
Space Time
6fd9631d5c 1.1.4 -> 1.1.5 第13次更新 2024-12-29 20:04:24 +08:00
Space Time
2c5004f02d 1.1.4 -> 1.1.5 第12次更新 2024-12-29 19:52:54 +08:00
2 changed files with 16 additions and 1 deletions

11
Utils/DnsFlusher.cs Normal file
View File

@ -0,0 +1,11 @@
using System.Runtime.InteropServices;
namespace Sheas_Cealer.Utils;
internal static partial class DnsFlusher
{
[LibraryImport("dnsapi.dll")]
private static partial void DnsFlushResolverCache();
internal static void FlushDns() => DnsFlushResolverCache();
}

View File

@ -335,6 +335,8 @@ public partial class MainWin : Window
if (sender == null)
MihomoButtonHoldTimer_Tick(null, EventArgs.Empty);
DnsFlusher.FlushDns();
}
finally
{
@ -876,12 +878,14 @@ public partial class MainWin : Window
{
enable = true,
listen = ":53",
ipv6 = true,
nameserver = MainConst.MihomoNameServers
};
hostsMihomoConfDict["dns"] = new
{
enable = true,
listen = ":53"
listen = ":53",
ipv6 = true
};
MihomoConfs = new SerializerBuilder().WithNamingConvention(HyphenatedNamingConvention.Instance).Build().Serialize(mihomoConfDict);