Why DNS tunneling is difficult to spot

A normal DNS lookup asks for information about a domain name, such as the address needed to reach a website. DNS tunneling uses a series of lookups to carry information instead. For example, software may place changing, encoded-looking text in subdomains and send repeated queries beneath one parent domain. Some tunnels also use DNS responses to return information. To a resolver, these can still look like valid DNS requests.

No single DNS feature proves that tunneling is happening. A busy application, security product, or misconfigured device may also generate frequent requests or unusual names. The practical goal is to find combinations of signals that deserve investigation, not to label every unfamiliar domain as malicious. That can be done without routinely saving complete query names, which may reveal internal hostnames, user activity, or information an application mistakenly placed in a request.

Collect useful measurements, not full names

Start with a clear boundary: decide which DNS resolver or network segment you can observe and which devices it serves. For each short time window, a resolver or monitoring component can count requests by client, parent domain, record type, and response category. Useful measurements include total query volume, the proportion of failed lookups, the number of distinct subdomains, and how often a client returns to the same parent domain. If client identifiers are sensitive, restrict access to them or use a consistent pseudonymous identifier for routine analysis.

A component can calculate features from a query name in memory and discard the full name before writing an event. Possible features include name length, number of labels, length of the longest label, and a coarse measure of how varied the characters are. Record the resulting measurements or ranges rather than the characters themselves. Parent domains can also be sensitive, so consider whether routine reporting needs them at all, or whether access-controlled grouping identifiers will suffice.

Keep collection proportional to the question being asked. Aggregating by time window reduces the temptation to retain every lookup, though it can obscure short events. Document what is collected, who can view it, and when it is deleted. Avoid treating hashing a full query name as automatic anonymization: predictable names may still be guessable, and a stable hash can reveal repeated behavior.

Look for combinations of patterns

One useful pattern is a client making many requests for different, long subdomains beneath a single parent domain. If those names have similarly sized labels and appear steadily over time, the activity may merit a closer look. A high rate of failed lookups can strengthen the signal, but it is not required; a tunnel may use names that receive successful responses. Record types such as TXT may be relevant, yet tunneling can use other types too, so a rule focused on one type will miss activity.

Compare behavior with the client's own normal activity and with similar devices where possible. A workstation, a mail server, and a device running automated checks may have very different DNS patterns. Flagging several changes together—such as a sudden increase in unique subdomains, unusual request timing, and a new parent-domain grouping—usually gives an investigator a more useful lead than a universal query-count threshold. Allow for benign explanations, including software updates, content delivery, and broken applications that repeatedly retry failed lookups.

Investigate alerts without expanding collection by default

When an alert fires, first review the aggregate context: which client group changed, when the change began, whether other clients show the same pattern, and whether the traffic coincides with an expected service. Check available endpoint or application information if you are authorized to do so. A pattern that begins immediately after a known application starts may have a different explanation from one tied to an unknown process.

If aggregate evidence cannot explain a concerning alert, use a defined escalation path rather than switching on broad query logging for everyone. Limit any temporary capture to the relevant client or time period, obtain the appropriate approval, protect access, and set a short retention period. Preserve only what is needed to answer a specific question. If the activity appears harmful, response may involve isolating the affected device and examining its software; blocking a parent domain alone may disrupt legitimate services and may not stop a tunnel that changes destinations.

Know what the view cannot show

Resolver-side monitoring only covers queries that reach the resolver being observed. Devices using another resolver or an encrypted DNS connection outside that path may not appear in its logs. Cached answers can also reduce visible requests. These limits are reasons to state what a detector covers, not reasons to collect more sensitive data indiscriminately.

Treat an alert as a prompt for careful review, and revisit rules when they create repeated false alarms. A privacy-conscious detector works best when it combines several modest signals, keeps routine data minimal, and gives investigators a controlled way to gather more detail only when there is a clear need.

Back to category ↗