Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM平台DNS解析异常 #589

Closed
Pandaver opened this issue Mar 4, 2023 · 2 comments · Fixed by #682
Closed

ARM平台DNS解析异常 #589

Pandaver opened this issue Mar 4, 2023 · 2 comments · Fixed by #682

Comments

@Pandaver
Copy link

Pandaver commented Mar 4, 2023

          armv7安卓10同样报错解析到[::1],手机浏览器可以正常解析报错网页

尝试过:

  1. 打开Android设置里的“私人DNS”功能到dns.alidns.com
  2. 使用Clash代理
  3. 上级路由器IPv6指定阿里DNS 2400:3200::1 和 2400:3200:baba::1

错误依然存在
@WaterLemons2k @jeessy2

Originally posted by @Pandaver in #587 (comment)

@WaterLemons2k
Copy link
Contributor

WaterLemons2k commented Mar 5, 2023

#587 (comment) 是错误的。因为 Go 找不到 /etc/resolv.conf,所以返回默认 DNS(127.0.0.1::1)导致无法解析。

@jeessy2
Copy link
Owner

jeessy2 commented Mar 5, 2023

因为 Android 不是标准的 Linux 系统,没有 /etc/resolv.conf 文件。而 Go 标准库 net 是通过解析 /etc/resolv.conf 文件获取 DNS 服务器地址的。由于无法获取,会使用默认值 127.0.0.1:53,而本地又没有开启 DNS 服务所以就报错了。请自行创建 /etc/resolv.conf 文件(需要 root),文件内容:

nameserver 114.114.114.114

或参考 #590 自行编译。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants