1. 程式人生 > >GitHub訪問慢

GitHub訪問慢

問題描述

  • 一直都覺得訪問 GitHub 時速度非常慢,重新整理一下都要等好久!於是嘗試一下能否解決掉...
github.com
assets-cdn.github.com
avatar2.githubusercontent.com
camo.githubusercontent.com
collector.githubapp.com
github.global.ssl.fastly.net

解決

  1. 嘗試修改本地 hosts 檔案,繞過 DNS 解析
  2. Windows:C:\Windows\System32\drivers\etc
    • 首先修改 hosts 許可權
    • 使用站長工具 DNS 查詢:http://tool.chinaz.com/dns/
    • 使用記事本或其他文字編輯軟體開啟(如:Notepad++),新增內容如下:
    192.30.253.112 github.com
    192.30.253.112 www.github.com
    151.101.64.133 assets-cdn.github.com
    151.101.40.133 avatars0.githubusercontent.com
    151.101.40.133 avatars1.githubusercontent.com
    151.101.40.133 avatars2.githubusercontent.com
    151.101.0.133 camo.githubusercontent.com
    34.230.182.100 collector.githubapp.com
    151.101.197.194 github.global.ssl.fastly.net
    52.216.130.203 github-cloud.s3.amazonaws.com
  3. Linux / Mac:/etc/hosts
    • sudo vi /etc/hosts
  4. 重新整理 DNS 快取
    • Windows:快捷鍵 Windows+R 輸入 cmd,執行命令 ipconfig /flushdns
    • Linux / Mac:執行命令 sudo /etc/init.d/networking restart