sing-box/docs/configuration/dns/index.md

66 lines
1.3 KiB
Markdown
Raw Normal View History

2022-08-25 13:08:29 +00:00
# DNS
2022-07-08 09:01:38 +00:00
### Structure
```json
{
"dns": {
"servers": [],
"rules": [],
"final": "",
"strategy": "",
2022-07-08 09:01:38 +00:00
"disable_cache": false,
2023-03-23 11:08:48 +00:00
"disable_expire": false,
2023-04-25 20:53:25 +00:00
"independent_cache": false,
2023-03-25 04:03:23 +00:00
"reverse_mapping": false,
"fakeip": {}
2022-07-08 09:01:38 +00:00
}
}
```
### Fields
| Key | Format |
|----------|--------------------------------|
| `server` | List of [DNS Server](./server) |
| `rules` | List of [DNS Rule](./rule) |
2023-03-25 04:03:23 +00:00
| `fakeip` | [FakeIP](./fakeip) |
2022-07-08 09:01:38 +00:00
#### final
Default dns server tag.
The first server will be used if empty.
2022-07-08 09:01:38 +00:00
#### strategy
Default domain strategy for resolving the domain names.
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
2022-08-22 04:43:21 +00:00
Take no effect if `server.strategy` is set.
2022-07-08 09:01:38 +00:00
#### disable_cache
Disable dns cache.
#### disable_expire
2023-03-23 11:08:48 +00:00
Disable dns cache expire.
2023-04-25 20:53:25 +00:00
#### independent_cache
Make each DNS server's cache independent for special purposes. If enabled, will slightly degrade performance.
2023-03-23 11:08:48 +00:00
#### reverse_mapping
Stores a reverse mapping of IP addresses after responding to a DNS query in order to provide domain names when routing.
2023-03-25 04:03:23 +00:00
Since this process relies on the act of resolving domain names by an application before making a request, it can be
problematic in environments such as macOS, where DNS is proxied and cached by the system.
#### fakeip
[FakeIP](./fakeip) settings.