Mac 打不开github解决方案

序言

github 时有打不开的情况,为此很是烦恼,这里分享一下如何解决这种问题,其实问题的本质是在访问github网页时无法通过github.com的二级域名进行动态域名解析。

解决方案

手动配置静态文件hosts,将该域名和IP的映射关系添加到静态文件中,在访问地址时会优先通过Hosts文件进行域名解析。

解决步骤

  1. 找到github.com域名对应的IP地址,输入网址:站长工具Dns查询找出最快的IP地址

  2. 打开终端,输入 sudo vim /etc/hosts

  3. 追加或者更改 本地hosts文件,本次结合命令 i --> 添加ip --> esc --> :wq (i: 进入编辑模式,esc: 退出编辑模式,:wq 保存文件并退出)

    Host Database

    localhost is used to configure the loopback interface

    when the system is booting. Do not change this entry.

    199.232.4.133 raw.githubusercontent.com
    192.30.253.119 gist.github.com
    54.169.195.247 api.github.com
    185.199.111.153 assets-cdn.github.com
    151.101.76.133 raw.githubusercontent.com
    151.101.108.133 user-images.githubusercontent.com
    151.101.76.133 gist.githubusercontent.com
    151.101.76.133 cloud.githubusercontent.com
    151.101.76.133 camo.githubusercontent.com
    151.101.76.133 avatars0.githubusercontent.com
    151.101.76.133 avatars1.githubusercontent.com
    151.101.76.133 avatars2.githubusercontent.com
    151.101.76.133 avatars3.githubusercontent.com
    151.101.76.133 avatars4.githubusercontent.com
    151.101.76.133 avatars5.githubusercontent.com
    151.101.76.133 avatars6.githubusercontent.com
    151.101.76.133 avatars7.githubusercontent.com
    151.101.76.133 avatars8.githubusercontent.com

    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    50.116.34.243 sublime.wbond.net
    127.0.0.1 www.test.com
    127.0.0.1 local.erp.com
    127.0.0.1 activate.xmind.net
    127.0.0.1 practivate.xmind.net
    127.0.0.1 lm.licenses.xmind.net
    127.0.0.1 lmlicenses.xmind.net
    127.0.0.1 www.xmind.net
    127.0.0.1 na1r.services.xmind.net
    #GitHub Start

    140.82.113.3 github.com
    140.82.121.3 github.com
    140.82.121.4 github.com
    140.82.112.3 github.com
    140.82.114.4 github.com
    20.27.177.113 github.com
    20.248.137.48 github.com
    20.200.245.247 github.com
    20.205.243.166 github.com

    140.82.113.4 gist.github.com
    199.232.5.194 github.global.ssl.fastly.net
    185.199.109.153 assets-cdn.github.com
    185.199.110.153 assets-cdn.github.com
    185.199.111.153 assets-cdn.github.com
    199.232.96.133 raw.githubusercontent.com
    199.232.96.133 gist.githubusercontent.com
    199.232.96.133 cloud.githubusercontent.com
    199.232.96.133 camo.githubusercontent.com
    199.232.96.133 avatars.githubusercontent.com
    199.232.96.133 avatars0.githubusercontent.com
    199.232.96.133 avatars1.githubusercontent.com
    199.232.96.133 avatars2.githubusercontent.com
    199.232.96.133 avatars3.githubusercontent.com
    199.232.96.133 avatars4.githubusercontent.com
    199.232.96.133 avatars5.githubusercontent.com
    199.232.96.133 avatars6.githubusercontent.com
    199.232.96.133 avatars7.githubusercontent.com
    199.232.96.133 avatars8.githubusercontent.com
    103.228.130.27 http://github.global.ssl.fastly.net
    #GitHub End

相关推荐
峰向AI2 小时前
GenOffice:开源 Office 套件,字节级保留、本地转换、BYOK模式
github
其实防守也摸鱼4 小时前
权限提升与横向移动:从内网渗透到域控的完整技术图谱
运维·服务器·数据库·安全·github·copilot·渗透
m4Rk_4 小时前
【论文阅读】Agent 记忆机制(57):MemSearch-o1——从查询词元生长证据,重组 Deep Search 记忆路径
论文阅读·人工智能·学习·开源·github
其实防守也摸鱼4 小时前
免杀与持久化入门:从载荷免杀到隐蔽通道的完整指南
运维·服务器·数据库·安全·github·copilot·渗透
sec_jay5 小时前
一个面向有限本地语料库的、单智能体、工具调用型 Agentic RAG 原型--关于agent的实践调研报告
github
goplaysource7 小时前
IPTV 频道去重:用哈希解决"同一个频道出现十遍"的问题
github
liuyicenysabel8 小时前
从 0 到 1:一套 GitHub + GHCR + k3s 的全自动 CI/CD 流水线(Flask 项目实战)
ci/cd·flask·github
kingbal8 小时前
MAC:chatgpt登陆报错签名异常
macos·chatgpt
k4m7v2pz8 小时前
macOS 窗口最小化:三种写法的实测对比与可复用脚本
macos·窗口管理·截屏·applescript·bevy·ai自动化
u1301309 小时前
GitHub 热榜项目:日榜(2026-08-31)
github