Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 344

DNS Tunneling

What is DNS Tunneling?

DNS TunnelingA covert channel that encodes arbitrary data inside DNS queries and responses on UDP/TCP port 53, frequently used for command-and-control and data exfiltration.


DNS tunneling abuses the fact that DNS traffic (UDP/TCP port 53) is allowed almost everywhere and is rarely deeply inspected. Malware encodes payload bytes in subdomain labels (e.g., base32 chunks under attacker.example.com) and the attacker's authoritative server replies with TXT, CNAME, or NULL records containing the response or commands. Tooling like dnscat2, Iodine, or Cobalt Strike's DNS C2 use this pattern. Bandwidth is low but stealthy. Detection relies on high query rate per host, unusually long labels, high subdomain entropy, base64/hex patterns, atypical record types, and TI feeds. Defenses include DNS proxying, sinkholing, query rate limits, anomaly analytics in EDR/NDR, and blocking unknown DNS resolvers via egress firewall.

Examples

  1. 01

    An infected host sends queries like a1b2c3.exfil.attacker.com whose labels encode stolen data.

  2. 02

    dnscat2 establishes a TXT-based shell over DNS to bypass an HTTP-only egress proxy.

Frequently asked questions

What is DNS Tunneling?

A covert channel that encodes arbitrary data inside DNS queries and responses on UDP/TCP port 53, frequently used for command-and-control and data exfiltration. It belongs to the Network Security category of cybersecurity.

What does DNS Tunneling mean?

A covert channel that encodes arbitrary data inside DNS queries and responses on UDP/TCP port 53, frequently used for command-and-control and data exfiltration.

How does DNS Tunneling work?

DNS tunneling abuses the fact that DNS traffic (UDP/TCP port 53) is allowed almost everywhere and is rarely deeply inspected. Malware encodes payload bytes in subdomain labels (e.g., base32 chunks under attacker.example.com) and the attacker's authoritative server replies with TXT, CNAME, or NULL records containing the response or commands. Tooling like dnscat2, Iodine, or Cobalt Strike's DNS C2 use this pattern. Bandwidth is low but stealthy. Detection relies on high query rate per host, unusually long labels, high subdomain entropy, base64/hex patterns, atypical record types, and TI feeds. Defenses include DNS proxying, sinkholing, query rate limits, anomaly analytics in EDR/NDR, and blocking unknown DNS resolvers via egress firewall.

How do you defend against DNS Tunneling?

Defences for DNS Tunneling typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for DNS Tunneling?

Common alternative names include: DNS C2, DNS exfiltration.

Related terms

See also