目录

Mac DNS 错误 域名解析不了 ping: cannot resolve Unknown host

目录

如果出现

  • ping: cannot resolve www.baidu.com: Unknown host
  • 连上网络后却无法访问
  • 唤醒后无法上网

可通过如下命令解决:

1
2
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

上述简化为一条命令:

1
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist && sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

参考: Mac DNS 错误 域名解析不了解决方式 - 简书