原因:

本机hosts文件中设置的ip拦截了github.io的访问;因为PC每次访问网址时先搜索hosts文件,如果hosts文件中配置了网址对应的ip,则不需要dns域名解析成IP给到PC;

解决办法

1,站长工具( IP/服务器github.io的信息 - 站长工具)上查找github.io域名的ip,把获取的ip在hosts文件中添加对应关系;例如:

 185.199.111.153  binance-docs.github.io
 52.74.223.119     github.com
 192.30.253.119    gist.github.com
 54.169.195.247    api.github.com
 185.199.111.153   assets-cdn.github.com
 151.101.76.133    raw.githubusercontent.com

hosts文件路径: C:\Windows\System32\drivers\etc\

以上这写静态ip配对关系一定要在#    ::1             localhost之前配置

hosts文件部分内容如下:

2,如果还不行

查看hosts文件中是否没有#  127.0.0.1    localhost,而只有#    ::1             localhost 那就添加#  127.0.0.1    localhost

总结:我的出现以上问题就是没有#  127.0.0.1    localhost而只有#    ::1             localhost导致的;

更多推荐