支持DNS上游服务器的并行,最快,均衡查询模式

This commit is contained in:
Alex Yang
2025-12-17 19:15:17 +08:00
parent 307fbefee2
commit 5d0fb6d4fe
42 changed files with 714 additions and 584346 deletions

View File

@@ -15,6 +15,7 @@ type DNSConfig struct {
SaveInterval int `json:"saveInterval"` // 数据保存间隔(秒)
CacheTTL int `json:"cacheTTL"` // DNS缓存过期时间分钟
EnableDNSSEC bool `json:"enableDNSSEC"` // 是否启用DNSSEC支持
QueryMode string `json:"queryMode"` // 查询模式:"loadbalance"(负载均衡)、"parallel"(并行请求)、"fastest-ip"最快的IP地址
}
// HTTPConfig HTTP控制台配置
@@ -101,6 +102,10 @@ func LoadConfig(path string) (*Config, error) {
if len(config.DNS.DNSSECUpstreamDNS) == 0 {
config.DNS.DNSSECUpstreamDNS = []string{"8.8.8.8:53", "1.1.1.1:53"}
}
// 查询模式默认配置
if config.DNS.QueryMode == "" {
config.DNS.QueryMode = "parallel" // 默认使用并行请求模式
}
if config.HTTP.Port == 0 {
config.HTTP.Port = 8080
}