MacOS 无法ping 通 github.com 解决方案

复制代码
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

  • 首先打开这个网站Gitgub.com - GitHub: Let's build from here · GitHub

  • 在输入框输入:

    github.com

  • 找到DNS资源记录,里面的IP地址

  • 拼接成这样的形式下面会用到:

    140.82.112.18 github.com

下面是在终端进行的操作:

1、在终端执行

复制代码
sudo vi /etc/hosts

2、然后输入i 就可以在里面编辑内容了, 添加以下配置,注意这里的IP地址一定是你自己的访问网址得到的,每个人可能不一样!!!

  1. 配置完成之后按下esc键,然后输入:wq保存退出即可!

确保下是否配置真的完成,在终端输入以下命令可以查看:

复制代码
sudo cat /etc/hosts
  • 再ping github.com

    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

相关推荐
全栈探索者17 分钟前
从素材到成片:ffmpeg 拼接、转码与字幕,一条流水线交付
macos·ffmpeg·aigc·comfyui·视频剪辑
向阳是我3 小时前
Mac 命令行获取 APK 公钥和证书 MD5 指纹
macos
lpfasd1236 小时前
Ollama 还是 LM Studio:在 24GB 的 M6 Mac 上,我把 Ollama 卸载了
macos·策略模式
情 九6 小时前
MCP 开发环境搭建:Mac 与 Windows 跑通 Python 服务和 stdio 客户端
windows·python·macos·mcp
摘星编程6 小时前
Mac玩游戏选什么模拟器?MuMu Mac版体验:金铲铲165帧、明日方舟时停键,操作录制也上线了
macos·玩游戏·远程软件
DARLING Zero two♡7 小时前
Mac远程控制Windows电脑:MacBook远控软件选购指南2026
macos·电脑
fengye20716115 小时前
实验:CPython 迭代协议底层验证(`PyObject_GetIter` / `PyIter_Next`)
macos
DevLoom_1 天前
macOS 命令行 curl/git 报 SSL 证书错误?eMudhra 事件完整修复指南
git·macos·ssl
清水白石0081 天前
Python 安装与环境配置:Windows、macOS、Linux 完整指南(第2集)
windows·python·macos
hhhjhl1 天前
开源鸿蒙平台 CMP 三方库「compose-macos-26-ui」适配全流程
macos·开源·harmonyos