Responding to DNS Tunnelling Data Exfiltration

DNS is usually treated as background plumbing: devices ask for names, resolvers answer, and users get connected to websites or cloud services. Attackers can misuse that ordinary traffic by encoding stolen information into DNS queries and sending it to infrastructure they control. This technique is commonly called DNS tunnelling.

A successful tunnel can move data quietly because DNS is permitted in most environments and often receives less scrutiny than web or email traffic. Small fragments of files, credentials, database records or configuration data may be hidden in subdomains, TXT requests or repeated lookups. The traffic can continue for hours or days if defenders focus only on obvious malware or large outbound transfers.

Handling a data exfiltration via DNS tunneling requires two parallel efforts: stop the active channel and establish what information may have left the organisation. A rushed block can destroy useful evidence, while a lengthy investigation can give the attacker time to continue. Security, network, legal, privacy and business teams need a shared operating picture.

For Australian organisations, the response may involve offices across Sydney, Melbourne, Brisbane or Perth, a mix of corporate networks and remote workers, and infrastructure hosted in several cloud regions. Teams should account for the Australian Eastern, Central and Western time zones, managed service providers, and obligations under the Privacy Act and the Notifiable Data Breaches scheme.

Recognise The Signs Of A DNS Tunnel

The first task is to distinguish suspicious DNS activity from normal application behaviour. Useful indicators include unusually long subdomain labels, high volumes of unique queries, strings with apparently random characters, frequent TXT or NULL record requests, and repeated lookups to one newly registered domain. A high proportion of NXDOMAIN responses can indicate an algorithm that cycles through disposable or non-existent names.

Look at the pattern rather than a single query. A workstation that generates thousands of requests at regular intervals, contacts a domain with rapidly changing subdomains, or continues querying after its user has logged off deserves attention. Entropy analysis can help identify encoded material, while timing analysis may reveal a beacon that sends small payloads at consistent intervals.

DNS telemetry should be collected from internal resolvers, endpoint agents, firewalls, secure web gateways and cloud security controls. Compare the source device, logged-in account, process and destination domain. In Australia, a branch using a local ISP resolver or an unmanaged home connection may produce a different evidence trail from a device using the organisation’s central resolver, so gaps in visibility should be recorded rather than treated as proof that no activity occurred.

Stabilise The Environment Without Losing Evidence

Create an incident record as soon as the activity is credible. Record the first alert, the affected host, resolver address, queried domains, timestamps in UTC and local time, and the people who approved each response action. Preserve relevant DNS logs, endpoint telemetry, proxy records, memory where appropriate, and samples of suspicious traffic. Hash exported files and maintain chain-of-custody notes if litigation or regulatory review is possible.

Containment should be proportionate and fast. Isolate the suspected endpoint from the network while retaining a management path for forensic collection, or apply an emergency rule that prevents it from reaching external DNS. Redirecting known malicious domains to a controlled sinkhole can help identify additional infected devices, but sinkholing should be coordinated with the incident lead because it may alter evidence and attacker behaviour.

Avoid relying on a domain block alone. Tunnelling infrastructure can rotate domains, use multiple authoritative name servers, or hide behind compromised legitimate services. Force enterprise devices to use approved resolvers, block direct outbound DNS and restrict DNS over HTTPS or DNS over TLS where policy and business requirements allow. Keep an exception process for critical systems so a containment rule does not interrupt hospitals, mines, logistics operations or other essential services.

Scope The Breach And Identify The Data

Once the channel is constrained, reconstruct the sequence of events. Determine when the malware or script first appeared, which user or service account was involved, and whether the same indicator occurs on other hosts. Search historical DNS data for related domains, subdomain patterns, encoded fragments, nameserver changes and connections from servers that normally have no reason to perform internet lookups.

DNS records rarely contain a complete copy of the stolen material. Fragments may be split across queries, compressed, encrypted or sent through several domains. Endpoint and network evidence can show which process created the request, what files it accessed and whether staging occurred before transmission. Review recent archive creation, command-line activity, PowerShell or shell execution, credential access, database exports and unusual access to shared drives.

Classify possible information quickly. Customer identifiers, health information, employee records, payment details, credentials, commercial secrets and government-related data may carry different reporting, contractual and operational consequences. Australian entities should involve privacy counsel and the relevant responsible officers early, assess whether the incident is likely to result in serious harm, and document the reasoning behind any notification decision under the Notifiable Data Breaches scheme.

