Home / Blogs

DNS Tunneling: Is It a Security Threat?

Chris Beauregard

DNS tunneling — the ability to encode the data of other programs or protocols in DNS queries and responses — has been a concern since the late 1990s. If you don't follow DNS closely, however, DNS tunneling likely isn't an issue you would be familiar with.

Originally, DNS tunneling was designed simply to bypass the captive portals of Wi-Fi providers, but as with many things on the Web it can be used for nefarious purposes. For many organizations, tunneling isn't even a known suspect and therefore a significant security risk. When most organizations think of DNS security, there is a tendency to overlook the security of critical data or systems being compromised by covert outbound DNS inside their networks.

To add some perspective, over the past several years there have been at least two large-scale security breaches using tunneling, affecting millions of accounts. In part one of this blog, we will provide some background on DNS tunneling in addition to discussing how DNS tunneling can be used to infiltrate your internal infrastructure. In part two, we will discuss how to detect whether your organization is affected by DNS tunneling and some proactive tips you can use to better protect your network.

What is DNS tunneling?

Through DNS tunneling, an organization's DNS can be used as a method of command and control and/or data exfiltration.

The basic method of tunneling requires that a client be compromised in some way. This follows the norm: malware via email attachment, compromised site, social engineering, etc.

While all of those methods of delivery typically require the compromised client to have external connectivity, interestingly, the compromised machine doesn't need actual external connectivity. The machine simply requires access to an internal DNS server with external access, which will enable the machine to send and receive DNS responses.

In addition to compromising the target organization, the attacker must also control a domain and a server that can act as an authoritative server for that domain in order to run the server-side tunneling and decoding programs.

Hackers use a variety of DNS tunneling utilities as well as several known malwares that use DNS as their communication channel. While each utility varies on the specifics of how they work, they all transmit the data encoded in the payload using Base32/Base64 Binary, NetBios, or Hex encoding. Hackers also use a wide variety of DNS record types, from A records to CNAME, to MX and TXT records, all of which can be combined with EDNS to increase the payload. (TXT records are the most common because they offer the largest and most diverse payload structure.)

How can DNS tunneling be used in a network breach?

Because DNS is rarely monitored and analyzed, hackers are able to use DNS tunneling to slip under the radar — until something else draws attention to the breach.

Here is the usual sequence of activities:

  1. A client sends a request for a particular host name in a domain, with the data/response to the server encoded in the hostname being requested.
  2. The server responds with its data in the RDATA field of the response. Because DNS allows hostnames of up to 255 characters, with each label (subdomain) limited to 63 characters, DNS allows the client to use lengthy individual labels as well as multiple levels of subdomains to encode their data. For example: The client sends a query for an A record where the data is encoded in the host name: MRZGS3TLEBWW64TFEBXXMYLMORUW4ZI.t.example.com. Then the server could respond with an answer as a CNAME response: WW2IDPOZQWY5DJNZSQ.t.example.com
  3. The client now has two-way transactional communications to a compromised network. The attacker can transfer files out of the network or have complete remote access to the compromised system.

Join us next week for part two in this series. Learn steps you can take to identify whether your network has been compromised and some tips for preventing a breach.

By Chris Beauregard, Senior Professional Services Engineer at Neustar

Related topics: DNS, DNS Security, Security

WEEKLY WRAP — Get CircleID's Weekly Summary Report by Email:


To post comments, please login or create an account.

Related Blogs

Related News


Industry Updates – Sponsored Posts

Afilias Supports the CrypTech Project - Ambitious Hardware Encryption Effort to Protect User Privacy

Public Sector Experiences Largest Increase in DDoS Attacks (Verisign's Q4 2014 DDoS Trends)

Help Ensure the Availability and Security of Your Enterprise DNS with Verisign Recursive DNS

Verisign iDefense 2015 Cyber-Threats and Trends

What's in Your Attack Surface?

Join Paul Vixie & Robert Edmonds at the Upcoming Distinguished Speaker Series

Q3 2014 DDoS Trends: Attacks Exceeding 10 Gbps on the Rise

LogicBoxes Announces Automation Solutions for ccTLD

3 Questions to Ask Your DNS Host About DDoS

Introducing Our Special Edition Managed DNS Service for Top-Level Domain Operators

Afilias Partners With Internet Society to Sponsor Deploy360 ION Conference Series Through 2016

Neustar to Build Multiple Tbps DDoS Mitigation Platform

The Latest Internet Plague: Random Subdomain Attacks

Digging Deep Into DNS Data Discloses Damaging Domains

New gTLDs and Best Practices for Domain Management Policies (Video)

Nominum Announces Future Ready DNS

New from Verisign Labs - Measuring Privacy Disclosures in URL Query Strings

Video Interviews from ICANN 50 in London

DotConnectAfrica Delegates Attend the Kenya Internet Governance Forum

3 Questions to Ask Your DNS Host about Lowering DDoS Risks

Sponsored Topics



Sponsored by


Sponsored by
Minds + Machines

Top-Level Domains

Sponsored by
Minds + Machines

DNS Security

Sponsored by