ecs prepares EDNS0 Client Subnet (ECS) options and stores them in the request Context metadata for downstream forwarders to include in upstream queries.
forward (bool): copy client-provided EDNS0 options if present.send (bool): derive ECS from the client IP (from metadata client_addr) and attach it.preset (string): use a preset IP address instead of deriving from client.mask4 (int): IPv4 source prefix length (default: 24).mask6 (int): IPv6 source prefix length (default: 48).Basic forwarding of client-provided options:
plugins:
- type: ecs
args:
forward: true
Derive from client address and send ECS:
plugins:
- type: ecs
args:
send: true
mask4: 24
mask6: 56
Use a preset IP for ECS (testing / fixed subnet):
plugins:
- type: ecs
args:
preset: "192.0.2.1"
mask4: 24
ecs supports an exec-style quick_setup string with comma-separated key=value options, for example:
ecs: forward=true
ecs: send=true,mask4=20,mask6=40
ecs: preset=192.0.2.1
edns0_options: Vec<(u16, Vecedns0_preserve_existing: bool — whether to preserve existing options when forwarding.ecs when upstream selection should be influenced by (or should include) client subnet information, for example when interacting with geo-aware authoritative servers or CDNs.