From e36ea87d64c421be9debccbddb83aefc0ec9cfda Mon Sep 17 00:00:00 2001 From: xljiulang <366193849@qq.com> Date: Tue, 20 Jul 2021 20:57:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B9=B3=E5=8F=B0=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.Dns/DnsServerHostedService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/FastGithub.Dns/DnsServerHostedService.cs b/FastGithub.Dns/DnsServerHostedService.cs index 1730601..6d9b40b 100644 --- a/FastGithub.Dns/DnsServerHostedService.cs +++ b/FastGithub.Dns/DnsServerHostedService.cs @@ -41,13 +41,15 @@ namespace FastGithub.Dns this.hostsValidator = hostsValidator; this.logger = logger; - if (OperatingSystem.IsWindows()) + options.OnChange(opt => { - options.OnChange(opt => SystemDnsUtil.DnsFlushResolverCache()); - } + if (OperatingSystem.IsWindows()) + { + SystemDnsUtil.DnsFlushResolverCache(); + } + }); } - /// /// 启动dns ///