Join our Newsletter — 33% off our NHI Course
Home› Glossary› Threats, Abuse & Incident Response› Domain Name System (DNS) Tunnelling
Threats, Abuse & Incident Response

Domain Name System (DNS) Tunnelling

← Back to Glossary
By NHI Mgmt Group Updated October 20, 2026 Domain: Threats, Abuse & Incident Response

Domain Name System (DNS) tunnelling is a technique that hides data or command traffic inside DNS queries and responses. Attackers use it to bypass filtering, exfiltrate data, or maintain command-and-control when other channels are blocked. Defenders inspect DNS patterns, restrict outbound resolvers, and flag unusual query volume or encoding.

How DNS tunnelling works

DNS tunnelling repurposes a protocol that most environments must allow, which is why it is so effective for covert communication. Data can be split across subdomain labels, embedded in query names, or carried in crafted responses, then reassembled by a cooperating endpoint on the other side.

Because DNS is designed to move small, structured lookups rather than arbitrary payloads, tunnelling usually trades speed for reachability and stealth. That makes it useful when an attacker wants a low-bandwidth channel that blends into ordinary resolver traffic and is less likely to be blocked than direct outbound connections.

Why DNS tunnelling is dangerous

The danger is not the protocol itself but the trust that defenders place in DNS as a routine service. If outbound DNS is too permissive, a tunnel can move commands, exfiltrate data, or sustain access even when web, email, or other egress paths are restricted.

DNS traffic also tends to be high volume and noisy by nature, so malicious use can hide inside legitimate resolution patterns. The most effective tunnels often imitate normal query timing, domain structure, and response handling closely enough to delay detection until an investigation is already underway.

How defenders detect and contain it

Detection starts with visibility into DNS logs, resolver telemetry, and egress policy enforcement. Defenders look for unusual query lengths, high entropy encodings, rare domains, abnormal NXDOMAIN rates, and clients that generate far more DNS activity than their role justifies.

Containment usually means reducing the number of places where DNS can exit the network and preventing endpoints from using arbitrary external resolvers. NHIMG’s DNS Security Guide covers protective DNS, logging, sinkholing, and resolver controls that make this kind of abuse easier to spot and harder to sustain.

For threat-hunting context, the Command and Control (C2) Guide explains how DNS tunnelling fits into broader beaconing and command-channel tradecraft, while the MITRE D3FEND Guide is useful for mapping defences such as domain name reputation analysis, outbound traffic filtering, and protocol metadata anomaly detection.

Operational response and hardening priorities

When DNS tunnelling is suspected, the first priority is to identify the host, resolver, or domain pattern carrying the traffic and then determine whether the channel is being used for exfiltration, remote control, or both. That determines whether the immediate response should focus on blocking, containment, or preserving evidence for incident handling.

Hardening is usually most effective when DNS policy is treated as an access boundary rather than a convenience service. Enforcing approved resolvers, restricting direct outbound DNS, monitoring encoded subdomain behaviour, and correlating DNS anomalies with endpoint activity all reduce the chance that a tunnel survives long enough to become a durable foothold.

Risk and Threat Considerations

DNS tunnelling is attractive because it exploits a protocol that many organisations must leave open for business continuity. That creates a practical risk of covert data movement and command-and-control persistence even in environments that have already tightened other outbound paths.

Failure mechanism: The tunnel succeeds when DNS policy is too permissive, logging is too shallow to expose encoded or high-volume patterns, or defenders treat DNS as low-risk background traffic instead of a channel that can carry malicious payloads.

Impact: Attackers can exfiltrate data, issue commands, preserve remote access, and hide activity inside routine resolution behaviour, which can extend dwell time and complicate containment.

Standards & Framework Alignment

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

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

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SC-7 — Boundary ProtectionDNS tunnelling abuses outbound network paths and boundary controls.
Recommendation — Constrain DNS egress and inspect boundary traffic for anomalous resolution patterns.
MITRE ATT&CKT1071.004 — Application Layer Protocol: DNSDNS tunnelling is the DNS application-layer protocol technique.
Recommendation — Hunt for DNS-based command channels and correlate them with suspicious endpoints.
CIS Controls v8CIS-12 — Network Infrastructure ManagementDNS tunnelling is mitigated through controlled resolver paths and network monitoring.
Recommendation — Limit approved DNS paths and monitor resolver traffic for encoded or high-volume abuse.
OWASP API Security Top 10API8 — Security MisconfigurationOverly permissive outbound DNS and resolver settings can enable covert channels.
Recommendation — Harden DNS configuration so only approved resolvers and query paths are allowed.
NIST CSF 2.0PR.DS-01 — Data-at-rest is protectedDNS tunnelling can be used to move data out of the environment covertly.
Recommendation — Protect sensitive data so exfiltration through covert channels yields less value.

Practitioner Guidance

Why practitioners should care: DNS tunnelling is one of the clearest examples of “allowed traffic used against you,” so the right question is not whether DNS should exist, but which DNS behaviour your environment should permit and observe. Treat unusual resolver use, encoded labels, and abnormal query volume as control failures worth investigating, not as mere anomalies.

What to watch for: The strongest signal is a host whose DNS pattern does not match its role, especially when it shows long or random-looking query names, repeated lookups to uncommon domains, or DNS activity that persists after other outbound channels are blocked.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 20, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org