起因

最近想着OPN充值的OCI云资源都没怎么用,眼看着一年就快过去了,怎么着都得把资源用一用,才不至于让资本家薅去一条羊腿。于是又开始趁着上班闲余的时候做一些试验。

尝试在Mac上安装OCI的CLI,

bash -c “$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)”

却发现一直报curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused的错误。梯子架了全局模式貌似也不生效。

这讨厌的DNS污染问题。

解决方法

打开https://www.ipaddress.com/,输入raw.githubusercontent.com,得到githubusercontent.com的真正IP地址。

修改/etc/hosts文件,增加以下几行:

199.232.96.133 raw.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com
199.232.96.133 avatars2.githubusercontent.com
199.232.96.133 avatars1.githubusercontent.com

重新运行CLI安装命令,成功完成。