Github網頁顯示補了圖片-解決方案

背景

1.一段時間發現github上圖片一直刷新不出來,本來沒在意這麼多,後來網上一搜相關資料,顯示不了圖片是網頁源碼中圖片的源路徑是解析不出來導致,可能是DNS服務器未及時更新。

解決方案

  1. 解決辦法就是:繞過DNS服務器,在本機就把圖片的url與對應的IP映射關係配置好。
  2. 於是打開:C:\Windows\System32\drivers\etc\hosts 文件,以txt格式,填入以下信息:
# GitHub Start 
140.82.113.3      github.com
140.82.114.20     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
199.232.68.133     avatars0.githubusercontent.com
199.232.28.133     avatars1.githubusercontent.com
151.101.184.133    avatars1.githubusercontent.com
151.101.184.133    avatars2.githubusercontent.com
199.232.28.133     avatars2.githubusercontent.com
151.101.184.133    avatars3.githubusercontent.com
199.232.68.133     avatars3.githubusercontent.com
151.101.184.133    avatars4.githubusercontent.com
199.232.68.133     avatars4.githubusercontent.com
151.101.184.133    avatars5.githubusercontent.com
199.232.68.133     avatars5.githubusercontent.com
151.101.184.133    avatars6.githubusercontent.com
199.232.68.133     avatars6.githubusercontent.com
151.101.184.133    avatars7.githubusercontent.com
199.232.68.133     avatars7.githubusercontent.com
151.101.184.133    avatars8.githubusercontent.com
199.232.68.133     avatars8.githubusercontent.com

# GitHub End

上面這些IP是怎麼來的,使用圖片Url在IP查詢網上查詢得到的。
在這裏插入圖片描述

win10系統需要管理員權限,使用管理員權限打開再寫入即可。重新刷新GitHub就可以看到圖片了。
在這裏插入圖片描述

看到上面的服務器基本上在華盛頓,聯想到最近實體清單,真怕有一天把GitHub給禁用了。。。orz

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章