Feature: Update dnsServer (#4)

This commit is contained in:
卖女孩的小火柴 2023-10-26 10:51:19 +08:00 committed by GitHub
parent b885bd8343
commit b2c076d261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -84,8 +84,8 @@ func init() {
Timeout: time.Second * 5,
}
dnsServers := []string{
"1.0.0.1:53", "8.8.4.4:53", "223.5.5.5:53", "223.6.6.6:53",
"[2606:4700:4700::1001]:53", "[2001:4860:4860::8844]:53", "[2400:3200::1]:53", "[2400:3200:baba::1]:53",
"8.8.4.4:53", "223.5.5.5:53", "94.140.14.140:53", "119.29.29.29:53",
"[2001:4860:4860::8844]:53", "[2400:3200::1]:53", "[2a10:50c0::1:ff]:53", "[2402:4e00::]:53",
}
if len(agentConfig.DNS) > 0 {
dnsServers = agentConfig.DNS

View File

@ -36,9 +36,9 @@ func NewSingleStackHTTPClient(httpTimeout, dialTimeout, keepAliveTimeout time.Du
func resolveIP(addr string, ipv6 bool) (string, error) {
url := strings.Split(addr, ":")
dnsServers := []string{"[2606:4700:4700::1001]", "[2001:4860:4860::8844]", "[2400:3200::1]", "[2400:3200:baba::1]"}
dnsServers := []string{"[2001:4860:4860::8844]", "[2400:3200::1]", "[2a10:50c0::1:ff]", "[2402:4e00::]"}
if !ipv6 {
dnsServers = []string{"1.0.0.1", "8.8.4.4", "223.5.5.5", "223.6.6.6"}
dnsServers = []string{"8.8.4.4", "223.5.5.5", "94.140.14.140", "119.29.29.29"}
}
res, err := net.LookupIP(url[0])