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

Explore Topics

Industry Updates – Sponsored Posts

Verisign Q1 2016 DDoS Trends: Attack Activity Increases 111 Percent Year Over Year

Is Your TLD Threat Mitigation Strategy up to Scratch?

Domain Management Handbook from MarkMonitor

i2Coalition to Host First Ever Smarter Internet Forum

Encrypting Inbound and Outbound Email Connections with PowerMTA

Resilient Cybersecurity: Dealing with On-Premise, Cloud-Based and Hybrid Security Complexities

What Holds Firms Back from Choosing Cloud-Based External DNS?

Verisign Releases Q4 2015 DDoS Trends - DDoS Attack Activity Increasing by 85% Year Over Year

Best Practices from Verizon - Proactively Mitigating Emerging Fraudulent Activities

Neustar Data Identifies Most Popular Times of Year for DDoS Attacks in 2015

The Framework for Resilient Cybersecurity (Webinar)

Data Volumes and Network Stress to Be Top IoT Concerns

DKIM for ESPs: The Struggle of Living Up to the Ideal

Computerworld Names Afilias' Ram Mohan a Premier 100 Technology Leader

Verisign Mitigates More Attack Activity in Q3 2015 Than Any Other Quarter During Last Two Years

Protect Your Privacy - Opt Out of Public DNS Data Collection

Verisign & Forrester Webinar: Defending Against Cyber Threats in Complex Hybrid-Cloud Environments

Measuring DNS Performance for the User Experience

Introducing Verisign Public DNS: A Free Recursive DNS Service That Respects Your Privacy

Faster DDoS Mitigation - Introducing Verisign OpenHybrid Customer Activated Mitigation

Sponsored Topics



Sponsored by

DNS Security

Sponsored by
Afilias - Mobile & Web Services


Sponsored by
Afilias - Mobile & Web Services


Sponsored by