github访问慢的解决办法(macOS)

编辑 /etc/hosts

cd /etc
sudo vi hosts

进去以后 输入 字母 i进入编辑模式
输入对应的ip:host
输入完成以后,按Esc,输入:wq

修改域名IP对应关系:参考如下

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
185.199.108.153 documentcloud.github.com
192.30.253.112 github.com
192.30.253.118 gist.github.com
185.199.108.154 help.github.com
140.82.113.9 nodeload.github.com
199.232.28.133 raw.github.com
52.87.114.63 status.github.com
140.82.114.17 training.github.com
140.82.113.3 www.github.com
::1             localhost

查询域名对应IP的方法

https://www.ipaddress.com

你可能感兴趣的:(github访问慢的解决办法(macOS))