Join our Newsletter — 33% off our NHI Course

How do attackers use DNS tunnelling?

Attackers use DNS tunnelling to hide data or command-and-control traffic inside DNS queries and responses. This can bypass some network controls because DNS is often allowed outbound. Defenders should look for long or unusual domain names, high-volume or repetitive lookups, rare record types, and DNS traffic to suspicious infrastructure. Limit outbound DNS paths and inspect resolver logs for anomalous patterns.

How DNS tunnelling works as an attack channel

DNS tunnelling turns DNS into an exfiltration or control path by encoding data in the parts of a DNS lookup and answer that are normally treated as routine name resolution. The attacker is not trying to make DNS behave like a full proxy, they are exploiting the fact that DNS traffic is widely permitted and often inspected less rigorously than web or application traffic.

That makes the technique attractive for both command-and-control and data transfer. A compromised host can ask for long, structured, or repetitive names that carry encoded instructions, while a server under attacker control can return responses that help move data back out. The channel may be slow, but it can be stealthy enough to survive in environments that only enforce basic outbound filtering.

For defenders, the key observation is that the abuse sits inside normal protocol behaviour, not outside it. DNS tunnelling often blends in by using common resolvers, standard query patterns, or seemingly legitimate lookups. That is why spotting it depends less on one signature and more on anomalies in naming, frequency, record type, destination, and resolver behaviour.

What attackers hide inside DNS queries and responses

Attackers usually encode commands, stolen data, or beaconing metadata into subdomains, query names, or response content. The payload is often fragmented so each lookup looks small, but a sequence of lookups can reconstruct a larger message. This is why a single suspicious query rarely proves tunnelling on its own.

DNS tunnelling also works because DNS has enough flexibility to carry unusual patterns without breaking outright. Rare record types, repeated lookups for similar names, or unusually long labels can all be used to move information. A defender should treat these as context signals, especially when they come from a host that does not normally generate much DNS traffic.

Attackers often prefer external infrastructure they control, but they may also abuse compromised or disposable domains to reduce blocking. DNS Security Guide is useful here because the same logging, resolver, and filtering concepts that help secure DNS also help separate ordinary resolution from covert transport.

Why DNS tunnelling bypasses common controls

DNS is frequently trusted as a necessary outbound service, so it can slip past controls that would block direct connections to unknown hosts. If egress policy allows arbitrary DNS resolution and the resolver forwards traffic without inspection, the tunnel can move data under the cover of an allowed protocol path.

The control failure is usually not that DNS is encrypted or inherently dangerous, but that organisations assume all DNS queries are low risk. In practice, the attacker is abusing the resolver path, the logging gap, or the absence of rate and pattern analysis. That means perimeter controls alone are often insufficient unless they are paired with resolver monitoring and tighter egress governance.

DNS tunnelling is a common component of broader command-and-control tradecraft, especially where the attacker wants resilience and a low-friction beaconing path. Command and Control (C2) Guide is relevant because DNS is one of several protocol choices attackers use to keep their C2 traffic reachable and harder to classify.

How defenders detect and disrupt it in practice

Detection usually starts with pattern recognition in resolver logs rather than packet inspection alone. Look for long or repetitive query names, high lookup volume from a single host, rare record types, a high ratio of failed lookups, or DNS traffic that appears to encode data in predictable chunks. Correlating that activity with endpoint telemetry makes it easier to tell whether a host is beaconing or simply misconfigured.

Disruption is strongest when you reduce the attacker’s ability to choose where DNS goes. Force clients through approved resolvers, block direct external DNS where possible, and log resolver activity centrally so anomalies are visible. When you can, apply response policy, sinkholing, or denylisting to known bad domains, but do not rely on blocklists alone because tunnelling infrastructure is often short-lived.

For a broader view of how attackers build and run covert channels, IANA matters because defenders benefit from knowing which protocol parameters and record types are standard, and which usage patterns are unusual enough to warrant investigation.

Risk and Threat Considerations

DNS tunnelling is risky because it can combine command-and-control, data theft, and policy evasion in one channel. If your environment treats DNS as implicitly safe, attackers can use that trust to move data past controls that would otherwise block outbound abuse.

Failure mechanism: The environment allows outbound DNS too freely, and resolver monitoring is too weak to detect encoded payloads, unusual record usage, or repetitive beaconing patterns.

Impact: An attacker can sustain covert communications, exfiltrate data in small bursts, and maintain access even when direct outbound connections are restricted.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
MITRE ATT&CK TA0011 — Command and Control DNS tunnelling is a covert C2 channel used by attackers.
Recommendation — Map suspicious DNS beacons to TA0011 and hunt for beaconing patterns in resolver telemetry.
CIS Controls v8 CIS-13 — Network Monitoring and Defense DNS tunnelling is detected through network and resolver anomaly monitoring.
Recommendation — Centralize DNS logs and alert on unusual query volume, length, and record types.
NIST SP 800-53 Rev 5 SI-4 — System Monitoring Detection depends on monitoring DNS activity for covert-channel indicators.
SC-7 — Boundary Protection Limiting outbound DNS paths reduces an attacker’s ability to use DNS as a covert channel.
Recommendation — Monitor resolver activity for anomalous DNS patterns and investigate suspicious hosts. Restrict external DNS egress to approved resolvers and block direct client-to-internet queries.
NIST CSF 2.0 DE.CM-01 — Networks and network services are monitored to find anomalous behavior DNS tunnelling is visible as anomalous network-service behavior.
Recommendation — Tune detections for DNS anomalies and route them into your monitoring pipeline.

Practitioner Guidance

What to verify: Confirm that all clients use approved resolvers, that resolver logs are retained centrally, and that analysts can search for query length, volume, and record-type anomalies. If you cannot answer whether a host’s DNS traffic is normal for its role, you do not yet have enough visibility.

Decision rule: If a host shows repetitive or encoded DNS behaviour plus any sign of compromise, treat it as a potential covert channel and investigate for both exfiltration and C2 rather than assuming the issue is only DNS misconfiguration. If the host is business-critical, isolate the DNS path first and then assess blast radius.

Practitioner takeaway: DNS tunnelling is rarely defeated by a single control; the reliable defence is to narrow outbound DNS paths, make resolver behaviour observable, and investigate anomalies as possible active abuse rather than benign noise.