diff --git a/FastGithub.DomainResolve/DomainResolver.cs b/FastGithub.DomainResolve/DomainResolver.cs
index 999b919..23d1fe2 100644
--- a/FastGithub.DomainResolve/DomainResolver.cs
+++ b/FastGithub.DomainResolve/DomainResolver.cs
@@ -25,18 +25,7 @@ namespace FastGithub.DomainResolve
public DomainResolver(DnsClient dnsClient)
{
this.dnsClient = dnsClient;
- }
-
- ///
- /// 预加载
- ///
- /// 域名
- public void Prefetch(string domain)
- {
- const int HTTPS_PORT = 443;
- var dnsEndPoint = new DnsEndPoint(domain, HTTPS_PORT);
- this.dnsEndPointAddressElapseds.TryAdd(dnsEndPoint, IPAddressElapsedCollection.Empty);
- }
+ }
///
/// 解析ip
diff --git a/FastGithub.DomainResolve/IDomainResolver.cs b/FastGithub.DomainResolve/IDomainResolver.cs
index 45877db..f965210 100644
--- a/FastGithub.DomainResolve/IDomainResolver.cs
+++ b/FastGithub.DomainResolve/IDomainResolver.cs
@@ -10,12 +10,6 @@ namespace FastGithub.DomainResolve
///
public interface IDomainResolver
{
- ///
- /// 预加载
- ///
- /// 域名
- void Prefetch(string domain);
-
///
/// 解析ip
///
diff --git a/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs b/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
index da281aa..dfa00a3 100644
--- a/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
+++ b/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
@@ -1,7 +1,6 @@
using DNS.Protocol;
using DNS.Protocol.ResourceRecords;
using FastGithub.Configuration;
-using FastGithub.DomainResolve;
using FastGithub.WinDiverts;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
@@ -26,7 +25,6 @@ namespace FastGithub.PacketIntercept.Dns
private const string DNS_FILTER = "udp.DstPort == 53";
private readonly FastGithubConfig fastGithubConfig;
- private readonly IDomainResolver domainResolver;
private readonly ILogger logger;
private readonly TimeSpan ttl = TimeSpan.FromMinutes(10d);
@@ -41,18 +39,16 @@ namespace FastGithub.PacketIntercept.Dns
/// dns拦截器
///
///
- ///
///
///
public DnsInterceptor(
FastGithubConfig fastGithubConfig,
- IDomainResolver domainResolver,
ILogger logger,
IOptionsMonitor options)
{
this.fastGithubConfig = fastGithubConfig;
this.logger = logger;
- this.domainResolver = domainResolver;
+
options.OnChange(_ => DnsFlushResolverCache());
}
@@ -135,9 +131,6 @@ namespace FastGithub.PacketIntercept.Dns
return;
}
- // dns预加载
- this.domainResolver.Prefetch(domain.ToString());
-
// dns响应数据
var response = Response.FromRequest(request);
var record = new IPAddressResourceRecord(domain, IPAddress.Loopback, this.ttl);
diff --git a/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj b/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj
index d3fca22..2c8b98c 100644
--- a/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj
+++ b/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj
@@ -14,6 +14,5 @@
-