-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router mode supports loading from disk #261
Comments
It is recommended to change to something like this to read the list [routers.router1] The content of google_domain.list is one domain name per line,
|
Routers use regexp which are less efficient, though I would still expect it work work (not tested with 500 rules yet). From your example it doesn't look like you need a regex list. To achieve the same thing without regex, you can use a blocklist. It'll let you define a large list of domain names and give you a resolver for everything that matches the list, and one for everything else. |
I test your method , thanks |
Can resolvers add sock5 proxy mode
|
Response Blocklist -> resolvers - Array of upstream resolvers, only one is supported. Only one can be filled in the upstream of the list. How to define a domain name resolver that is not in the list? |
There is a |
Can an input format like this be added?
|
You can't repeat the same properties in one group. So things like allowlist-resolver = "google_domain"
allowlist-refresh = 30
allowlist-source = [
{format = "domain", source = "/opt/routedns/google_list.txt"},
{format = "domain", source = "/opt/routedns/youtube_list.txt"},
] If you want to break this up and have different allowlist-resolvers per list, you'll need to chain a couple of blocklistv2, each with a different allowlist |
How to connect two blocklist-v2, I'm a little confused。
|
It's actually much simpler. You don't even need to use the allowlists if all you want to do is categorize queries and route them separately [groups.youtube]
type = "blocklist-v2"
resolvers = ["microsoft"] # Forward all non-matches to the next splitter
blocklist-resolver = "youtube-resolver" # This is where all matches (youtube traffic) are routed
blocklist-refresh = 30
blocklist-source = [
{format = "hosts", source = "/opt/routedns/youtube.txt"}, # This list contains all YT domains
]
[groups.microsoft]
type = "blocklist-v2"
resolvers = ["upstream"] # Forward all non-matches to the next resolver
blocklist-resolver = "microsoft-resolver" # This is where all matches (microsoft traffic) are routed
blocklist-refresh = 30
blocklist-source = [
{format = "hosts", source = "/opt/routedns/microsoft.txt"}, # This list contains all microsoft domains
] |
It's actually much simpler. You don't even need to use the allowlists if all you want to do is categorize queries and route them separately. Something like this. [groups.youtube]
type = "blocklist-v2"
resolvers = ["microsoft"] # Forward all non-matches to the next splitter
blocklist-resolver = "youtube-resolver" # This is where all matches (youtube traffic) are routed
blocklist-refresh = 30
blocklist-source = [
{format = "hosts", source = "/opt/routedns/youtube.txt"}, # This list contains all YT domains
]
[groups.microsoft]
type = "blocklist-v2"
resolvers = ["upstream"] # Forward all non-matches to the next resolver
blocklist-resolver = "microsoft-resolver" # This is where all matches (microsoft traffic) are routed
blocklist-refresh = 30
blocklist-source = [
{format = "hosts", source = "/opt/routedns/microsoft.txt"}, # This list contains all microsoft domains
] There are other ways but this is quite straightforward |
Should |
domain is true |
@folbricht I want to route 1000 domains to resolver A, another 1000 domains to resolver B, another 1000 domains to resolver C, another 1000 domains to resolver D. But blocklist-v2 can have only three resolvers (default, allow, block). Is there an easy solution apart from chaining several blocklist-v2 together? It would be great if router mode supports easily specifying thousands of domains in a route, either in a file or in a list, like blocklist-v2 format. |
There isn't currently anything like that available. Chained blocklists is likely the fastest solution. But you can also use a router with a ton of routes, though if this gets very long, let's says 10s or 100s of thousands it'll slow things down during querying since it treats them as regex and evaluates all in order. To keep the config readable, you can break out the router config into a separate file as per https://github.com/folbricht/routedns/blob/master/doc/configuration.md#Split-Configuration If you see an issue with routedns having issues with a that let me know. The original comment in this thread suggested a limit of around 500 but I can't reproduce that. Even with 2k routes the startup time isn't impacted at all for me. |
Router
Configuration:
[routers.router1]
routes = [
{ name = '(^|.)google.com.$', types = ["A", "AAAA", "MX"], resolver="google-udp" },
{ name = '(^|.)youtube.com.$', types = ["A", "AAAA", "MX"], resolver="quad9-udp" },
............. #many domain names
{ resolver="cloudflare-dot" }, # default route
]
When more than 500 lines are added here, routedns cannot be started or when the program can start the program, it cannot be used normally, and no parsing can be performed at this moment.
The text was updated successfully, but these errors were encountered: