解决方法
1)找到自己能用的github的ip
ping如下几个备选ip,找到一个能通的就行。
# 这几个ip都对应github.com这个域名
192.30.253.112
192.30.253.113
192.30.253.118
192.30.253.119
2)修改host文件
任选一个能ping通的ip写入hosts文件
2.1)windows配置
Windows 系统hosts文件,位于 C:\Windows\System32\drivers\etc\hosts
注意: 需要管理员权限
127.0.0.1 localhost
127.0.1.1 sun-pc
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# 在末尾追加
# GitHub
192.30.253.112 github.com
2.2)Linux配置
# 使用vim 编辑
sudo vim /etc/hosts
127.0.0.1 localhost
127.0.1.1 wanglei-PC
# github
192.30.253.112 github.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters