一、修改方法
到這個網站: https://www.ipaddress.com/
查下面右邊對應的地址 ,就能得到最新的IP地址,最後添加到hosts文件即可。
比如搜素raw.githubusercontent.com 得到的是 199.232.28.133
那組成填寫進hosts文件的就是:199.232.28.133 raw.githubusercontent.com
# GitHub Start
192.30.253.113 github.com
140.82.114.20 gist.github.com
4 × IPv4 assets-cdn.github.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 gist.githubusercontent.com
199.232.28.133 cloud.githubusercontent.com
199.232.28.133 camo.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 avatars4.githubusercontent.com
199.232.28.133 avatars5.githubusercontent.com
199.232.28.133 avatars6.githubusercontent.com
199.232.28.133 avatars7.githubusercontent.com
199.232.28.133 avatars8.githubusercontent.com
# GitHub End
二、Windows系統
修改 C:\Windows\System32\drivers\etc 中的hosts文件
(PS:若沒有修改權限,可以鼠標右鍵,屬性,安全,修改權限。或者將hosts文件複製到桌面,修改之後,複製到原文件夾)
三、MacOS系統
1. 通過命令行
先sudo -i
臨時獲取管理員權限,會提示你輸入密碼,就是啓動的密碼。
然後 vi /etc/hosts
前面的vi是編輯器,當然也可以換用其他的/etc/hosts
是hosts內容,編輯完保存就OK
2. 通過圖形界面
按快捷鍵組合 Shift+Command+G
三個組合按鍵查找文件,並輸入 hosts 文件的所在路徑:/etc/hosts
找到hosts文件修改即可。