{
  "id": 21336122,
  "title": "DNS Tunneling, Explained: How Data Hides Inside Ordinary DNS Lookups",
  "url": "https://urgent.news/2026/11/23/dns-tunneling-explained-how-data-hides-inside-ordinary-dns-lookups",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-23T03:28:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kielltampubolon/dns-tunneling-explained-how-data-hides-inside-ordinary-dns-lookups-m7h"
  },
  "original_language": "en",
  "account": "DNS tunneling is a method by which attackers hide data inside ordinary Domain Name System (DNS) lookups to bypass company firewalls. This technique exploits the fact that most company firewalls do not block DNS requests. The source material explains how DNS tunneling works, provides a small Python script to detect simulated leaks, and lists various defenses to prevent such attacks.\n\nThe process begins with the attacker registering a domain and running its name server. Malware running on a compromised device then performs DNS lookups for names like \"stolen-data.exfil-demo.example.\" The company's DNS resolver, which is usually configured to trust the domain owner, will answer the query and forward the response to the attacker. The attacker can embed commands within TXT records, which are hidden within the DNS response.\n\nA normal DNS lookup works as follows: when a laptop needs to access GitHub, it asks the company resolver, which then contacts the name server responsible for github.com. The name server responds with an IP address, which is then delivered to the laptop. The key point is that the resolver queries the domain owner, and any requests for names under that domain will be handled by the domain owner's server.\n\nThe attacker's trick is to encode data inside the DNS question itself. This is done by encoding the data in a legal format, such as Base32 or hex, and breaking it into manageable slices. Each slice is then sent as a separate DNS query to the attacker's name server, which reconstructs the original data from these slices. The attacker's name server logs each query, enabling them to decipher the data and potentially issue commands to the infected device.\n\nDespite the size limitations of DNS (63 bytes per label and 255 bytes for the full name), tunneling is still possible but slow, making it difficult to detect since it blends in with normal traffic. Malware often uses long, random, unique names under a single domain, which are easy to spot with the right defenses. The MITRE ATT&CK framework lists DNS tunneling under Technique T1071.004, Application Layer Protocol: DNS.\n\nTo detect DNS tunneling, the source material suggests looking for four signals: long labels (close to the 63-byte limit), high character entropy in the encoded data, many unique names under a single domain, and an unusual prevalence of TXT records. These indicators, when present together, can signal potential DNS tunneling activity.\n\nThe author provides a small Python script that analyzes DNS query logs to flag potential DNS tunneling suspects. The script calculates scores based on four signals: long labels, randomness in the encoded data, the number of unique names under a single domain, and the frequency of TXT records. By running this script on DNS query logs, organizations can identify and mitigate potential DNS tunneling attacks.",
  "summary": "Most company firewalls say no to almost everything going out. But they nearly always say yes to one thing: DNS, the lookup that turns github.com into an IP address. Without it nothing works, so it stays open. DNS tunneling is what happens when an attacker notices that open door and starts walking data through it. This post explains how it works without assuming you know DNS internals, shows a…",
  "key_points": [
    "Attackers hide data in DNS lookups to bypass firewalls",
    "Malware encodes stolen data in DNS queries using Base32 or hex",
    "Detect DNS tunneling by spotting long labels, high entropy, unique domain names, and TXT records"
  ],
  "editors_take": "Exploiting the inherent trust placed in standard domain queries allows attackers to circumvent traditional firewalls, forcing security teams to monitor for specific patterns like high entropy and unusual record types.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}