Skip to content

DNS Rule Action

Since sing-box 1.11.0

route

{
  "action": "route",  // default
  "server": "",
  "disable_cache": false,
  "rewrite_ttl": 0,
  "client_subnet": null
}

route inherits the classic rule behavior of routing DNS requests to the specified server.

server

Required

Tag of target server.

disable_cache

Disable cache and save cache in this query.

rewrite_ttl

Rewrite TTL in DNS responses.

client_subnet

Since sing-box 1.9.0

Append a edns0-subnet OPT extra record with the specified IP prefix to every query by default.

If value is an IP address instead of prefix, /32 or /128 will be appended automatically.

Will overrides dns.client_subnet and servers.[].client_subnet.

reject

{
  "action": "reject",
  "method": "default", // default
  "no_drop": false
}

reject reject DNS requests.

method

  • default: Reply with NXDOMAIN.
  • drop: Drop the request.

no_drop

If not enabled, method will be temporarily overwritten to drop after 50 triggers in 30s.

Not available when method is set to drop.