ping github.com
PING github.com (192.30.253.112): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
github.com
140.82.112.18 github.com
?下面是在终端进行的操作:
????????1、在终端执行
sudo vi /etc/hosts
????????2、然后输入i就可以在里面编辑内容了,添加以下配置,注意这里的IP地址一定是你自己的访问网址得到的,每个人可能不一样!!!??
????????????3. 配置完成之后按下esc键,然后输入:wq保存退出即可!
确保下是否配置真的完成,在终端输入以下命令可以查看:
sudo cat /etc/hosts
xixi@xixideMacBook-Pro ~ % ping github.com
PING github.com (140.82.113.4): 56 data bytes
64 bytes from 140.82.113.4: icmp_seq=0 ttl=48 time=214.055 ms
64 bytes from 140.82.113.4: icmp_seq=1 ttl=48 time=219.286 ms
64 bytes from 140.82.113.4: icmp_seq=2 ttl=48 time=249.598 ms
64 bytes from 140.82.113.4: icmp_seq=3 ttl=48 time=205.605 ms
64 bytes from 140.82.113.4: icmp_seq=4 ttl=48 time=199.519 ms
64 bytes from 140.82.113.4: icmp_seq=5 ttl=48 time=199.290 ms
64 bytes from 140.82.113.4: icmp_seq=6 ttl=48 time=202.046 ms