Add ECS Source Routing documentation to configuration guide
Draft for missing documentation on #471 merge
ready
Does it actually work with subnets or is it only IPs? All masks in the docs are 32 which makes me believe it's the latter.
The examples in the documentation use /32 masks because they represent individual IPs, which are the most common use case for per-client policies. However, the feature is not limited to /32. You can use any valid CIDR notation to define subnets.
[routers.ecs-router]
routes = [
# Route 1: Queries with an ECS source of 192.168.1.10/32 are sent to the adblocker.
{ ecs-source = "192.168.1.10/32", resolver = "adblock-resolver" },
# Route 2: Queries with an ECS source of 192.168.1.0/24 are sent to the unfiltered resolver.
{ ecs-source = "192.168.1.0/24", resolver = "unfiltered-resolver" },
# Route 3 (Default): All other queries (including those without ECS) go to the unfiltered resolver.
{ resolver = "unfiltered-resolver" },
]
updated the examples to be easier to understand. The net.IPNet.Contains() method supports subnet matching, meaning you can define broader subnets like 192.168.1.0/24 or 10.0.0.0/8 in your configuration, and RouteDNS will correctly match any IP within those ranges.
Thank you