2022-07-08 17:01:38 +08:00
|
|
|
### Structure
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"dns": {
|
|
|
|
"servers": [
|
|
|
|
{
|
|
|
|
"tag": "google",
|
|
|
|
"address": "tls://dns.google",
|
|
|
|
"address_resolver": "local",
|
|
|
|
"address_strategy": "prefer_ipv4",
|
2022-08-22 12:43:21 +08:00
|
|
|
"strategy": "ipv4_only",
|
2022-07-08 17:01:38 +08:00
|
|
|
"detour": "direct"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
### Fields
|
|
|
|
|
|
|
|
#### tag
|
|
|
|
|
|
|
|
The tag of the dns server.
|
|
|
|
|
|
|
|
#### address
|
|
|
|
|
2022-07-09 09:26:50 +08:00
|
|
|
==Required==
|
|
|
|
|
2022-07-08 17:01:38 +08:00
|
|
|
The address of the dns server.
|
|
|
|
|
|
|
|
| Protocol | Format |
|
|
|
|
|----------|-----------------------------|
|
|
|
|
| `System` | `local` |
|
|
|
|
| `TCP` | `tcp://1.0.0.1` |
|
|
|
|
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
|
|
|
|
| `TLS` | `tls://dns.google` |
|
|
|
|
| `HTTPS` | `https://1.1.1.1/dns-query` |
|
2022-07-27 12:03:07 +08:00
|
|
|
| `QUIC` | `quic://dns.adguard.com` |
|
|
|
|
| `HTTP3` | `h3://8.8.8.8/dns-query` |
|
|
|
|
| `RCode` | `rcode://refused` |
|
2022-07-08 17:01:38 +08:00
|
|
|
|
|
|
|
!!! warning ""
|
|
|
|
|
2022-08-24 16:23:21 +08:00
|
|
|
To ensure that system DNS is in effect, rather than Go's built-in default resolver, enable CGO at compile time.
|
2022-07-08 17:01:38 +08:00
|
|
|
|
2022-07-27 12:03:07 +08:00
|
|
|
!!! warning ""
|
|
|
|
|
2022-08-23 23:15:56 +08:00
|
|
|
QUIC and HTTP3 transport is not included by default, see [Installation](/#installation).
|
2022-07-27 12:03:07 +08:00
|
|
|
|
|
|
|
!!! info ""
|
|
|
|
|
|
|
|
the RCode transport is often used to block queries. Use with rules and the `disable_cache` rule option.
|
|
|
|
|
|
|
|
| RCode | Description |
|
|
|
|
|-------------------|-----------------------|
|
|
|
|
| `success` | `No error` |
|
|
|
|
| `format_error` | `Format error` |
|
|
|
|
| `server_failure` | `Server failure` |
|
|
|
|
| `name_error` | `Non-existent domain` |
|
|
|
|
| `not_implemented` | `Not implemented` |
|
2022-08-24 16:23:21 +08:00
|
|
|
| `refused` | `Query refused` |
|
2022-07-27 12:03:07 +08:00
|
|
|
|
2022-07-08 17:01:38 +08:00
|
|
|
#### address_resolver
|
|
|
|
|
2022-07-09 09:26:50 +08:00
|
|
|
==Required if address contains domain==
|
|
|
|
|
2022-07-08 17:01:38 +08:00
|
|
|
Tag of a another server to resolve the domain name in the address.
|
|
|
|
|
|
|
|
#### address_strategy
|
|
|
|
|
|
|
|
The domain strategy for resolving the domain name in the address.
|
|
|
|
|
|
|
|
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
|
|
|
2022-07-08 18:48:43 +08:00
|
|
|
`dns.strategy` will be used if empty.
|
2022-07-08 17:01:38 +08:00
|
|
|
|
2022-08-22 12:43:21 +08:00
|
|
|
#### strategy
|
|
|
|
|
|
|
|
Default domain strategy for resolving the domain names.
|
|
|
|
|
|
|
|
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
|
|
|
|
|
|
Take no effect if override by other settings.
|
|
|
|
|
2022-07-08 17:01:38 +08:00
|
|
|
#### detour
|
|
|
|
|
|
|
|
Tag of an outbound for connecting to the dns server.
|
|
|
|
|
2022-07-09 09:26:50 +08:00
|
|
|
Default outbound will be used if empty.
|