[終極參考link]
[終極參考link]
[參考CSDN_link]
[參考簡書_link]
[參考簡書_link]
[參考簡書_link]
[參考簡書_link]
[參考CSDN_link]
[參考簡書_link]
[參考簡書_link]
[參考CN_blog_link]
-1- F安Q昂
事實證明只有會搭梯子的高配玩家才配得上高速git clone
-1.1-F安Q昂
怎么佛跳墻是難不倒程序媛的!
-1.2-查看搭梯子的socket端口
-1.3-配置git config
-1.4-git clone驗證速度
-2- 不懂F安Q昂的話,算了
*
在https://www.ip138.com
orhttp://tool.chinaz.com/dns
orhttps://www.ipaddress.com
上查詢指定網站的最快最新IP地址
*
通過sudo vi /etc/hosts
命令,在MAC下指定某網址的DNS的IP地址
*
通過sudo dscacheutil -flushcache
命令,在MAC下強制刷新DNS緩存
*
通過nslookup github.com
命令,查詢當前環境的域名指向情況
*
通過ping github.com
查看當前環境訪問指定網址的ip
需要手動設置IP的各種github域名:
最新的IP地址,還是要去https://www.ipaddress.com自己手動實時查詢一下比較好
域名 | IP地址 | 作用 |
---|---|---|
github.com | 192.30.253.113 | 訪問github.com加載慢 |
avatars0.githubusercontent.com | 185.31.18.133 | github頭像? |
avatars1.githubusercontent.com | 185.31.19.133 | github頭像? |
avatars2.githubusercontent.com | 199.232.28.133 | github頭像加載不出來 |
github.map.fastly.net | 199.232.28.133 | github頭像加載不出來 |
raw.githubusercontent.com | 99.232.28.133 | 載raw代碼重定向失敗 |
raw.github.com | 199.27.76.130 | |
github.global.ssl.fastly.net | 199.232.5.194 | git clone 慢? |
github.global.ssl.fastly.net | 185.31.16.184 | |
github.global.ssl.fastly.net | 151.101.44.249 | |
assets-cdn.github.com | 103.245.222.133 | |
assets-cdn.github.com | 23.235.47.133 | |
assets-cdn.github.com | 203.208.39.104 | |
http://global-ssl.fastly.Net | 151.101.112.249 | |
http://github.com | 192.30.253.112 | |
documentcloud.github.com | 204.232.175.78 | |
gist.github.com | 204.232.175.94 | |
help.github.com | 107.21.116.220 | |
nodeload.github.com | 207.97.227.252 | |
status.github.com | 107.22.3.110 | |
training.github.com | 204.232.175.78 | |
www.github.com | 207.97.227.243 |
在github.com
中添加如下內容:
140.82.114.3 github.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 github.map.fastly.net
199.232.28.133 raw.githubusercontent.com
199.232.28.133 raw.github.com
199.232.5.194 github.global.ssl.fastly.net
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
199.232.4.249 global-ssl.fastly.net
185.199.108.153 documentcloud.github.com
185.199.109.153 documentcloud.github.com
185.199.110.153 documentcloud.github.com
185.199.111.153 documentcloud.github.com
192.30.253.118 gist.github.com
185.199.108.154 help.github.com
185.199.109.154 help.github.com
185.199.110.154 help.github.com
185.199.111.154 help.github.com
192.30.253.121 nodeload.github.com
52.87.114.63 status.github.com
52.205.36.92 status.github.com
54.85.97.34 status.github.com
192.30.253.167 training.github.com
140.82.114.3 www.github.com
最新查詢出的IP | 實證好用的IP | 域名 |
---|---|---|
140.82.114.3 | github.com | |
199.232.28.133 | avatars0.githubusercontent.com | |
199.232.28.133 | avatars1.githubusercontent.com | |
199.232.28.133 | avatars2.githubusercontent.com | |
199.232.28.133 | github.map.fastly.net | |
199.232.28.133 | raw.githubusercontent.com | |
199.232.28.133 | raw.github.com | |
199.232.5.194 | github.global.ssl.fastly.net | |
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 | |
199.232.4.249 | global-ssl.fastly.net | |
185.199.108.153 | documentcloud.github.com | |
185.199.109.153 | documentcloud.github.com | |
185.199.110.153 | documentcloud.github.com | |
185.199.111.153 | documentcloud.github.com | |
192.30.253.118 | gist.github.com | |
185.199.108.154 | help.github.com | |
185.199.109.154 | help.github.com | |
185.199.110.154 | help.github.com | |
185.199.111.154 | help.github.com | |
192.30.253.121 | nodeload.github.com | |
52.87.114.63 | status.github.com | |
52.205.36.92 | status.github.com | |
54.85.97.34 | status.github.com | |
192.30.253.167 | training.github.com | |
140.82.114.3 | www.github.com |
GitHub的CDN域名遭到DNS污染,導致無法連接使用 GitHub 的加速分發服務器,才使得國內訪問速度很慢。
Github的raw文件讀取地址遭受DNS污染,導致文件下載困難。
通過訪問 https://www.ipaddress.com/ 這個網站來獲取當前github最新的ip地址。
背景知識
-1- /etc/hosts
文件簡介
Mac下/etc/hosts
是一個沒有擴展名的系統文件,
可以用系統自帶的記事本等工具打開or編輯
/etc/hosts
的作用就是將一些常用的網址域名與其對應的IP地址建立一個關聯
當用戶在瀏覽器輸入一個需要登錄的網址時
系統首先會自動從/etc/hosts
文件中尋找對應的IP地址
一旦找到,系統會立即打開對應的網址
如果沒有找到,則系統會再將網址提交到DNS域名解析服務器
進行IP地址的解析
以192.168.1.64 m.taowaitao.cn 為例
表示每次訪問 m.taowaitao.cn的時候,都不會去DNS域名解析服務器獲取真實的IP地址,表示已經攔截下來了,而直接使用 192.168.1.64 打開對應的網址
-2- /etc/hosts
文件中指定網址的IP地址時,可以重復多個么?
應該是可以的
# 解決git clone 速度慢的問題
140.82.113.3 github.com
140.82.114.3 github.com
140.82.114.4 github.com
192.30.253.112 github.com
/etc/hosts
文件中添加了github.com
四個備選DNS IP之后,重啟Safari瀏覽器打開github,發現簡直就是秒打開,太快了。
-3- /etc/hosts
的作用
*
方便局域網用戶訪問
*
DNS污染,指定IP可以更快地成功鏈接到指定網址
*
將想要屏蔽的網址指定到本地的錯誤IP
-4- git clone
慢
git clone
特別慢是因為github.global.ssl.fastly.net域名被限制了。
-5- ping
和 nslookup
命令的區別
[參考link]
*
ping github.com
命令的解析順序:
系統緩存 → hosts → 緩存服務器 → 主服務器 → 輔服務器
*
nslookup github.com
命令的解析順序:
直奔dns進行查詢
并沒有像ping命令似的,先本機緩存,再hosts這么麻煩
$ nslookup github.com
Server: 172.16.202.2
Address: 172.16.202.2#53
Non-authoritative answer:
Name: github.com
Address: 13.229.188.59
Mac上,通過設置
→網絡
→高級
→DNS
可以查看當前環境的DNS服務器:
$ ping github.com
PING github.com (13.229.188.59): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
Request timeout for icmp_seq 8
Request timeout for icmp_seq 9
Request timeout for icmp_seq 10
Request timeout for icmp_seq 11