Signal or evidence What it may indicate Useful response
Long, random-looking subdomains Encoded or compressed payload fragments Preserve queries, isolate the source and decode copies offline
Repeated TXT requests Command-and-control traffic or data transfer Compare request size, cadence, process and destination
Many NXDOMAIN responses Domain-generation activity or evasion Hunt for related domains and inspect the endpoint
Direct DNS to external resolvers Bypass of corporate monitoring Block unauthorised DNS and review firewall logs
A single host with regular bursts Beaconing or staged exfiltration Capture endpoint evidence and search for persistence
Several hosts using the same domain Shared malware, credential abuse or supplier compromise Expand the investigation across users, servers and vendors

Stop The Channel And Remove Persistence

After identifying affected assets, revoke the attacker’s practical routes back into the environment. Quarantine infected hosts, disable compromised accounts, rotate exposed passwords and API keys, and invalidate active sessions. If a privileged account was used, assume that tokens, delegated permissions and stored credentials may also be at risk until reviewed.

Use DNS policy as one layer of containment. Deny known malicious domains, newly observed high-risk domains and suspicious record types where safe to do so. Enforce resolver allow-lists for servers that have predictable requirements, and inspect encrypted DNS at approved control points where the organisation has the authority and capability to do that. Keep an eye on IPv6 and alternate network paths, since an attacker may exploit a monitoring blind spot rather than the original tunnel.

Eradication requires more than deleting a suspicious file. Find scheduled tasks, services, startup entries, browser extensions, scripts, stolen tokens and remote administration tools that could recreate the channel. Patch the exploited weakness, remove unauthorised persistence, rebuild severely compromised systems from trusted images, and check that security tooling has not been disabled.

Third-party access deserves particular scrutiny. If a vendor update, managed service or shared credential is involved, pause the relevant integration under an agreed process and preserve the supplier’s logs. Guidance on remediating a supply-chain attack is useful when the DNS activity may be connected to compromised vendor software rather than a single employee workstation.

Recover Services And Validate The Result

Recovery should proceed in controlled stages. Restore clean systems, reintroduce them to the network with heightened monitoring, and confirm that their DNS requests match an expected baseline. For sensitive workloads, use separate validation windows and require an owner to approve the return to production. A device that appears clean but immediately resumes beaconing should be isolated again.

Review data sources after remediation. Search for the original domain, related infrastructure, matching encoded labels and unusual resolver behaviour. Compare outbound traffic before and after the fix, and inspect identity logs for access from unexpected locations or times. In a distributed Australian business, include regional offices, warehouse networks, field devices and cloud workloads; a quiet Sydney office does not rule out activity in a Perth site or a hosted environment.

Communications must be accurate and coordinated. Executives need a clear statement of business impact and remaining uncertainty, while technical teams need indicators, affected assets and approved actions. Customers, partners, insurers, law enforcement and regulators may require different information. The Australian Cyber Security Centre can be an important source of guidance and reporting support, and sector regulators may impose additional expectations, such as APRA requirements for regulated financial entities.

Do not overstate what DNS logs prove. If the evidence establishes attempted transfer but cannot show whether the payload was successfully reconstructed, say so. Document the confidence level, the time range examined, the systems without complete logs and the steps taken to reduce uncertainty. This makes later legal, privacy and assurance decisions more defensible.

Strengthen Detection And Response Readiness

Long-term improvement starts with resolver visibility. Retain query logs for a period that supports investigations, protect them from tampering, and send them to a central analytics platform. Create detections for high-entropy labels, abnormal label length, unusual query rates, rare domains, excessive TXT requests, suspicious TTL changes and endpoints that bypass approved resolvers.

Detection logic should be tuned to Australian operating conditions. A mining site, retail branch or regional clinic may have different baseline traffic from a Sydney corporate office, while overnight activity may be normal for a 24-hour operation. Build asset and business context into alerts so analysts can separate a legitimate application from a compromised device without weakening the control for everyone else.

Run exercises that include network operations, service providers, privacy specialists and business owners. Practise a scenario in which a managed endpoint sends customer records through DNS while the attacker changes domains and a key administrator is unavailable. Test who can isolate a host, who can approve resolver restrictions, who contacts a supplier, and who assesses notification obligations.

Finally, map DNS tunnelling to the organisation’s broader incident-response framework and security controls, including endpoint detection, identity protection, network segmentation and backup recovery. The strongest defence is a layered one: trustworthy DNS infrastructure, restricted egress, capable endpoint telemetry, tested playbooks and people who can make decisions under pressure.

DNS tunnelling is dangerous because it hides inside a service organisations need every day. The essential memory is simple: preserve the evidence, contain the resolver path, trace the endpoint and account, determine what data was exposed, and validate every system before trusting it again.