设置了 hosts, dig raw.githubusercontent.com 总是失败

2020-11-20 15:03:18 +08:00
 CodeCore

总是指向本地,导致 brew 安装 openresty 总是失败:

==> Installing openresty from openresty/brew
==> Downloading https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-1.1.1f-sess_set_get_cb_yield.patch
##O#- #
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
Error: Failed to download resource "openresty-openssl111--patch"
Download failed: https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-1.1.1f-sess_set_get_cb_yield.patch
➜  ~ dig raw.githubusercontent.com

; <<>> DiG 9.10.6 <<>> raw.githubusercontent.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32099
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;raw.githubusercontent.com.	IN	A

;; ANSWER SECTION:
raw.githubusercontent.com. 30	IN	A	0.0.0.0

;; Query time: 10 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Fri Nov 20 14:59:20 CST 2020
;; MSG SIZE  rcvd: 70
# GitHub520 Host Start
185.199.108.154               github.githubassets.com
199.232.96.133                camo.githubusercontent.com
199.232.96.133                github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.114.3                  gist.github.com
185.199.108.153               github.io
140.82.114.4                  github.com
140.82.113.5                  api.github.com
199.232.96.133                raw.githubusercontent.com
199.232.96.133                user-images.githubusercontent.com
40.75.87.113                  favicons.githubusercontent.com
199.232.96.133                avatars5.githubusercontent.com
199.232.96.133                avatars4.githubusercontent.com
199.232.96.133                avatars3.githubusercontent.com
199.232.96.133                avatars2.githubusercontent.com
199.232.96.133                avatars1.githubusercontent.com
199.232.96.133                avatars0.githubusercontent.com
140.82.113.9                  codeload.github.com
52.216.128.147                github-cloud.s3.amazonaws.com
52.216.0.224                  github-com.s3.amazonaws.com
52.216.107.188                github-production-release-asset-2e65be.s3.amazonaws.com
52.217.1.4                    github-production-user-asset-6210df.s3.amazonaws.com
52.217.67.196                 github-production-repository-file-5c1aeb.s3.amazonaws.com
# Star me GitHub url: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End
2724 次点击
所在节点    程序员
15 条回复
Rheinmetal
2020-11-20 15:11:04 +08:00
只能说老老实实走代理 别整这些没用的了
julyclyde
2020-11-20 15:24:24 +08:00
dig 和 hosts 没啥关系
CodeCore
2020-11-20 15:27:58 +08:00
@julyclyde 额。。。我学习下。我还以为抱这个错误是因为域名解析问题呢。
julyclyde
2020-11-20 16:59:45 +08:00
用 curl -v 访问一下那个网址看看具体错误信息
scemsjyd
2020-11-20 17:23:50 +08:00
https://sm.ms/image/wGobPXjQaM5fHv3
你最好 ping 或者 curl 看一下返回的 ip 是不是正常的,还有你的 hosts 配置的 ip 可用不。
scemsjyd
2020-11-20 17:25:11 +08:00
lework1234
2020-11-20 18:46:01 +08:00
这里有代理地址,连不上的时候可以用下`//mirrors.leops.cn/#/github`
ysc3839
2020-11-20 18:49:05 +08:00
hosts 是系统 DNS 库处理的,dig 是使用自己的 DNS 客户端发请求,不会使用系统的,所以不受 hosts 影响。
lpts007
2020-11-20 19:03:54 +08:00
墙现在成熟的都出口了,改个 host 对付不了它。

希望中国教材也抓紧更新 tcp 章节:
我们访问 github 时,三次握手之后会马上收到 rst 包体现了怎样的社会主义核心价值观?
Jooooooooo
2020-11-20 19:44:43 +08:00
改 host 5 年前估计还可以
learningman
2020-11-21 13:55:43 +08:00
@lpts007 我认为主要体现了和谐和法制,侧面体现了自由和平等
CodeCore
2020-11-21 16:28:09 +08:00
@scemsjyd ping 可以的。
CodeCore
2020-11-21 16:28:55 +08:00
@ysc3839 学习了。感谢。我尝试 ping 了可以通,我在搜搜其他方式。
baobao1270
2020-11-23 10:55:19 +08:00
dig 不走 hosts
CodeCore
2020-11-23 14:06:30 +08:00
@baobao1270 学习了。涨了波姿势。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/727556

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX