radius-dns-sd (RADIUS DNS Service Discovery Backend)
The radius-dns-sd backend discovers upstream RADIUS servers dynamically using
DNS Service Discovery (typically a choreography of NAPTR → SRV → A/AAAA lookups),
then proxies authentication / authorization (and potentially accounting)
requests to currently resolvable endpoints. It removes the need to hard-code
server IPs and supports elastic / multi-region or rotating infrastructure.
When to Use
| Scenario | Benefit |
|---|---|
| Large distributed RADIUS deployment | Automatic endpoint rotation & scaling |
| Roaming / federation environment | Seamless partner endpoint changes via DNS |
| Zero/low manual reconfiguration | Updates propagate through DNS TTL changes |
| Multi-protocol migrations (e.g. adding RadSec) | Controlled adoption by publishing new NAPTR records |
Core Elements
| Statement / Block | Required | Description |
|---|---|---|
naptr-service "..."; | Yes | NAPTR service pattern (e.g. _radius._udp, _radsec._tcp). Repeat for multiple patterns. |
challenge-timeout <ms>; | No | Timeout for Access-Challenge / round-trip operations. Default: 60000. |
server-template { ... } | Yes | Default parameters (secret, timeouts, retries, status, etc.) applied to discovered endpoints. |
@pre-proxying { ... } | No | Modify / filter request before upstream forwarding. |
@post-proxying { ... } | No | Modify / filter reply before returning to client. |
statistics { ... } | No | Optional metrics configuration if supported. |
A discovered server inherits every applicable setting from server-template.
If a dynamic endpoint later disappears from DNS, new requests will stop being
routed to it once caches expire.
Discovery Flow (Conceptual)
- Iterate
naptr-serviceentries in order:- Perform NAPTR query for each pattern.
- For each resulting service, perform SRV lookups obtaining priority/weight/port/target.
- Resolve target hostnames to A/AAAA addresses.
- Construct candidate endpoint list (host/IP + port + transport protocol implied by pattern).
- Apply load selection or fallback strategy implicitly (for DNS-SD backend the strategy is governed by current DNS answers; explicit
server-selectionis replaced by DNS weighting). - Proxy the request to a chosen endpoint.
Example
backends {
radius-dns-sd "RADIUS_ROAMING" {
naptr-service "_radius._udp";
naptr-service "_radsec._tcp";
challenge-timeout 5000;
server-template {
secret "FederationSecret2024!";
timeout 4000;
retries 1;
status true;
connections {
max 8;
min 1;
idle-timeout 300;
}
# Optionally override transport if discovery lacks explicit hints:
# connect { protocol tls; }
}
@pre-proxying {
filter {
# Remove sensitive local-only attributes if needed
# Tunnel-Password;
}
modify {
# Example (pseudo):
# radiusproxy.request.attr.Operator-Name := "EXAMPLE_REALM";
}
}
@post-proxying {
filter {
# Strip vendor attributes not permitted downstream
# vendor-specific;
}
}
}
}
> **Note:** The `@` prefix is required for pipeline blocks. The legacy syntax without `@` (e.g., `pre-proxying {}`, `post-proxying {}`) is deprecated and emits warnings. Use `@pre-proxying {}` and `@post-proxying {}` for new configurations.
naptr-service
Ordered preference. First successful pattern anchors subsequent SRV queries. A
common deployment might start with secure transport (_radsec._tcp) and fall
back to _radius._udp if secure endpoints are not yet published.
Repeat the statement for each pattern:
naptr-service "_radsec._tcp";
naptr-service "_radius._udp";
Server Template Fields
| Field | Purpose |
|---|---|
secret | Shared secret used for signing/encrypting RADIUS messages with discovered endpoints. |
timeout | Milliseconds to wait per request (excluding retries). |
retries | How many retransmissions before marking attempt failed. |
status | Enables Status-Server health polling if supported (default: false). |
connections { ... } | Connection pool settings. Use max, min, and idle-timeout inside it. |
connect { ... } | Optional transport override (protocol, buffer, tls) if DNS data insufficient. |
If DNS returns transport explicitly (e.g. from the NAPTR service pattern), those should take precedence
internally; the connect override is a fallback hint.
The connect block accepts:
protocol- Transport protocol:udp,tcp, ortls.buffer- Socket buffer size in bytes.tls { ... }- TLS configuration block (when usingtlsprotocol).