---
url: /configuration/inbound/dns.md
description: 在入站地址上回答 DNS 查询
---

# dns

在 UDP/TCP 上回答 mayami DNS 规则生成的响应。

```yaml check
inbounds:
  resolver:
    type: dns
    listen: 127.0.0.1:5353

dns:
  servers:
    default: {type: udp, address: 127.0.0.1:53}
  final: default
```

## 字段

### type

* 类型：字符串。
* 必填：是，第一项。
* 取值：`dns`。

### listen

* 类型：`SocketAddr`。
* 必填：是。
* 取值：`IP:port`。

公共监听字段 `interface`、TCP keepalive、MPTCP、拥塞控制和 `proxy_protocol` 可用，见 [入站总览](/configuration/inbound/#公共监听字段)。`network`、`udp_timeout`、`full_cone` 对 DNS 不生效并会被拒绝。`transport` 和 `fallback` 也没有意义。

## 说明

这个入站只负责“问到路由器的 DNS”。系统 DNS 服务器、规则、FakeIP 和上游仍在顶层 `dns` 配置中。DNS 同时处理 UDP 与 TCP；其他协议的包不会交给它。

## 相关

* [入站总览](/configuration/inbound/)
* [共享 listen](/configuration/shared/listen)
