---
title: "Wi-Fi is connected to the Internet, but the DNS settings may not be set up properly · Kilobat 指南"
url: "https://kilobat.app/zh-hans/guides/wifi-connected-dns-settings-not-set-up-properly"
description: "“网络”设置警告 Wi-Fi 已连接，但 DNS 可能有误。测试服务器并清除错误的 DNS 条目。"
---

# “Wi-Fi is connected to the Internet, but the DNS settings may not be set up properly”

Mac 有地址也有路由，但 DNS 服务器没有响应。在修复之前，名称无法解析。

**让你的智能体来解决**拷贝一条提示词，适用于 Claude Code、Codex 或任何能使用终端的智能体。

我的 Mac 出现了这个问题：“Wi-Fi is connected to the Internet, but the DNS settings may not be set up properly”。请阅读 https://kilobat.app/zh-hans/guides/wifi-connected-dns-settings-not-set-up-properly.md，并和我一起逐步处理。如果缺少 Kilobat CLI，请安装：brew install seifip/kilobat/kilobat。请你自己运行指南中的终端和 kilobat 检查，并告诉我发现了什么。列出只有我才能完成的步骤。更改任何设置之前先问我。

适用于：所有当前的 macOS 版本。文本已在 macOS 27.2 的“网络”设置中核对。 · 核查日期：2026年10月29日

## 症状

- “系统设置 › 网络”显示该服务已连接到互联网，但 DNS 设置可能没有正确设置。
- 页面失败，提示“server not found”。
- ping IP 地址能成功。

## 可能的原因

- **你手动输入的 DNS 服务器。**服务器已宕机，或者这个网络阻止了它。
- **路由器没有转发 DNS。**路由器从它的上游服务器得不到应答。
- **VPN、过滤器或描述文件。**它们可能会把查询发给你无法访问的服务器。

## 如何检查

1. 先 ping IP 地址，再 ping 名称。如果只有名称失败，原因就是 DNS。

   ```
   ping -c 3 1.1.1.1
   ```
2. 显示 macOS 使用的解析器。

   ```
   scutil --dns
   ```
3. 显示你手动设置的 DNS 服务器。

   ```
   networksetup -getdnsservers Wi-Fi
   ```

## 如何修复

1. 删除你添加的 DNS 服务器。使用“系统设置 › 网络 › Wi-Fi › 详细信息 › DNS”。参见[Mac 上 DNS 无法解析](https://kilobat.app/zh-hans/guides/dns-server-not-found)。
2. 清除 DNS 缓存。请参阅[在 Mac 上刷新 DNS 缓存](https://kilobat.app/zh-hans/guides/flush-dns-cache-mac)。
3. 续租，让路由器重新分配 DNS 服务器。参见[续租 Mac 上的 DHCP 租约](https://kilobat.app/zh-hans/guides/renew-dhcp-lease-mac)。
4. 测试时关闭 VPN。参见[VPN 上内部名称无法解析](https://kilobat.app/zh-hans/guides/vpn-split-dns-internal-names)。
5. 如果所有设备都失败，请重新启动路由器。

## 使用 Kilobat

1. Kilobat 会为一次 DNS 查询计时，并列出正在使用的解析器。查看 `dnsServers`。

   ```
   kilobat diagnose --json
   ```
2. CLI 免费。在 App 中，这些检查给出的建议属于 Kilobat Pro。请参阅[找出某个网站或 API 连不上的原因](https://kilobat.app/zh-hans/guides/recipes/why-cant-it-connect)。

## 常见问题

**以太网上也会显示这条警告吗？**

文字中会写明服务名称。它显示的是你正在查看的服务的名称。

**连接断了吗？**

链路是正常的。按名称查询失败了。

## 参考资料

- Network.appex（系统设置）中的错误文本，macOS 27.2（Localizable.loctable）
- scutil(8) 和 networksetup(8)，macOS 27.2 自带的 man 手册页

核查日期：2026 年 10 月 29 日。

## 相关指南

- [Mac 上 DNS 无法解析](https://kilobat.app/zh-hans/guides/dns-server-not-found): DNS 出故障时，Mac 无法把 apple.com 这样的名称转换成 IP 地址。
- [Mac 上 DNS 慢](https://kilobat.app/zh-hans/guides/slow-dns-mac): 每个新网站在加载前都需要先进行 DNS 查询。
- [在 Mac 上刷新 DNS 缓存](https://kilobat.app/zh-hans/guides/flush-dns-cache-mac): macOS 会把 DNS 回答保留一段时间。
- [Mac 上的“This network is blocking encrypted DNS traffic”](https://kilobat.app/zh-hans/guides/encrypted-dns-blocked-network): 当加密的 DNS 查询无法通过时，macOS 会在 Wi-Fi 网络下显示这条说明。
- [Mac 已连接 Wi-Fi 但无法上网](https://kilobat.app/zh-hans/guides/wifi-connected-no-internet): Wi-Fi 连接只是通往路由器的那一段链路。
