今天,碰到了一個(gè)很奇怪的問(wèn)題,github.com 打開(kāi)無(wú)法訪問(wèn),于是在網(wǎng)上百度了許多,操作后很多也是沒(méi)有生效.
最終的解決方案:
1 打開(kāi) 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 通過(guò)cmd打開(kāi)命令窗口輸入 `ipconfig/flushdns` 刷新dns解析緩存
PS: 第三步很重要,刷新完緩存后,才能正常訪問(wèn)
其中 github.com的ip 是通過(guò) https://www.ipaddress.com/ip-lookup 獲取到對(duì)應(yīng)你本機(jī)的訪問(wèn)github.com github.global.ssl.fastly.net ip