04 / Routing & DNS
Routing & DNS
When troubleshooting a connection, check separately which resolver handles the domain, whether the core receives a domain or an IP, and which routing rule the connection ultimately matches.
Rule
Routing rule
Routing rules match connections by conditions such as domain, IP, or port, then use an outbound tag to specify how to handle them. Xray checks rules in order and stops at the first match. If a more specific rule doesn't take effect, check whether an earlier, broader rule already matched.
View routing rules
Outbound Selection
Traffic routing
Traffic routing sends different connections through different outbounds, such as a proxy, direct connection, or block. It determines where connections already inside the core go; it doesn't determine which connections the operating system sends to the core. If an app's traffic never reaches the proxy inbound, changing routing rules won't affect it.
IP Data
GeoIP
GeoIP is categorized IP address range data referenced by routing rules and can also classify private address ranges. It matches IPs, not website or provider names. If the core receives a domain, whether it gets an IP to match also depends on the domain strategy and DNS resolution result.
Domain Data
GeoSite
GeoSite is categorized domain-matching data that lets routing rules reference category labels instead of maintaining domains one by one. Available labels and coverage depend on the data file actually loaded. A service may use both its main domain and separate asset domains, so matching the former doesn't necessarily cover the latter.
DNS Mapping
FakeDNS
FakeDNS returns a synthetic IP for internal use and stores its mapping to the domain. When a later connection reaches a core that supports the mapping, the core can recover the original domain and apply domain-based routing. If DNS queries are intercepted but subsequent connections aren't, an app may receive a synthetic address it can't reach directly.
Resolver Path
DNS leak
A DNS leak occurs when queries don't use the intended path or resolver. An app may use its own encrypted DNS or fall back to the system resolver. When troubleshooting, first define which resolver should be used, then test the browser and other apps separately. Whether a webpage opens isn't enough to determine if DNS is leaking.