GitHub无法访问的解决方法

每次刚装完系统我们访问GitHub就会出现无法访问的情况,此时只需要修改host文件将可访问的dns解析地址写入进去即可。

查询DNS

使用dns监测查询工具

https://tool.chinaz.com/dns

https://dnsdaquan.com/

输入无法访问的IP github.com 进行检测

查询到可访问的ip为 20.205.243.166

Windows修改

以管理员权限启动CMD

  • 编辑hosts文件
notepad c:\windows\system32\drivers\etc\hosts
  • 直接写入
echo 20.205.243.166 github.com >> c:\windows\system32\drivers\etc\hosts

Linux修改

  • 编辑 hosts文件
sudo vim /etc/hosts
  • 直接写入
echo 20.205.243.166 github.com >> \etc\hosts

备选内容

几个可解析IP

140.82.112.4	github.com
20.205.243.16	github.com
31.13.80.169	github.global.ssl.fastly.net
199.232.5.194	github.global.ssl.fastly.net
185.199.109.153	appimage.github.io
151.101.100.133	raw.githubusercontent.com

猜你喜欢

转载自blog.csdn.net/no1xium/article/details/132975085