mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
🐛 修复 IPv6 only 机器取 IP 问题
This commit is contained in:
@@ -108,8 +108,13 @@ func resolveIP(addr string, ipv6 bool) (string, error) {
|
||||
}
|
||||
m.RecursionDesired = true
|
||||
|
||||
dnsServer := "2606:4700:4700::1111"
|
||||
if !ipv6 {
|
||||
dnsServer = "1.1.1.1"
|
||||
}
|
||||
|
||||
c := new(dns.Client)
|
||||
r, _, err := c.Exchange(m, net.JoinHostPort("1.1.1.1", "53"))
|
||||
r, _, err := c.Exchange(m, net.JoinHostPort(dnsServer, "53"))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user