# DNS, sniffing and proxy selection

Source: https://onexray.com/docs/configuration/routing-options/
Description: Configure proxy/direct DNS and fallback, sniffing and active-chain least-latency routing in OneXray.
Language: en-US
Last updated: 2026-10-23


Smart Routing and each ordinary Custom route have independent DNS, sniffing and proxy-selection settings. Edit the route and save the draft; changes affecting an active App-managed route require reconnecting. Advanced/Raw and provider configurations keep their own fields.

## Proxy and direct DNS

Each path has a primary resolver and ordered fallback addresses. Both primary defaults are `8.8.8.8`; caching is on, and “fallback DNS uses the same exit” is off. Resolver entries edit only the address, including supported TCP/HTTPS forms.

Only domain-only proxy/direct rules contribute DNS matching. Proxy exceptions precede broad direct categories. Proxy-domain resolution never falls back to direct DNS. Direct resolution can try proxy DNS after failure by default; same-exit mode confines fallback to resolvers of the matched path. Disabling Smart direct DNS preserves its values without applying its domain mapping. Tunnel DNS is a separate platform setting.

Ordinary JSON uses `app-dns-proxy`/`app-dns-direct` server tags, repeated in primary/fallback order, with optional `app-dns-fake`. Root `disableCache` controls caching; `disableFallbackIfMatch` stores same-exit fallback. App generates domain lists, `finalQuery` and IPv6 query policy. Ordinary resolvers accept only address/tag: no per-resolver timeout/cache override, answer filters, stale cache or parallel-query settings. Core-native fields remain available in Advanced/Raw JSON and editor hints.

## Sniffing

Enabled by default for HTTP/TLS/QUIC; “routing only” and `metadataOnly` default off. `metadataOnly` uses metadata without reading HTTP/TLS/QUIC content. FakeDNS requires sniffing enabled. The ordinary form does not offer domain/IP exclusions.

Ordinary exchange stores one `inbounds` placeholder tagged `tunIn`, with only `sniffing.enabled`, `routeOnly` and `metadataOnly`; App manages `destOverride` and the actual listener. Advanced/Raw can keep native exclusions and complete sniffing objects.

## Round robin and least latency

Round robin is the default. Least latency probes only this connection's selected proxy chains, with at least two chains; one fixed node retains the preference without extra probes. An optional final exit is included in each complete chain. The server-list latency cache is separate.

Defaults: `https://www.google.com/generate_204`, 60 seconds and concurrent probes. The form offers 30/60/300 seconds. Imported selection parameters use HTTP(S) URLs and a supported duration of at least 10 seconds.

New connections use probe results; existing TCP/UDP sessions do not migrate. Least-latency failure falls back to the first complete proxy chain and does not silently go direct. App appends its proxy catch-all after user rules for managed TUN and enabled LAN ingress. Round robin keeps the existing first-outbound behavior and direct fallback. A reachability probe is not a Netflix/AI unlock test or a bandwidth measurement.

The Connect page shows unknown/available/failed status, recent latency and probe time from runtime metrics. Missing metrics do not mean VPN disconnected. Ordinary and Advanced exchange can set only `routing.balancers: [{tag: "proxy", strategy: {type: "roundRobin" or "leastPing"}}]` and Observatory `probeURL`, `probeInterval`, `enableConcurrency`. This is field notation, not a complete JSON file. App owns `selector`, `fallbackTag` and `subjectSelector`; extra advanced inbounds require explicit `balancerTag: proxy` rules.


