惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
WordPress大学
WordPress大学
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
L
LangChain Blog
雷峰网
雷峰网
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
NISL@THU
NISL@THU
Scott Helme
Scott Helme
量子位
S
Security Affairs
T
Threat Research - Cisco Blogs
博客园_首页
云风的 BLOG
云风的 BLOG
D
Docker
AWS News Blog
AWS News Blog
腾讯CDC
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
U
Unit 42
Recent Announcements
Recent Announcements
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
T
The Exploit Database - CXSecurity.com
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Last Watchdog
The Last Watchdog
C
Cybersecurity and Infrastructure Security Agency CISA
IT之家
IT之家
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
F
Full Disclosure
L
Lohrmann on Cybersecurity
The Hacker News
The Hacker News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
S
Security @ Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Check Point Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
I
InfoQ

Super Blog

[译] 我所知道的全部智能体工程技巧(2026 年 6 月) 2024:悲观者正确,乐观者前行 Overleaf LaTeX citation 无法正常显示问题解决 我和我的 2023 新起点 使用 Arc 浏览器自定义网页 我和我的 2022 Genius Bar 两日游 实训小记 《软件测试技术》笔记 Q-Learning 简介 软件测试技术实验 3 和 4 遇到的一些问题和解决方案 我和我的 2021 写过的第二个 App 在 SwiftUI 中自定义修饰器 关于最近,以及…… 《数据库原理》笔记 《数字逻辑与数字系统》笔记 《形式化方法》笔记 宣言
Mac 终端无法联网问题解决
SUPER · 2024-12-21 · via Super Blog

神奇的 macOS。

问题

今天本想装个东西,但 brew update 时一直报 could not resolve host。第一时间觉得是 Clash 的问题,于是设置了 proxy,但仍未解决,尝试 unset 但也无济于事。

后来发现不仅对于 github.com 报错,甚至对镜像 mirrors.tuna.tsinghua.edu.cn 也报错,ping 了一下 github.combaidu.com,果然都不通。因此并不是 proxy 的问题。

尝试 ping 8.8.8.8,发现可以通。因此原因基本可以锁定是 DNS 设置的问题。

但之前从未更改过 Mac 的 DNS 设置,为什么终端突然不能联网了呢?尝试在 Settings - Wi-Fi - Details - DNS - DNS Servers 添加了两个阿里云的 DNS Server:223.5.5.5223.6.6.6,并刷新 DNS 缓存:

1
2
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

稍等几分钟后,终端网络恢复正常。

总结

当 Mac 终端无法联网时,大多是因为两种情况:proxy 和 DNS,首先可以通过 ping 一个 IP(如 ping 8.8.8.8)检查是否是 DNS 的问题。

如果是 DNS 的问题,手动在 Settings - Wi-Fi - Details - DNS - DNS Servers 处添加公共 DNS Server(如 223.5.5.5223.6.6.6)并刷新缓存:

1
2
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

这种方式在大多数情况下应该都可以解决 DNS 问题导致的网络连接问题。