Documentation
¶
Overview ¶
Package dnsbpf is a CoreDNS plugin that intercepts DNS responses and populates the clawker eBPF dns_cache map with resolved IP → domain hash mappings. This enables the BPF connect4 program to route per-domain TCP traffic (e.g., SSH to github.com vs gitlab.com on port 22) to the correct Envoy listener.
The plugin uses nonwriter to capture responses from the next plugin in the chain (typically "forward"), extracts A records, and writes each resolved IP to the pinned BPF map at /sys/fs/bpf/clawker/dns_cache.
Corefile usage:
github.com {
dnsbpf
forward . 1.1.1.2 1.0.0.2
}
Index ¶
Constants ¶
const DefaultPinPath = "/sys/fs/bpf/clawker/dns_cache"
DefaultPinPath is where the eBPF manager pins the dns_cache map.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BPFMap ¶
type BPFMap struct {
// contains filtered or unexported fields
}
BPFMap wraps a pinned BPF hash map for dns_cache writes.
func OpenBPFMap ¶
OpenBPFMap opens the pinned dns_cache map.
type Handler ¶
type Handler struct {
Next plugin.Handler
Zone string // Corefile zone this instance serves (e.g., "github.com.")
Map MapWriter // Shared BPF map writer (nil = skip writes)
}
Handler implements plugin.Handler by intercepting DNS responses and writing A record results to the BPF dns_cache map.