V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
CodeCore
V2EX  ›  程序员

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

  •  
  •   CodeCore · 2020-11-20 15:03:18 +08:00 · 2693 次点击
    这是一个创建于 1225 天前的主题,其中的信息可能已经有所发展或是发生改变。

    总是指向本地,导致 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
    
    15 条回复    2020-11-23 14:06:30 +08:00
    Rheinmetal
        1
    Rheinmetal  
       2020-11-20 15:11:04 +08:00
    只能说老老实实走代理 别整这些没用的了
    julyclyde
        2
    julyclyde  
       2020-11-20 15:24:24 +08:00
    dig 和 hosts 没啥关系
    CodeCore
        3
    CodeCore  
    OP
       2020-11-20 15:27:58 +08:00
    @julyclyde 额。。。我学习下。我还以为抱这个错误是因为域名解析问题呢。
    julyclyde
        4
    julyclyde  
       2020-11-20 16:59:45 +08:00
    用 curl -v 访问一下那个网址看看具体错误信息
    scemsjyd
        5
    scemsjyd  
       2020-11-20 17:23:50 +08:00
    https://sm.ms/image/wGobPXjQaM5fHv3
    你最好 ping 或者 curl 看一下返回的 ip 是不是正常的,还有你的 hosts 配置的 ip 可用不。
    scemsjyd
        6
    scemsjyd  
       2020-11-20 17:25:11 +08:00
    lework1234
        7
    lework1234  
       2020-11-20 18:46:01 +08:00
    这里有代理地址,连不上的时候可以用下`//mirrors.leops.cn/#/github`
    ysc3839
        8
    ysc3839  
       2020-11-20 18:49:05 +08:00 via Android
    hosts 是系统 DNS 库处理的,dig 是使用自己的 DNS 客户端发请求,不会使用系统的,所以不受 hosts 影响。
    lpts007
        9
    lpts007  
       2020-11-20 19:03:54 +08:00 via Android   ❤️ 1
    墙现在成熟的都出口了,改个 host 对付不了它。

    希望中国教材也抓紧更新 tcp 章节:
    我们访问 github 时,三次握手之后会马上收到 rst 包体现了怎样的社会主义核心价值观?
    Jooooooooo
        10
    Jooooooooo  
       2020-11-20 19:44:43 +08:00
    改 host 5 年前估计还可以
    learningman
        11
    learningman  
       2020-11-21 13:55:43 +08:00
    @lpts007 我认为主要体现了和谐和法制,侧面体现了自由和平等
    CodeCore
        12
    CodeCore  
    OP
       2020-11-21 16:28:09 +08:00
    @scemsjyd ping 可以的。
    CodeCore
        13
    CodeCore  
    OP
       2020-11-21 16:28:55 +08:00
    @ysc3839 学习了。感谢。我尝试 ping 了可以通,我在搜搜其他方式。
    baobao1270
        14
    baobao1270  
       2020-11-23 10:55:19 +08:00 via Android
    dig 不走 hosts
    CodeCore
        15
    CodeCore  
    OP
       2020-11-23 14:06:30 +08:00
    @baobao1270 学习了。涨了波姿势。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2784 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:55 · PVG 19:55 · LAX 04:55 · JFK 07:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.