GitHub 问题汇总

关于我 hexo 博客上传问题

问题:Failed to connect to github.com port 443: Timed out
  1. ping github.com

    ping 不通看自己是不是启用了代理或vpn,然后再看 host 文件中 github 对应的地址是否能访问通。
    之前访问不通,在 host 文件中添加了

  2. 30.253.112 github.com

  3. 199.108.153 assets-cdn.github.com

  4. 199.109.153 assets-cdn.github.com

  5. 199.110.153 assets-cdn.github.com

  6. 199.111.153 assets-cdn.github.com

  7. 232.5.194 github.global.ssl.fastly.net

  8. 101.113.194 github.global.ssl.fastly.net
    我全部删除掉,怎么添加 host 我在 GitHub 技巧 有提到过。


相关资料
Failed to connect to github.com port 443: Timed out(Windows)
GitHub解决git@github.com: Permission denied (publickey).问题

GitHub 技巧

GitHub 访问和下载

问题:GitHub 访问不了或下载慢
原因:GitHub 的 CDN 被墙屏了。
解决方法:绕过 DNS 解析,在本地直接绑定 host,该方法也可用于其他 CDN 被屏蔽的网站。
原理:找出 GitHub 域名所对应的 IP 地址,直接添加在本地 host 中。每次请求 GitHub 时就无需再向 DNS 查询地址。
操作:

  1. 访问ipaddress,查看网站域名对应的 IP 地址,输入网址则可查阅对应的 IP 地址。

  2. 修改 host 文件
    Windows 中 host 文件在 C:\Windows\System32\drivers\etc 下。
    修改 host 文件如下:

    1
    2
    3
    4
    5
    6
    # localhost name resolution is handled within DNS itself.
    # 127.0.0.1 localhost
    # ::1 localhost

    192.30.253.112 github.com
    151.101.113.194 github.global.ssl.fastly.net
  3. 刷新 DNS
    Windows:cmd 执行 ipconfig/flushdns
    mac:sudo dscacheutil –flushcache

阅读更多
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.