!!! question "Since sing-box 1.12.0"
{
  "dns": {
    "servers": [
      {
        "type": "hosts",
        "tag": "",
        "path": [],
        "predefined": {}
      }
    ]
  }
}
!!! note ""
You can ignore the JSON Array [] tag when the content is only one item
List of paths to hosts files.
/etc/hosts is used by default.
C:\Windows\System32\Drivers\etc\hosts is used by default on Windows.
Example:
{
  // "path": "/etc/hosts"
  
  "path": [
    "/etc/hosts",
    "$HOME/.hosts"
  ]
}
Predefined hosts.
Example:
{
  "predefined": {
    "www.google.com": "127.0.0.1",
    "localhost": [
      "127.0.0.1",
      "::1"
    ]
  }
}
=== "Use hosts if available"
```json
{
  "dns": {
    "servers": [
      {
        ...
      },
      {
        "type": "hosts",
        "tag": "hosts"
      }
    ],
    "rules": [
      {
        "ip_accept_any": true,
        "server": "hosts"
      }
    ]
  }
}
```