兩次解決GitHub無法打開訪問,其它網頁可以正常訪問的問題

問題描述

第一次無法打開

很久之前的某一天,github無法打開了,對於程序員怎麼能打不開github呢,網上一頓搜索後,得到了下面的解決方法,自己親測可用!

方法

使用管理員權限,打開下面路徑文件

Window:C:\Windows\System32\drivers\etc\hosts
or
Linux:/etc/hosts

添加下面代碼即可,目的是添加host網址

# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
# GitHub End

第一次就這樣完美解決!

第二次無法正常打開

今天2020年6月4日,昨天打開都好好的,今天打開就一直失敗,在網上查找的基本就是上面那個方法,自己已經使用了上面方法,所以肯定是不行的,只能看看別人的評論,結果發現玄機了!

方法

原因就是,上面的host網址過期了。所以解決辦法很簡單了,直接刪掉之前添加的代碼並保存。再次打開GitHub,就正常了!

# 溫馨提示:平時不會經常在線,如果博客中有任何疑問,可+V交流:1336247478
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章