Skip to content

Route

Changes in sing-box 1.12.0

default_domain_resolver
geoip
geosite

Changes in sing-box 1.8.0

rule_set
geoip
geosite

Structure

{
  "route": {
    "rules": [],
    "rule_set": [],
    "final": "",
    "auto_detect_interface": false,
    "override_android_vpn": false,
    "default_interface": "",
    "default_mark": 0,
    "default_domain_resolver": "", // or {}
    "default_network_strategy": "",
    "default_network_type": [],
    "default_fallback_network_type": [],
    "default_fallback_delay": "",
    "default_tcp_keep_alive": "",
    "default_tcp_keep_alive_interval": "",
    "sniff_override_destination": false,
    "asn": {},

    // Removed

    "geoip": {},
    "geosite": {}
  }
}

You can ignore the JSON Array [] tag when the content is only one item

Fields

rules

List of Route Rule

rule_set

Since sing-box 1.8.0

List of rule-set

final

Default outbound tag. the first outbound will be used if empty.

auto_detect_interface

Only supported on Linux, Windows and macOS.

Bind outbound connections to the default NIC by default to prevent routing loops under tun.

Takes no effect if outbound.bind_interface is set.

override_android_vpn

Only supported on Android.

Accept Android VPN as upstream NIC when auto_detect_interface enabled.

default_interface

Only supported on Linux, Windows and macOS.

Bind outbound connections to the specified NIC by default to prevent routing loops under tun.

Takes no effect if auto_detect_interface is set.

default_mark

Only supported on Linux.

Set routing mark by default.

Takes no effect if outbound.routing_mark is set.

default_domain_resolver

Since sing-box 1.12.0

See Dial Fields for details.

Can be overrides by outbound.domain_resolver.

default_network_strategy

Since sing-box 1.11.0

See Dial Fields for details.

Takes no effect if outbound.bind_interface, outbound.inet4_bind_address or outbound.inet6_bind_address is set.

Can be overrides by outbound.network_strategy.

Conflicts with default_interface.

default_network_type

Since sing-box 1.11.0

See Dial Fields for details.

default_fallback_network_type

Since sing-box 1.11.0

See Dial Fields for details.

default_fallback_delay

Since sing-box 1.11.0

See Dial Fields for details.

default_tcp_keep_alive

Default TCP keep-alive initial period for outbound connections. 5m is used by default.

Can be overridden by outbound dial settings.

default_tcp_keep_alive_interval

Default TCP keep-alive interval for outbound connections. 75s is used by default.

Can be overridden by outbound dial settings.

sniff_override_destination

Global default: when a sniff rule action successfully detects a domain name from the connection (e.g. TLS SNI, HTTP Host header), replace the connection's IP destination with the sniffed domain name, keeping the same port.

This causes subsequent DNS resolution and routing decisions to use the domain name rather than the original IP address, which is useful for:

  • Accurate domain-based routing after receiving an IP connection (e.g. from a transparent proxy)
  • Enabling remote DNS resolution by the outbound instead of relying on the client's resolved IP

Preferred approach — per-rule override_destination:

Use the override_destination field on individual sniff rule actions to enable the override selectively, without affecting all rules:

{
  "route": {
    "rules": [
      {
        "action": "sniff",
        "override_destination": true
      }
    ]
  }
}

See sniff action for details.

Global fallback:

{
  "route": {
    "sniff_override_destination": true,
    "rules": [
      {
        "action": "sniff"
      }
    ]
  }
}

The override only applies when a domain name is successfully sniffed. If sniffing fails or the connection carries no recognisable domain (e.g. raw IP traffic), the destination is left unchanged.

Can also be set per-inbound via the deprecated inbound.sniff_override_destination option.

asn

ASN database configuration. Required for dst_asn in LoadBalance hash key parts and for ip_asn route rules.

Field Description
path Path to the ASN MMDB file
download_url URL to automatically download the database from
download_detour Outbound tag to use for downloading the database

Supports MaxMind GeoLite2-ASN format (MMDB).