github 加載不出來
獲取GitHub官方DNS地址
-
https://www.ipaddress.com/打開后如圖,右上角搜索查
- 查找這三個(gè)DNS鏈接的解析地址
http://github.com
http://assets-cdn.github.com
http://github.global.ssl.fastly.net
修改系統(tǒng)Hosts文件
hosts 文件在每個(gè)系統(tǒng)的位置不一,詳情如下:
Windows 系統(tǒng):C:\Windows\System32\drivers\etc\hosts
Linux 系統(tǒng):/etc/hosts
Mac(蘋果電腦)系統(tǒng):/etc/hosts
Android(安卓)系統(tǒng):/system/etc/hosts
iPhone(iOS)系統(tǒng):/etc/hosts
- 添加如下
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
?
140.82.113.3 github.com
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
151.101.1.194 github.global.ssl.fastly.net
151.101.65.194 github.global.ssl.fastly.net
151.101.129.194 github.global.ssl.fastly.net
151.101.193.194 github.global.ssl.fastly.net
在末尾添加三行記錄并保存。(需管理員權(quán)限,注意IP地址與域名間需留有空格)其實(shí)就是為域名添加 IP 映射。
- 沒辦法直接管理員權(quán)限打開改,就先把文件挪出去改完再挪回來
- 改后再打開github,然后hosts文件末尾自動(dòng)如下
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
140.82.113.3 github.com
140.82.113.3 gist.github.com
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
151.101.1.194 github.global.ssl.fastly.net
151.101.65.194 github.global.ssl.fastly.net
151.101.129.194 github.global.ssl.fastly.net
151.101.193.194 github.global.ssl.fastly.net
185.199.108.133 raw.githubusercontent.com
185.199.108.133 gist.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 camo.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 avatars6.githubusercontent.com
185.199.108.133 avatars7.githubusercontent.com
185.199.108.133 avatars8.githubusercontent.com
刷新緩存
- 在電腦搜索框cmd打開命令提示符窗口
- 然后輸入
ipconfig /flushdns
刷新緩存再打開github
- 成功打開
打開后github偶爾又會(huì)加載不出來,如何徹底解決問題
參考解決github有時(shí)能訪問有時(shí)不能訪問的問題
在github能打開時(shí),打開電腦的cmd,查看域名
ipconfig/flushdns
nslookup github.com
然后在hosts文件末尾添加一行20.205.243.166 github.com
即可
- 如果之后又不行
也會(huì)有潛在的問題,比如這個(gè)IP地址的服務(wù)器關(guān)機(jī)了,那你就再也訪問不了github了。解決辦法就是,刪除hosts中的這條記錄,然后按照本文重來一遍。
更新,又打不開(實(shí)際問題并不屬于加載不出來,而是網(wǎng)頁亂碼)
win+R搜cmd里查域名
添加到hosts最后一句,路徑C:\Windows\System32\drivers\etc\hosts
同樣也是,改不了的話先把hosts挪到桌面上,改完保存好在挪回去
OK到這里還不成功,還打不開
在cmd刷新一下緩存
OK還是不行
在hosts結(jié)尾里添加這幾句后關(guān)閉瀏覽器再打開即可
# GitHub IP地址
140.82.121.4 github.com
185.199.108.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
185.199.110.133 objects.githubusercontent.com
185.199.111.133 objects.githubusercontent.com
185.199.108.133 objects.githubusercontent.com
185.199.109.133 objects.githubusercontent.com
185.199.111.154 github.githubassets.com
185.199.108.154 github.githubassets.com
185.199.109.154 github.githubassets.com
185.199.110.154 github.githubassets.com
最終hosts內(nèi)容,這部分復(fù)制的在上文添加的之前
文章來源:http://www.zghlxwxcb.cn/news/detail-676260.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-676260.html
到了這里,關(guān)于【github加載不出來】github 加載不出來、打開網(wǎng)頁亂碼-獲取GitHub官方CDN地址、修改系統(tǒng)Hosts文件 刷新緩存的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!