> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 包含缓存的 DNS 记录信息的系统表。

# system.dns_cache

<Info>
  **在 ClickHouse Cloud 中查询**

  此系统表中的数据分别保存在 ClickHouse Cloud 各节点的本地。因此，如需查看所有数据的完整情况，需要使用 `clusterAllReplicas` 函数。更多详情请参见[此处](/zh/reference/system-tables/overview#system-tables-in-clickhouse-cloud)。
</Info>

<div id="description">
  ## 描述
</div>

包含有关已缓存 DNS 记录的信息。

<div id="columns">
  ## 列
</div>

* `hostname` ([String](/zh/reference/data-types)) — 主机名。
* `ip_address` ([String](/zh/reference/data-types)) — IP 地址。
* `ip_family` ([Enum8('IPv4' = 0, 'IPv6' = 1, 'UNIX\_LOCAL' = 2)](/zh/reference/data-types)) — IP 地址族。
* `cached_at` ([DateTime](/zh/reference/data-types)) — 记录被缓存时的时间戳。

<div id="example">
  ## 示例
</div>

```sql title="Query" theme={null}
SELECT * FROM system.dns_cache;
```

| 主机名       | IP 地址     | IP 地址族 | cached\_at          |
| :-------- | :-------- | :----- | :------------------ |
| localhost | ::1       | IPv6   | 2024-02-11 17:04:40 |
| localhost | 127.0.0.1 | IPv4   | 2024-02-11 17:04:40 |

<div id="see-also">
  ## 另请参见
</div>

* [disable\_internal\_dns\_cache 设置](/zh/reference/settings/server-settings/settings#disable_internal_dns_cache)
* [dns\_cache\_max\_entries 设置](/zh/reference/settings/server-settings/settings#dns_cache_max_entries)
* [dns\_cache\_update\_period 设置](/zh/reference/settings/server-settings/settings#dns_cache_update_period)
* [dns\_max\_consecutive\_failures 设置](/zh/reference/settings/server-settings/settings#dns_max_consecutive_failures)
