# Routes and custom databases

> Routing modes, your own via VPN, direct and block rules, subscription rules, separate servers for sites, and custom geosite and geoip databases.

## Modes

- **All via VPN.**
- **Russian sites direct**: `.ru`, `.su`, `.рф` domains and Russian addresses bypass the VPN.
- **Selective**: only what matches the rules goes through the VPN; everything else goes direct.

## Your own rules

In the route editor each rule is a site, a link, an IP address or subnet, a `geosite:` / `geoip:` category, or
`full:` (exact name), `keyword:` (part of a name) and `regexp:`. For each one you choose an action: via VPN, direct
or block.

```
youtube.com
geosite:telegram
1.2.3.0/24
full:api.example.com
keyword:openai
```

Popular services (YouTube, Telegram, ChatGPT…) and “Blocked in Russia” can be added from ready-made sets, and many
rules can be pasted as text. There is also “Block ads and trackers”.

## Subscription rules

A provider can send its own rules (a Happ profile, Xray or sing-box JSON). They work together with yours, and yours
win. A subscription refresh changes only the subscription's rules; yours stay. Any subscription rule can be turned off
with a checkbox.

## A separate server for a site

Sites and apps can be sent through a chosen server or group of servers: for example, YouTube through Poland and
ChatGPT through the best-ping server in the Netherlands. The server can even come from another subscription.

## Custom geosite and geoip databases

By default, `geosite:` and `geoip:` categories come from the SagerNet databases, and the ones missing there
(`ru-blocked` and others) from runetfreedom. In routes (“geoip and geosite databases”) you can add your own,
separately for sites and for IPs:

- an Xray/v2ray `.dat` file **from a link** (for example, from the runetfreedom, Loyalsoldier or v2fly releases);
- the same kind of file **from disk**;
- a set of `.srs` files from a link template with `{name}`: `https://…/geosite-{name}.srs`.

Your database comes first: anything it lacks is taken from the standard ones. Attributes work as in Xray:
`geosite:google@cn`, `geosite:google@!cn`. A database link syncs between your devices, but a file from disk doesn't:
on another device you have to choose it again.

## DNS

DNS over DoH, a separate DNS for direct connections, and the IPv4/IPv6 choice are in the settings.
