github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/docs/configuration/dns/server.md (about)

     1  ### Structure
     2  
     3  ```json
     4  {
     5    "dns": {
     6      "servers": [
     7        {
     8          "tag": "google",
     9          "address": "tls://dns.google",
    10          "address_resolver": "local",
    11          "address_strategy": "prefer_ipv4",
    12          "strategy": "ipv4_only",
    13          "detour": "direct"
    14        }
    15      ]
    16    }
    17  }
    18  
    19  ```
    20  
    21  ### Fields
    22  
    23  #### tag
    24  
    25  The tag of the dns server.
    26  
    27  #### address
    28  
    29  ==Required==
    30  
    31  The address of the dns server.
    32  
    33  | Protocol                            | Format                        |
    34  |-------------------------------------|-------------------------------|
    35  | `System`                            | `local`                       |
    36  | `TCP`                               | `tcp://1.0.0.1`               |
    37  | `UDP`                               | `8.8.8.8` `udp://8.8.4.4`     |
    38  | `TLS`                               | `tls://dns.google`            |
    39  | `HTTPS`                             | `https://1.1.1.1/dns-query`   |
    40  | `QUIC`                              | `quic://dns.adguard.com`      |
    41  | `HTTP3`                             | `h3://8.8.8.8/dns-query`      |
    42  | `RCode`                             | `rcode://refused`             |
    43  | `DHCP`                              | `dhcp://auto` or `dhcp://en0` |
    44  | [FakeIP](/configuration/dns/fakeip) | `fakeip`                      |
    45  
    46  !!! warning ""
    47  
    48      To ensure that system DNS is in effect, rather than Go's built-in default resolver, enable CGO at compile time.
    49  
    50  !!! warning ""
    51  
    52      QUIC and HTTP3 transport is not included by default, see [Installation](/#installation).
    53  
    54  !!! info ""
    55  
    56      the RCode transport is often used to block queries. Use with rules and the `disable_cache` rule option.
    57  
    58  !!! warning ""
    59  
    60      DHCP transport is not included by default, see [Installation](/#installation).
    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 override 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.