github.com/sagernet/sing-box@v1.9.0-rc.20/docs/configuration/dns/server.md (about) 1 --- 2 icon: material/new-box 3 --- 4 5 !!! quote "Changes in sing-box 1.9.0" 6 7 :material-plus: [client_subnet](#client_subnet) 8 9 ### Structure 10 11 ```json 12 { 13 "dns": { 14 "servers": [ 15 { 16 "tag": "", 17 "address": "", 18 "address_resolver": "", 19 "address_strategy": "", 20 "strategy": "", 21 "detour": "", 22 "client_subnet": "" 23 } 24 ] 25 } 26 } 27 ``` 28 29 ### Fields 30 31 #### tag 32 33 The tag of the dns server. 34 35 #### address 36 37 ==Required== 38 39 The address of the dns server. 40 41 | Protocol | Format | 42 |--------------------------------------|-------------------------------| 43 | `System` | `local` | 44 | `TCP` | `tcp://1.0.0.1` | 45 | `UDP` | `8.8.8.8` `udp://8.8.4.4` | 46 | `TLS` | `tls://dns.google` | 47 | `HTTPS` | `https://1.1.1.1/dns-query` | 48 | `QUIC` | `quic://dns.adguard.com` | 49 | `HTTP3` | `h3://8.8.8.8/dns-query` | 50 | `RCode` | `rcode://refused` | 51 | `DHCP` | `dhcp://auto` or `dhcp://en0` | 52 | [FakeIP](/configuration/dns/fakeip/) | `fakeip` | 53 54 !!! warning "" 55 56 To ensure that Android system DNS is in effect, rather than Go's built-in default resolver, enable CGO at compile time. 57 58 !!! info "" 59 60 the RCode transport is often used to block queries. Use with rules and the `disable_cache` rule option. 61 62 | RCode | Description | 63 |-------------------|-----------------------| 64 | `success` | `No error` | 65 | `format_error` | `Format error` | 66 | `server_failure` | `Server failure` | 67 | `name_error` | `Non-existent domain` | 68 | `not_implemented` | `Not implemented` | 69 | `refused` | `Query refused` | 70 71 #### address_resolver 72 73 ==Required if address contains domain== 74 75 Tag of a another server to resolve the domain name in the address. 76 77 #### address_strategy 78 79 The domain strategy for resolving the domain name in the address. 80 81 One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`. 82 83 `dns.strategy` will be used if empty. 84 85 #### strategy 86 87 Default domain strategy for resolving the domain names. 88 89 One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`. 90 91 Take no effect if overridden by other settings. 92 93 #### detour 94 95 Tag of an outbound for connecting to the dns server. 96 97 Default outbound will be used if empty. 98 99 #### client_subnet 100 101 !!! question "Since sing-box 1.9.0" 102 103 Append a `edns0-subnet` OPT extra record with the specified IP prefix to every query by default. 104 105 If value is an IP address instead of prefix, `/32` or `/128` will be appended automatically. 106 107 Can be overrides by `rules.[].client_subnet`. 108 109 Will overrides `dns.client_subnet`.