1、問題起因:
遇到了一個(gè)比較奇怪的問題牢酵,對(duì)于不太了解dns的我來講是一個(gè)棘手的問題:訪問github.com超時(shí)曼月,完全無法進(jìn)入頁(yè)面谊却,其他一切正常;起初的我以為是我開了墻哑芹、公司內(nèi)網(wǎng)炎辨、代理等導(dǎo)致,還傻兮兮的找IT解決這個(gè)問題聪姿,IT一頓操作后也沒搞好哈哈哈碴萧。
2、問題判斷:
仔細(xì)的思考了一下末购,首先訪問其他域名正常的情況下破喻,排除網(wǎng)絡(luò)問題;重啟電腦盟榴、關(guān)閉一切程序排除墻的問題低缩;關(guān)閉所有代理及瀏覽器代理等排除代理問題;那么問題來了····誰(shuí)的問題曹货?咆繁??那肯定是github本身顶籽。玩般。
于是就花20分鐘在谷歌瀏覽了一下github的相關(guān)訪問問題,最終得出了結(jié)論:
GitHub本身取消了我們國(guó)內(nèi)的訪問權(quán)礼饱,也就是說(猜測(cè))但凡一個(gè)國(guó)內(nèi)IP訪問github.com這個(gè)HOST坏为,都會(huì)成為一個(gè)等同于404的請(qǐng)求。
3镊绪、問題解決:
個(gè)人判斷匀伏,我們想要訪問github就要嘗試不被黑名單的IP,那么就需要通過修改/etc/hosts文件來解決
$ vi /etc/hosts
$ sudo vi /etc/hosts? ? ? ? ? ? ? ? ?# 需要權(quán)限執(zhí)行此命令
按s進(jìn)入編輯狀態(tài)蝴韭,在其后追加
140.82.114.4 github.com
140.82.113.4 gist.github.com
185.199.108.153 assets-cdn.github.com
199.232.96.133 raw.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
199.232.96.133 camo.githubusercontent.com
199.232.96.133 avatars.githubusercontent.com?
199.232.96.133 avatars0.githubusercontent.com
199.232.96.133 avatars1.githubusercontent.com
199.232.96.133 avatars2.githubusercontent.com
199.232.96.133 avatars3.githubusercontent.com
199.232.96.133 avatars4.githubusercontent.com
199.232.96.133 avatars5.githubusercontent.com
199.232.96.133 avatars6.githubusercontent.com
199.232.96.133 avatars7.githubusercontent.com
199.232.96.133 avatars8.githubusercontent.com
按esc退出編輯够颠,輸入:wq回車保存
這時(shí)你會(huì)發(fā)現(xiàn),github可以訪問了榄鉴,但是貌似訪問速度還是差一些履磨?啊..這..那我也沒能完全解決
Windows同理蛉抓,轉(zhuǎn)載于https://www.cnblogs.com/MuQuanyu-YuGod/articles/12549766.html