iterm2中ping下github.com和github.global.ssl.fastly.net
$ ping github.com
得到以下
PING github.com (192.30.253.112): 56 data bytes
64 bytes from 192.30.253.112: icmp_seq=0 ttl=47 time=245.930 ms
64 bytes from 192.30.253.112: icmp_seq=1 ttl=47 time=245.910 ms
记录ip 192.30.253.112
同理
$ ping github.global.ssl.fastly.net
最后编辑hosts文件
$ vim /etc/hosts
加入这两行代码
192.30.253.112 github.com
151.101.113.194 github.global.ssl.fastly.net
最后更新DNS缓存
$ sudo dscacheutil -flushcache