> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.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>

## 描述

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

## 列

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

## 示例

```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 |

## 另请参见

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