完美解决 Failed to connect to github.com port 443 after 75047 ...

97 阅读1分钟
  • 原因:DNS 污染。

  • 解决方案

    1、通过 www.ipaddress.com/ 获得 github.comIP 地址

    image.png

    点击搜索后,滚动到下面,找到 DNS Resource Records

    image.png

    2、在本机的 hosts 文件中添加:

    # Mac 系统 hosts 路径
    $ /etc/hosts
    
    # 拷贝 hosts 文件到桌面,修改拷贝出来 hosts,保存在拖回去覆盖掉原来的文件,需要输入验证密码。
    
    140.82.113.3 github.com
    

    image.png

    3、修改好 hosts 替换保存后,再次尝试命令,成功。

  • 附:如果报错 Failed to connect to raw.githubusercontent.com port 443 after 75047 .... 解决方案一样,查询 raw.githubusercontent.com 的地址,按照一样的操作配置即可。