Feature: Update dnsServer (#4)
This commit is contained in:
parent
b885bd8343
commit
b2c076d261
4
main.go
4
main.go
@ -84,8 +84,8 @@ func init() {
|
|||||||
Timeout: time.Second * 5,
|
Timeout: time.Second * 5,
|
||||||
}
|
}
|
||||||
dnsServers := []string{
|
dnsServers := []string{
|
||||||
"1.0.0.1:53", "8.8.4.4:53", "223.5.5.5:53", "223.6.6.6:53",
|
"8.8.4.4:53", "223.5.5.5:53", "94.140.14.140:53", "119.29.29.29:53",
|
||||||
"[2606:4700:4700::1001]:53", "[2001:4860:4860::8844]:53", "[2400:3200::1]:53", "[2400:3200:baba::1]:53",
|
"[2001:4860:4860::8844]:53", "[2400:3200::1]:53", "[2a10:50c0::1:ff]:53", "[2402:4e00::]:53",
|
||||||
}
|
}
|
||||||
if len(agentConfig.DNS) > 0 {
|
if len(agentConfig.DNS) > 0 {
|
||||||
dnsServers = agentConfig.DNS
|
dnsServers = agentConfig.DNS
|
||||||
|
@ -36,9 +36,9 @@ func NewSingleStackHTTPClient(httpTimeout, dialTimeout, keepAliveTimeout time.Du
|
|||||||
func resolveIP(addr string, ipv6 bool) (string, error) {
|
func resolveIP(addr string, ipv6 bool) (string, error) {
|
||||||
url := strings.Split(addr, ":")
|
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 {
|
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])
|
res, err := net.LookupIP(url[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user