解决 raw.githubusercontent.com 无法访问的问题 DNS

in with 0 comment

今天访问 http://raw.githubusercontent.com/ 时,提示无法访问,可能是因为某些众所周知的原因导致 DNS 污染,最终通过修改 host 解决问题。

解决方案
查询真实 IP
通过 IPAddress.com 查询 http://raw.githubusercontent.com/ 的真实 IP,

可知其真实 IP 为 199.232.68.133。

修改 hosts
CentOS 及 macOS 直接在终端输入

sudo vi /etc/hosts

编辑 hosts 文件,新增下列内容

140.82.114.3 github.com
185.199.111.133 raw.githubusercontent.com

保存即可。
What IP addresses does raw.githubusercontent.com resolve to?
raw.githubusercontent.com resolves to 4 IPv4 addresses and 4 IPv6 addresses:
185.199.108.133
185.199.109.133
185.199.110.133
185.199.111.133
2606:50c0:8000::154
2606:50c0:8001::154
2606:50c0:8002::154
2606:50c0:8003::154
In what country are raw.githubusercontent.com servers located in?
raw.githubusercontent.com has servers located in the United States.

Responses