DNS tunneling is a technique that smuggles arbitrary data through DNS lookups — the internet's name-to-address system that every device on every network uses continuously and by default. Because DNS traffic is essential and almost never inspected, an attacker who controls one infected device can encode stolen data, commands and malware downloads into what looks like ordinary name resolution traffic, and it flows out of the network without a single alarm.
TL;DR
- DNS tunneling encodes stolen data or attacker commands inside DNS queries to a domain the attacker owns.
- It works because DNS is allowed everywhere, rarely inspected, and almost never blocked.
- Typical payloads: credential theft exfiltration, command-and-control for malware, and bypassing captive portals.
- Detection looks for tell-tale volume: long, high-entropy subdomains, huge TXT query volume, one domain queried thousands of times.
- Prevention is structural: block outbound DNS except to approved resolvers, filter DNS, and train staff to report odd device behaviour.
What DNS tunneling means in plain terms
When a device looks up a website name, it sends a query like "what's the address of example.com?" to a DNS resolver. That query travels over port 53, which firewalls almost universally allow outbound — without DNS, the internet appears broken. DNS tunneling abuses this trust: the malware on an infected laptop encodes a chunk of stolen data into the name it looks up (for example a 40-character scrambled subdomain of attacker-domain.com), the attacker's authoritative DNS server receives it, decodes it, and replies with commands encoded back in the response.
The result is a fully functional two-way data channel hidden inside traffic every firewall permits. Nothing about the individual packet looks wrong.
How a DNS tunnel actually runs
- Foothold. Malware lands on one device through the usual routes — a phishing attachment, a fake installer, an unpatched flaw.
- Query encoding. The malware splits stolen data (credentials, documents, keystrokes) into chunks and encodes each into subdomain lookups: a1b2c3.attacker-domain.com, d4e5f6.attacker-domain.com, and so on. TXT records carry larger payloads per query.
- Attacker-side collection. The authoritative DNS server for attacker-domain.com receives every query, reassembles the chunks, and replies with next-step commands encoded in the DNS responses.
- Sustained channel. This repeats for weeks if undetected — a quiet, low-and-slow exfiltration channel that never trips the volume alarms built for bulk HTTP.
The technique has documented real-world use: state-linked and criminal groups have used DNS tunnelling for command-and-control in high-profile intrusions, and it remains a standard component of attack toolkits in 2026.
What it looks like on a small business network
- Data leaving through a door nobody watches. A business with no DNS logging has no way to know it is happening; the stolen data exits through infrastructure every device uses by default.
- Malware that keeps working after web filtering. An attacker blocked from web C2 (command-and-control) falls back to DNS tunneling — a common reason infections persist after a "cleaned" device starts misbehaving again.
- The captive-portal bypass cousin. The same technique is used to get free internet through hotel and airport pay-walls — a sign of how easily the protocol is abused.
Australian context: the ASD logged more than 84,700 cybercrime reports in 2024-25 — one every six minutes — with small business averaging $56,600 per report (ASD Annual Cyber Threat Report 2024-25). Exfiltration channels like DNS tunneling are how stolen data gets from an infected SMB laptop to the attacker — invisible on networks without DNS monitoring.
How to detect DNS tunneling
Detection is about volume and pattern, not individual packets:
- Long, random-looking subdomains. Legitimate subdomains are short and readable; tunnel payloads are 30-60+ characters of high-entropy scramble.
- One domain queried thousands of times. A tunnel needs volume to move data — a single unusual domain queried continuously is the classic signature.
- Unusual record-type mix. Heavy TXT query volume from a workstation is a strong indicator — ordinary browsing barely uses TXT lookups.
- Traffic to unregistered or newly-created domains queried repeatedly from one internal host.
Specialised DNS-security tools surface this automatically. Without one, even reviewing resolver logs weekly catches the obvious cases — the domain that queried 14,000 times in an hour is not a browsing pattern.
How to prevent DNS tunneling
- Restrict outbound DNS. Devices should use only the approved internal or security-vendor resolvers — never arbitrary external DNS servers. This single rule breaks most tunnels, because the attacker's domain must be resolved through the logging resolver you control.
- Deploy DNS filtering (NextDNS, Cisco Umbrella, Cloudflare Gateway or your firewall's built-in DNS security) to block known-malicious domains and log every lookup.
- Log DNS queries and review weekly. Visibility is the precondition for detection — no logging means no tunnel is ever seen.
- Patch and harden endpoints. The tunnel needs a foothold; endpoint protection, patching and least-privilege reduce the chance one exists at all.
- Restrict local admin rights so malware cannot install the tunneling tool or alter DNS settings in the first place.
- Train the reporting reflex. A tunnel needs a compromised device, and compromised devices usually show symptoms someone notices — a slow laptop, a fan that runs constantly, odd pop-ups. Cyber Aware's security awareness training makes "my device is behaving oddly" a reportable event, and human risk reporting shows whether staff actually report it.
For businesses checking the whole control set — DNS filtering, patching, endpoint coverage — a cyber security gap assessment ranks the gaps before an attacker exploits them.
FAQ
What is DNS tunneling in simple terms? Smuggling data or commands through the internet's name-lookup system by encoding payloads into DNS queries to an attacker-controlled domain — hidden inside traffic every network allows.
Is DNS tunneling the same as DNS hijacking? No. Hijacking changes where DNS answers point (redirecting users to fake sites); tunneling uses DNS queries as a private data channel. One redirects people; the other moves data.
Why don't firewalls block it? Because blocking DNS breaks the internet for everyone behind the firewall. The protocol is essential, so firewalls allow it by default — which is exactly why attackers picked it.
Can I detect it without buying tools? Partly. Enable DNS query logging and review weekly: one domain queried thousands of times, or 30+ character random subdomains, are visible without specialist tooling.
What data moves through a DNS tunnel? Whatever fits: stolen credentials, session cookies, small documents, keystroke captures, commands to and from malware. Volume is low per query, so attackers move the valuable small stuff.
Does HTTPS or a VPN stop it? No — both can carry the tunnel's traffic happily. The fix is controlling which DNS resolvers devices may use, and filtering what those resolvers answer.
One last thing
Check one thing this week: can a laptop on your office Wi-Fi query 8.8.8.8 directly, or does the network force every device through your approved resolver? If the answer is "any DNS works", the quietest exfiltration channel on the internet is open in your business — and closing it is a firewall rule, not a project.
Related guides
- What is DNS hijacking? — the redirection cousin, explained.
- What is data exfiltration? — what tunnels are built to move.
- What is endpoint security? — closing the foothold the tunnel starts from.