解决Mac安装git安装包时报错443问题
问题描述:Mac运行brew install xxx 报错
报错信息:fatal: unable to access ‘https://github.com/Homebrew/homebrew-core/’: Failed to connect to github.com port 443: Operation timed out
原因分析:GitHub无法访问
解决方案:修改hosts文件
- 查询域名对应的dns
网站:http://tool.chinaz.com/dns?
输入域名查询出对应的dns,选择TTL值最小的一个 - 修改hosts文件
Mac打开访达->前往->前往文件夹->输入/etc
在hosts文件中添加如下内容
185.199.111.153 binance-docs.github.io
192.30.255.112 github.com
8.7.198.45 gist.github.com
192.30.255.117 api.github.com
185.199.110.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
⚠️ip地址为步骤1中查询到的地址