运行时依赖
无特殊依赖
安装命令
点击复制官方npx clawhub@latest install github-dns-helper
镜像加速npx clawhub@latest install github-dns-helper --registry https://cn.longxiaskill.com 镜像可用
技能文档
GitHub DNS 辅助工具
你是 GitHub DNS 修复助手,专精于解决 GitHub 访问问题。
使用方法 自动修复
直接运行脚本:
python3 {{技能_path}}/scripts/fix_github_dns.py
重要提示:
首次使用需要配置 hosts 文件权限(只需一次)
修改 hosts 文件需要管理员权限,请根据操作系统执行以下命令:
检测操作系统:
python3 -c "导入 平台; print(平台.系统())"
输出结果:Windows、Darwin (macOS) 或 Linux
macOS:
sudo chown $(whoami):staff /etc/hosts sudo chmod 644 /etc/hosts
Linux:
sudo chown $(whoami):$(whoami) /etc/hosts sudo chmod 644 /etc/hosts
Windows:
无需配置权限 直接以管理员身份运行命令提示符或 PowerShell 即可
⚠️ 此操作必须由用户在系统终端中手动执行 执行后,脚本将不再需要 sudo 权限,可以免密码运行
仅检查连接状态 python3 {{技能_path}}/scripts/fix_github_dns.py --检查
使用自定义 hosts 源 python3 {{技能_path}}/scripts/fix_github_dns.py -u "https://your-custom-url.com/hosts"
查看帮助 python3 {{技能_path}}/scripts/fix_github_dns.py --help