github.com/sagernet/sing-box@v1.9.0-rc.20/docs/configuration/dns/index.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  # DNS
    10  
    11  ### Structure
    12  
    13  ```json
    14  {
    15    "dns": {
    16      "servers": [],
    17      "rules": [],
    18      "final": "",
    19      "strategy": "",
    20      "disable_cache": false,
    21      "disable_expire": false,
    22      "independent_cache": false,
    23      "reverse_mapping": false,
    24      "client_subnet": "",
    25      "fakeip": {}
    26    }
    27  }
    28  
    29  ```
    30  
    31  ### Fields
    32  
    33  | Key      | Format                          |
    34  |----------|---------------------------------|
    35  | `server` | List of [DNS Server](./server/) |
    36  | `rules`  | List of [DNS Rule](./rule/)     |
    37  | `fakeip` | [FakeIP](./fakeip/)             |
    38  
    39  #### final
    40  
    41  Default dns server tag.
    42  
    43  The first server will be used if empty.
    44  
    45  #### strategy
    46  
    47  Default domain strategy for resolving the domain names.
    48  
    49  One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
    50  
    51  Take no effect if `server.strategy` is set.
    52  
    53  #### disable_cache
    54  
    55  Disable dns cache.
    56  
    57  #### disable_expire
    58  
    59  Disable dns cache expire.
    60  
    61  #### independent_cache
    62  
    63  Make each DNS server's cache independent for special purposes. If enabled, will slightly degrade performance.
    64  
    65  #### reverse_mapping
    66  
    67  Stores a reverse mapping of IP addresses after responding to a DNS query in order to provide domain names when routing.
    68  
    69  Since this process relies on the act of resolving domain names by an application before making a request, it can be
    70  problematic in environments such as macOS, where DNS is proxied and cached by the system.
    71  
    72  #### client_subnet
    73  
    74  !!! question "Since sing-box 1.9.0"
    75  
    76  Append a `edns0-subnet` OPT extra record with the specified IP prefix to every query by default.
    77  
    78  If value is an IP address instead of prefix, `/32` or `/128` will be appended automatically.
    79  
    80  Can be overrides by `servers.[].client_subnet` or `rules.[].client_subnet`.