> For the complete documentation index, see [llms.txt](https://docs.1stream.icu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1stream.icu/new/singbox-pei-zhi-shi-li.md).

# Sing-box 配置示例

1. ### 使用Rule Set

{% code title="config.json" lineNumbers="true" %}

```json
  "dns": {
    "servers": [
      {
        "tag": "google",
        "address": "8.8.8.8"
      },
      {
        "tag": "dns-unlock",
        "address": "https://xxx/dns-query",
        "address_resolver": "google"
      }
    ]
    "rules": [
      {
        "rule_set": "globalmedia",
        "server": "dns-unlock"
      }
    ]
  }

...

  "route": {
    "rule_set": [
      {
        "type": "remote",
        "tag": "globalmedia",
        "format": "binary",
        "url": "https://github.com/MetaCubeX/meta-rules-dat/raw/sing/bm7/GlobalMedia.srs"
        // See https://github.com/MetaCubeX/meta-rules-dat/issues/40
      }
    ]
  }
```

{% endcode %}

2. ### 使用无头规则

{% code title="config.json" lineNumbers="true" %}

```json
  "dns": {
    "servers": [
      {
        "tag": "google",
        "address": "8.8.8.8"
      },
      {
        "tag": "dns-unlock",
        "address": "https://xxx/dns-query",
        "address_resolver": "google"
      }
    ]
    "rules": [
      {
      "domain_suffix": [
        "netflix.com",
        "disney.com",
        "以此类推"
      ],
      "server": "dns-unlock"
      }
    ]
  }

```

{% endcode %}
