diff --git a/FastGithub.Dns/DnsHostedService.cs b/FastGithub.Dns/DnsServerHostedService.cs
similarity index 96%
rename from FastGithub.Dns/DnsHostedService.cs
rename to FastGithub.Dns/DnsServerHostedService.cs
index 05a8429..499eebc 100644
--- a/FastGithub.Dns/DnsHostedService.cs
+++ b/FastGithub.Dns/DnsServerHostedService.cs
@@ -14,13 +14,13 @@ namespace FastGithub.Dns
///
/// dns鍚庡彴鏈嶅姟
///
- sealed class DnsHostedService : BackgroundService
+ sealed class DnsServerHostedService : BackgroundService
{
private const int SIO_UDP_CONNRESET = unchecked((int)0x9800000C);
private readonly IRequestResolver requestResolver;
private readonly IOptions options;
- private readonly ILogger logger;
+ private readonly ILogger logger;
private readonly Socket socket = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
private readonly byte[] buffer = new byte[ushort.MaxValue];
@@ -33,10 +33,10 @@ namespace FastGithub.Dns
///
///
///
- public DnsHostedService(
+ public DnsServerHostedService(
GithubRequestResolver githubRequestResolver,
IOptions options,
- ILogger logger)
+ ILogger logger)
{
this.options = options;
this.logger = logger;
diff --git a/FastGithub.Dns/DnsServiceCollectionExtensions.cs b/FastGithub.Dns/DnsServiceCollectionExtensions.cs
index c36bfe6..715480f 100644
--- a/FastGithub.Dns/DnsServiceCollectionExtensions.cs
+++ b/FastGithub.Dns/DnsServiceCollectionExtensions.cs
@@ -20,7 +20,7 @@ namespace FastGithub
var assembly = typeof(DnsServiceCollectionExtensions).Assembly;
return services
.AddServiceAndOptions(assembly, configuration)
- .AddHostedService();
+ .AddHostedService();
}
}
}
diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json
index 30c7b58..e1d67a0 100644
--- a/FastGithub/appsettings.json
+++ b/FastGithub/appsettings.json
@@ -1,7 +1,7 @@
{
"Dns": {
"UpStream": "114.114.114.114", // 上游dns
- "GithubTTL": "00:10:00", // github相关域名解析结果的存活时长
+ "GithubTTL": "00:05:00", // github相关域名解析结果的存活时长
"SetToLocalMachine": true, // 是否设置本机使用此dns(仅支持windows)
"UseGithubReverseProxy": true // 是否使用反向代理访问github以解决连接被重复的问题
},
@@ -15,7 +15,7 @@
},
"PublicDnsProvider": {
"Enable": true, // 是否需要从dns服务器查找ip
- "Timeout": "00:00:00.100", // dns查询超时时长
+ "Timeout": "00:00:00.200", // dns查询超时时长
"Dnss": [ // dns服务器列表
"1.2.4.8",
"8.8.8.8",