Lesson 9 of 9 · 27m
DNS Monitoring and Abuse Detection: The Signals That Matter
What to log, what to alert on, how open resolvers and amplification work, and how to triage tunneling or takeovers without drowning in noise.
DNS is both infrastructure and telemetry. Almost every infected host, broken deployment, and forgotten cloud resource reveals itself in DNS before it appears in a dashboard. The catch is volume: if you alert on every odd query, analysts will mute the channel. Monitor invariants and ratios, not raw weirdness.
Start with service health
For authoritative zones, monitor externally: every advertised NS answers UDP and TCP, SOA serials match within replication delay, critical records resolve from several networks, DNSSEC validates if enabled, and the TLS service behind important names is healthy. For recursive resolvers, watch success rate, latency percentiles, SERVFAIL rate, cache hit ratio, upstream timeouts, and validation failures. A resolver can be "up" while answers are slow enough to break applications.
Open resolvers are amplification infrastructure
An open recursive resolver answers arbitrary internet clients. Combined with spoofed UDP sources and large responses, it becomes a DDoS reflector.
dig @203.0.113.53 cloudflare.com A +noall +commentsIf a supposedly authoritative-only server answers with recursion available, restrict it:
options {
recursion yes;
allow-query-cache { trusted; };
allow-recursion { trusted; };
};Separate authoritative and recursive roles wherever possible.
Logs worth keeping
Zeek's dns.log condenses queries into useful metadata:
{"ts":1732912201.4,"id.orig_h":"10.20.4.18","query":"update.cdn-vendor.example","qtype_name":"TXT","rcode_name":"NXDOMAIN","answers":[]}Useful fields are client IP, query name, qtype, response code, answers, TTL, and recursion flags. Store full packets only for short investigations; metadata scales longer and is still sensitive.
High-signal detections
- NXDOMAIN ratio spikes — malware DGA behavior, broken service discovery, or expired internal zones.
- Long/high-entropy names with TXT or NULL qtypes — possible DNS tunneling.
- Large TXT responses to few clients — exfiltration or tunneling.
- Unexpected NS, DS, DNSKEY, or CAA changes — high-impact control changes that should map to a ticket.
- Dangling CNAMEs — aliases pointing at deprovisioned cloud or SaaS resources.
Inventory every public alias with an owner, service, and decommissioning process. A quick probe is dig +short status.sudosecurity.org CNAME followed by curl -I --max-time 10 https://status.sudosecurity.org/.
RPZ is control, not monitoring
Response policy zones let a resolver rewrite or block malicious domains — often NXDOMAIN or a sinkhole address. Effective controls still need logging and an exception process. Otherwise incident response becomes archaeology into why a security rule broke a vendor integration.
Triage tunneling with context
One long TXT query is not proof; backup agents and security tools can look bizarre. Ask whether the parent domain is expected, whether volume is persistent, whether responses carry large payloads, whether the endpoint has a business reason for it, and whether peers share the pattern. Block when confidence is high; isolate when evidence is ambiguous and impact is low.
Field notes
- Monitor authoritative data and resolver experience separately; they fail differently.
- External checks must use several networks because DNS failures are path- and cache-specific.
- Baseline before tuning. Corporate endpoints generate strange but legitimate TXT and SRV traffic constantly.
- DNS logs are behavioral records: apply retention limits and access control, not just collection.
Was this lesson helpful?