Injects configurable DNS errors into DNS queries on the host for a specific duration. Unlike "Block DNS", which completely blocks access to DNS servers, this attack intercepts DNS queries and responds with specific error codes or simulates timeouts. This allows testing how services handle different DNS failure modes.
Details
When multiple error types are selected, each DNS query receives a randomly chosen error from the configured set.
Supported error types:
NXDOMAIN - Responds as if the domain does not exist
SERVFAIL - Responds with a server failure error
TIMEOUT - Drops the DNS query, simulating a timeout (no response is sent)
Prerequisites
The host kernel must support eBPF with TCX (Linux 6.6+). The extension requires CAP_BPF and CAP_NET_ADMIN capabilities.
Rollback
When the attack duration expires or the attack is stopped, the eBPF program is detached from the network interface and removed.
Use Cases
Test how services handle DNS NXDOMAIN errors (e.g., during domain migration or misconfiguration)
Verify retry and fallback behavior when DNS servers return SERVFAIL
Simulate DNS timeout scenarios to test client-side timeout handling and caching
Validate that services degrade gracefully under intermittent DNS failures
Test service mesh and sidecar proxy behavior under DNS errors
Parameters
Parameter
Description
Default
Duration
How long should the DNS errors be injected?
30s
DNS Error Type
DNS error to inject. Multiple types can be selected for random injection. Possible values: NXDOMAIN, SERVFAIL, TIMEOUT
NXDOMAIN
DNS Port
DNS port or port range to intercept
53
Target CIDRs
IP CIDRs to match. If empty, all DNS traffic is affected