今天,碰到了一個(gè)很奇怪的問題,github.com 打開無法訪問,于是在網(wǎng)上百度了許多,操作后很多也是沒有生效.
最終的解決方案:
1 打開 hosts 目錄 C:\Windows\System32\drivers\etc 找到 hosts
2 配置github 的ip信息
例如:
140.82.113.4 github.com
199.232.69.194 github.global.ssl.fastly.net
3 ipconfig/flushdns 通過cmd打開命令窗口輸入 `ipconfig/flushdns` 刷新dns解析緩存
PS: 第三步很重要,刷新完緩存后,才能正常訪問
其中 github.com的ip 是通過 https://www.ipaddress.com/ip-lookup 獲取到對(duì)應(yīng)你本機(jī)的訪問github.com github.global.ssl.fastly.net ip