DNS Tunneling

7 minutes read

Related Topics

What is DNS Tunneling?

DNS tunneling carries data from other applications or protocols inside Domain Name System (DNS) queries or responses. Attackers use it to exchange commands with compromised devices or move data out of a network through DNS traffic that normally supports name resolution.

How DNS Tunneling Works

In a typical DNS tunneling attack, a compromised device sends a query to its usual recursive resolver. When the resolver needs a fresh answer, the lookup can reach the authoritative name server for the domain, which the attacker controls. The requested name can carry data from the device, and the DNS response can carry instructions back.

The device can use the organization’s own resolver for this exchange. That makes the resolver’s client query logs a useful starting point. Captures on the client side can show which host sent the query. Captures farther upstream can show whether the lookup continued beyond the organization’s DNS infrastructure.

Synonyms

Types of DNS Tunneling Attacks

These DNS attacks can serve two objectives, sometimes within the same exchange.

  • Command and control (C2) tunneling: Malware uses DNS to check in, receive instructions, or report results. Responders look for recurring queries and responses that line up with activity on the host.
  • Data exfiltration: A compromised device sends information out through DNS queries. The investigation centers on whether the queries carried sensitive data and whether the traffic crossed the network boundary.

Detecting DNS Tunneling in Network Traffic

Start with the device and the queried domain. Look for long or random-looking subdomain labels, many distinct names under the same domain, and record types the device seldom requests. Both sudden bursts and recurring low-volume queries can warrant a closer look. MITRE detection strategy

For DNS exfiltration detection, compare the device with its own history and with others that serve the same role. Content delivery networks can generate long query names, and service discovery can produce repeated lookups. Knowing which process made the requests and whether peer devices behave the same way helps narrow the investigation.

DNS Tunneling Analysis with Packet Capture

Network forensics for DNS-based attacks starts by identifying what each source can verify. When hunting covert channels on the network, use resolver logs to find the originating client and time window. Then inspect the retained packet capture (PCAP) for the query names, record types, response contents, and timing. Match that exchange to endpoint telemetry, where available, to identify the process responsible.

Capture location matters. On the upstream side of a shared resolver, the resolver’s IP address can be the only source address visible. And if DNS is encrypted at the capture point, the packets can show connection timing and endpoints while leaving query contents unreadable. Resolver logs or endpoint telemetry can help fill those gaps when they record the relevant fields. NSA encrypted DNS guidance

Example investigation: A workstation starts querying many unique names under an unfamiliar domain. Resolver logs identify the workstation, and an egress capture shows related queries leaving the network. Endpoint records tie the activity to an unexpected process that recently read a sensitive file. Together, those findings support suspected tunneling. If analysts recover content from the outbound queries and match it to the file, they can identify which portion of the file left the network.

DNS Tunneling Protection and Mitigation

Make approved resolvers the default for enterprise DNS, including DNS over HTTPS and DNS over TLS. Enforce that policy in browser and endpoint settings and restrict direct external DNS. For network threat prevention, use protective DNS filtering to block lookups for known malicious domains. Back those network defenses with resolver logging and network monitoring so network threat detection can flag suspicious activity involving domains that filtering hasn’t identified. NSA encrypted DNS guidance · Protective DNS guidance

During a confirmed incident, coordinate with incident response to isolate affected hosts, block the malicious domain, and preserve resolver logs, packet captures, and endpoint records. Search the retained evidence for other devices that contacted the same domain or showed related behavior.

How NetWitness Supports DNS Investigations

NetWitness Network gives network security teams DNS metadata for investigating unusual queries. With full packet capture configured and the relevant traffic retained, analysts can pivot to the underlying packets and review the exchange. They can correlate it with available logs to trace the activity to the originating device and build a timeline.

Related Terms & Synonyms

  1. DNS Beaconing: Recurring DNS queries that malware uses to check in with external infrastructure.
  2. DNS Exfiltration: Unauthorized transfer of information out of a network through DNS traffic.
  3. Data Exfiltration: Unauthorized transfer of data from a device, system, or network.
  4. DNS Tunnel Attack: Malicious use of DNS tunneling to carry commands or data inside DNS messages.
  5. DNS Protocol Abuse: Malicious use of DNS, such as for covert communication or amplification.
  6. DNS-based Command-and-Control (C2): Using DNS to exchange commands with compromised systems.

People Also Ask

1. What are the common signs of DNS tunneling?

Look for unusually long or random-looking query names, many unique subdomains under one domain, and record types or query rates that are unusual for the device. A recurring pattern of low-volume queries is also worth investigating when the domain or originating process is suspicious.

A compromised device puts information into the domain names it requests. When those queries reach a name server controlled by the attacker, the information travels with them.

Route DNS through approved resolvers, restrict unauthorized external DNS, and filter known malicious domains. If tunneling is confirmed, isolate the affected hosts, block the destination, and retain DNS logs and available packets to determine the scope.

OilRig’s BONDUPDATER backdoor used DNS, including TXT records, for command and control. The Decoy Dog toolkit also used DNS for C2. Researchers investigating it observed periodic but infrequent DNS lookups.

DNS tunneling describes what DNS carries, while DNS beaconing describes a recurring check-in pattern. A device can use DNS to signal that it is online with a simple lookup. That check-in can also be part of a tunnel that carries commands or other data.

Accelerate Your Threat Detection and Response Today! 

Leaving Without The Ransomware Intel?

See which groups are targeting enterprises in 2026 and how to prepare before they strike.