最近訪問github時,發現圖片不可見,另外gist無法使用,而其他功能使用都很正常,爲此煩惱了一陣,後來網上搜索發現,修改host可以解決該問題:
# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
介於不少朋友曾今反饋過不知道host如何修改,這裏介紹下:
windows下:
C:\Windows\System32\drivers\etc 打開 hosts 後加入上述內容,編輯保存即可(會提示管理員權限打開,確認即可)
mac下:
- 打開你的文件管理器也就是Finder ,Hosts在這個裏面
- 接下來請按快捷鍵組合 Shift+Command+G 三個組合按鍵查找文件,並輸入 Hosts 文件的所在路徑:/etc/hosts
- 在打開的文件夾中找到「Hosts」文件夾
- 複製這個「hosts」文件到桌面上,鼠標右鍵點擊/右擊它,選擇「打開方式」—「文本編輯」,打開這個「hosts」文件,然後將你要修改的內容直接在裏面修改就好了
- 將你修改好的 hosts 文件在複製回 Hosts 文件的所在(文件夾下)路徑:/etc/hosts 之下替換原始的 hosts 文件就好了,這樣你 Mac 系統下的 hosts 文件就被成功修改了
個人博客: IT老五 簡書:ThinkinLiu