github 下载文件失败 无法访问此网站
使用Google Chrome可以访问https://github.com, 但是下载文件时提示报错, 如下:
使用ping检查地址 raw.githubusercontent.com, ping失败,显示域名解析失败。
上网使用域名查询工具 https://site.ip138.com/, 输入raw.githubusercontent.com
解决方式
如果主机是Linux系统,可在文件/etc/hosts后追加如下,使用IP地址代替域名访问:
151.101.76.133 raw.githubusercontent.com
如果主机是Windows系统, 使用Everything搜索hosts, 找到C:WindowsSystem32driversetchosts
追加:
# Copyright (c) 1993-2009 Microsoft Corp.## This is a sample HOSTS file used by Microsoft TCP/IP for Windows.## This file contains the mappings of IP addresses to host names. Each# entry should be kept on an individual line. The IP address should# be placed in the first column followed by the corresponding host name.# The IP address and the host name should be separated by at least one# space.## Additionally, comments (such as these) may be inserted on individual# lines or following the machine name denoted by a '#' symbol.## For example:## 102.54.94.97 rhino.acme.com # source server# 38.25.63.10 x.acme.com # x client host# localhost name resolution is handled within DNS itself.#127.0.0.1 localhost#::1 localhost# 追加151.101.76.133 raw.githubusercontent.com 检查
重新访问github, 下载文件
虽然仍然显示无法加载,但是点重新加载, 可以下载成功